1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0033818: Data Exchange - Regenerate flex file with latest version

Regenerated bison and Flex files.
  Flex: 2.6.4 dev (august 2024)
  Bison: 3.7.4 release
This commit is contained in:
dpasukhi 2024-09-07 12:24:12 +00:00
parent ed20837d8b
commit 75efe3538e
17 changed files with 4237 additions and 2569 deletions

@ -107,8 +107,8 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
# choose appropriate extension for generated files: "cxx" if source file contains # choose appropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise # instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c") set (BISON_OUTPUT_FILE_EXT "cxx")
set (FLEX_OUTPUT_FILE_EXT "c") set (FLEX_OUTPUT_FILE_EXT "cxx")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT) file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT}) foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE}) string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})

@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4. // A Bison parser, made by GNU Bison 3.8.2.
// Skeleton implementation for Bison LALR(1) parsers in C++ // Skeleton implementation for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// You should have received a copy of the GNU General Public License // 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/>.
// As a special exception, you may create a larger work that contains // As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work // part or all of the Bison parser skeleton and distribute that work
@ -176,7 +176,7 @@ static Express_HSequenceOfField *mkflist ( Express_Field *field, Express_HSequen
#else // !YYDEBUG #else // !YYDEBUG
# define YYCDEBUG if (false) std::cerr # define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) # define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast<void> (0) # define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
# define YY_STACK_PRINT() static_cast<void> (0) # define YY_STACK_PRINT() static_cast<void> (0)
@ -209,9 +209,9 @@ namespace exptocas {
parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
{} {}
/*---------------. /*---------.
| symbol kinds. | | symbol. |
`---------------*/ `---------*/
// basic_symbol. // basic_symbol.
template <typename Base> template <typename Base>
@ -229,11 +229,12 @@ namespace exptocas {
{} {}
template <typename Base> template <typename Base>
parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v) parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (value_type) v)
: Base (t) : Base (t)
, value (YY_MOVE (v)) , value (YY_MOVE (v))
{} {}
template <typename Base> template <typename Base>
parser::symbol_kind_type parser::symbol_kind_type
parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
@ -241,6 +242,7 @@ namespace exptocas {
return this->kind (); return this->kind ();
} }
template <typename Base> template <typename Base>
bool bool
parser::basic_symbol<Base>::empty () const YY_NOEXCEPT parser::basic_symbol<Base>::empty () const YY_NOEXCEPT
@ -257,28 +259,30 @@ namespace exptocas {
} }
// by_kind. // by_kind.
parser::by_kind::by_kind () parser::by_kind::by_kind () YY_NOEXCEPT
: kind_ (symbol_kind::S_YYEMPTY) : kind_ (symbol_kind::S_YYEMPTY)
{} {}
#if 201103L <= YY_CPLUSPLUS #if 201103L <= YY_CPLUSPLUS
parser::by_kind::by_kind (by_kind&& that) parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT
: kind_ (that.kind_) : kind_ (that.kind_)
{ {
that.clear (); that.clear ();
} }
#endif #endif
parser::by_kind::by_kind (const by_kind& that) parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT
: kind_ (that.kind_) : kind_ (that.kind_)
{} {}
parser::by_kind::by_kind (token_kind_type t) parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT
: kind_ (yytranslate_ (t)) : kind_ (yytranslate_ (t))
{} {}
void void
parser::by_kind::clear () parser::by_kind::clear () YY_NOEXCEPT
{ {
kind_ = symbol_kind::S_YYEMPTY; kind_ = symbol_kind::S_YYEMPTY;
} }
@ -296,6 +300,7 @@ namespace exptocas {
return kind_; return kind_;
} }
parser::symbol_kind_type parser::symbol_kind_type
parser::by_kind::type_get () const YY_NOEXCEPT parser::by_kind::type_get () const YY_NOEXCEPT
{ {
@ -303,6 +308,7 @@ namespace exptocas {
} }
// by_state. // by_state.
parser::by_state::by_state () YY_NOEXCEPT parser::by_state::by_state () YY_NOEXCEPT
: state (empty_state) : state (empty_state)
@ -385,7 +391,7 @@ namespace exptocas {
YY_SYMBOL_PRINT (yymsg, yysym); YY_SYMBOL_PRINT (yymsg, yysym);
// User destructor. // User destructor.
YYUSE (yysym.kind ()); YY_USE (yysym.kind ());
} }
#if YYDEBUG #if YYDEBUG
@ -394,7 +400,7 @@ namespace exptocas {
parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
{ {
std::ostream& yyoutput = yyo; std::ostream& yyoutput = yyo;
YYUSE (yyoutput); YY_USE (yyoutput);
if (yysym.empty ()) if (yysym.empty ())
yyo << "empty symbol"; yyo << "empty symbol";
else else
@ -402,7 +408,7 @@ namespace exptocas {
symbol_kind_type yykind = yysym.kind (); symbol_kind_type yykind = yysym.kind ();
yyo << (yykind < YYNTOKENS ? "token" : "nterm") yyo << (yykind < YYNTOKENS ? "token" : "nterm")
<< ' ' << yysym.name () << " ("; << ' ' << yysym.name () << " (";
YYUSE (yykind); YY_USE (yykind);
yyo << ')'; yyo << ')';
} }
} }
@ -428,7 +434,7 @@ namespace exptocas {
} }
void void
parser::yypop_ (int n) parser::yypop_ (int n) YY_NOEXCEPT
{ {
yystack_.pop (n); yystack_.pop (n);
} }
@ -471,13 +477,13 @@ namespace exptocas {
} }
bool bool
parser::yy_pact_value_is_default_ (int yyvalue) parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
{ {
return yyvalue == yypact_ninf_; return yyvalue == yypact_ninf_;
} }
bool bool
parser::yy_table_value_is_error_ (int yyvalue) parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
{ {
return yyvalue == yytable_ninf_; return yyvalue == yytable_ninf_;
} }
@ -1087,6 +1093,10 @@ namespace exptocas {
const short parser::yypact_ninf_ = -134; const short parser::yypact_ninf_ = -134;
const signed char parser::yytable_ninf_ = -1; const signed char parser::yytable_ninf_ = -1;
@ -1145,10 +1155,10 @@ namespace exptocas {
-64, 31, -134, -134, -127, -134, -134, -7, 18, -131 -64, 31, -134, -134, -127, -134, -134, -7, 18, -131
}; };
const short const unsigned char
parser::yydefgoto_[] = parser::yydefgoto_[] =
{ {
-1, 2, 9, 10, 11, 12, 13, 14, 15, 109, 0, 2, 9, 10, 11, 12, 13, 14, 15, 109,
49, 40, 41, 42, 43, 72, 152, 47, 24, 61, 49, 40, 41, 42, 43, 72, 152, 47, 24, 61,
85, 86, 87, 88, 119, 121, 123, 124, 106, 166 85, 86, 87, 88, 119, 121, 123, 124, 106, 166
}; };
@ -1306,7 +1316,7 @@ namespace exptocas {
#endif // YYDEBUG #endif // YYDEBUG
parser::symbol_kind_type parser::symbol_kind_type
parser::yytranslate_ (int t) parser::yytranslate_ (int t) YY_NOEXCEPT
{ {
// YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
// TOKEN-NUM as returned by yylex. // TOKEN-NUM as returned by yylex.
@ -1350,7 +1360,7 @@ namespace exptocas {
if (t <= 0) if (t <= 0)
return symbol_kind::S_YYEOF; return symbol_kind::S_YYEOF;
else if (t <= code_max) else if (t <= code_max)
return YY_CAST (symbol_kind_type, translate_table[t]); return static_cast <symbol_kind_type> (translate_table[t]);
else else
return symbol_kind::S_YYUNDEF; return symbol_kind::S_YYUNDEF;
} }

@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4. // A Bison parser, made by GNU Bison 3.8.2.
// Skeleton interface for Bison LALR(1) parsers in C++ // Skeleton interface for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// You should have received a copy of the GNU General Public License // 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/>.
// As a special exception, you may create a larger work that contains // As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work // part or all of the Bison parser skeleton and distribute that work
@ -148,17 +148,23 @@ namespace exptocas {
/* Suppress unused-variable warnings by "using" E. */ /* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__ #if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E)) # define YY_USE(E) ((void) (E))
#else #else
# define YYUSE(E) /* empty */ # define YY_USE(E) /* empty */
#endif #endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop") _Pragma ("GCC diagnostic pop")
#else #else
@ -219,9 +225,14 @@ namespace exptocas {
class parser class parser
{ {
public: public:
#ifndef YYSTYPE #ifdef YYSTYPE
# ifdef __GNUC__
# pragma GCC message "bison: do not #define YYSTYPE in C++, use %define api.value.type"
# endif
typedef YYSTYPE value_type;
#else
/// Symbol semantic values. /// Symbol semantic values.
union semantic_type union value_type
{ {
int num; int num;
@ -237,9 +248,10 @@ namespace exptocas {
}; };
#else
typedef YYSTYPE semantic_type;
#endif #endif
/// Backward compatibility (Bison 3.8).
typedef value_type semantic_type;
/// Syntax errors thrown from user actions. /// Syntax errors thrown from user actions.
struct syntax_error : std::runtime_error struct syntax_error : std::runtime_error
@ -302,7 +314,7 @@ namespace exptocas {
}; };
/// Token kind, as returned by yylex. /// Token kind, as returned by yylex.
typedef token::yytokentype token_kind_type; typedef token::token_kind_type token_kind_type;
/// Backward compatibility alias (Bison 3.6). /// Backward compatibility alias (Bison 3.6).
typedef token_kind_type token_type; typedef token_kind_type token_type;
@ -412,7 +424,7 @@ namespace exptocas {
typedef Base super_type; typedef Base super_type;
/// Default constructor. /// Default constructor.
basic_symbol () basic_symbol () YY_NOEXCEPT
: value () : value ()
{} {}
@ -431,7 +443,7 @@ namespace exptocas {
/// Constructor for symbols with semantic value. /// Constructor for symbols with semantic value.
basic_symbol (typename Base::kind_type t, basic_symbol (typename Base::kind_type t,
YY_RVREF (semantic_type) v); YY_RVREF (value_type) v);
/// Destroy the symbol. /// Destroy the symbol.
~basic_symbol () ~basic_symbol ()
@ -439,8 +451,10 @@ namespace exptocas {
clear (); clear ();
} }
/// Destroy contents, and record that is empty. /// Destroy contents, and record that is empty.
void clear () void clear () YY_NOEXCEPT
{ {
Base::clear (); Base::clear ();
} }
@ -464,7 +478,7 @@ namespace exptocas {
void move (basic_symbol& s); void move (basic_symbol& s);
/// The semantic value. /// The semantic value.
semantic_type value; value_type value;
private: private:
#if YY_CPLUSPLUS < 201103L #if YY_CPLUSPLUS < 201103L
@ -476,25 +490,27 @@ namespace exptocas {
/// Type access provider for token (enum) based symbols. /// Type access provider for token (enum) based symbols.
struct by_kind struct by_kind
{ {
/// Default constructor.
by_kind ();
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that);
#endif
/// Copy constructor.
by_kind (const by_kind& that);
/// The symbol kind as needed by the constructor. /// The symbol kind as needed by the constructor.
typedef token_kind_type kind_type; typedef token_kind_type kind_type;
/// Default constructor.
by_kind () YY_NOEXCEPT;
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that) YY_NOEXCEPT;
#endif
/// Copy constructor.
by_kind (const by_kind& that) YY_NOEXCEPT;
/// Constructor from (external) token numbers. /// Constructor from (external) token numbers.
by_kind (kind_type t); by_kind (kind_type t) YY_NOEXCEPT;
/// Record that this symbol is empty. /// Record that this symbol is empty.
void clear (); void clear () YY_NOEXCEPT;
/// Steal the symbol kind from \a that. /// Steal the symbol kind from \a that.
void move (by_kind& that); void move (by_kind& that);
@ -586,19 +602,19 @@ namespace exptocas {
/// Whether the given \c yypact_ value indicates a defaulted state. /// Whether the given \c yypact_ value indicates a defaulted state.
/// \param yyvalue the value to check /// \param yyvalue the value to check
static bool yy_pact_value_is_default_ (int yyvalue); static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
/// Whether the given \c yytable_ value indicates a syntax error. /// Whether the given \c yytable_ value indicates a syntax error.
/// \param yyvalue the value to check /// \param yyvalue the value to check
static bool yy_table_value_is_error_ (int yyvalue); static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
static const short yypact_ninf_; static const short yypact_ninf_;
static const signed char yytable_ninf_; static const signed char yytable_ninf_;
/// Convert a scanner token kind \a t to a symbol kind. /// Convert a scanner token kind \a t to a symbol kind.
/// In theory \a t should be a token_kind_type, but character literals /// In theory \a t should be a token_kind_type, but character literals
/// are valid, yet not members of the token_type enum. /// are valid, yet not members of the token_kind_type enum.
static symbol_kind_type yytranslate_ (int t); static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
#if YYDEBUG || 0 #if YYDEBUG || 0
/// For a symbol, its name in clear. /// For a symbol, its name in clear.
@ -620,7 +636,7 @@ namespace exptocas {
static const short yypgoto_[]; static const short yypgoto_[];
// YYDEFGOTO[NTERM-NUM]. // YYDEFGOTO[NTERM-NUM].
static const short yydefgoto_[]; static const unsigned char yydefgoto_[];
// YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
// positive, shift that token. If negative, reduce the rule whose // positive, shift that token. If negative, reduce the rule whose
@ -629,14 +645,14 @@ namespace exptocas {
static const short yycheck_[]; static const short yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
// symbol of state STATE-NUM. // state STATE-NUM.
static const signed char yystos_[]; static const signed char yystos_[];
// YYR1[YYN] -- Symbol number of symbol that rule YYN derives. // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
static const signed char yyr1_[]; static const signed char yyr1_[];
// YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
static const signed char yyr2_[]; static const signed char yyr2_[];
@ -735,7 +751,7 @@ namespace exptocas {
typedef typename S::size_type size_type; typedef typename S::size_type size_type;
typedef typename std::ptrdiff_t index_type; typedef typename std::ptrdiff_t index_type;
stack (size_type n = 200) stack (size_type n = 200) YY_NOEXCEPT
: seq_ (n) : seq_ (n)
{} {}
@ -814,7 +830,7 @@ namespace exptocas {
class slice class slice
{ {
public: public:
slice (const stack& stack, index_type range) slice (const stack& stack, index_type range) YY_NOEXCEPT
: stack_ (stack) : stack_ (stack)
, range_ (range) , range_ (range)
{} {}
@ -864,7 +880,7 @@ namespace exptocas {
void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
/// Pop \a n symbols from the stack. /// Pop \a n symbols from the stack.
void yypop_ (int n = 1); void yypop_ (int n = 1) YY_NOEXCEPT;
/// Constants. /// Constants.
enum enum

File diff suppressed because it is too large Load Diff

@ -17,7 +17,7 @@
%option yywrap %option yywrap
%{ %{
#include <ExprIntrp.tab.h> #include <ExprIntrp.tab.hxx>
#include <ExprIntrp_yaccintrf.hxx> #include <ExprIntrp_yaccintrf.hxx>

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.7.4. */ /* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison implementation for Yacc-like parsers in C /* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc. Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -16,7 +16,7 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License 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/>. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -46,10 +46,10 @@
USER NAME SPACE" below. */ USER NAME SPACE" below. */
/* Identify Bison output, and Bison version. */ /* Identify Bison output, and Bison version. */
#define YYBISON 30704 #define YYBISON 30802
/* Bison version string. */ /* Bison version string. */
#define YYBISON_VERSION "3.7.4" #define YYBISON_VERSION "3.8.2"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@ -151,7 +151,7 @@ extern void ExprIntrp_EndOfEqual();
# endif # endif
# endif # endif
#include "ExprIntrp.tab.h" #include "ExprIntrp.tab.hxx"
/* Symbol kind. */ /* Symbol kind. */
enum yysymbol_kind_t enum yysymbol_kind_t
{ {
@ -267,6 +267,18 @@ typedef int_least16_t yytype_int16;
typedef short yytype_int16; typedef short yytype_int16;
#endif #endif
/* Work around bug in HP-UX 11.23, which defines these macros
incorrectly for preprocessor constants. This workaround can likely
be removed in 2023, as HPE has promised support for HP-UX 11.23
(aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
<https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
# define UINT_LEAST8_MAX 255
# define UINT_LEAST16_MAX 65535
#endif
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8; typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
@ -364,17 +376,23 @@ typedef int yy_state_fast_t;
/* Suppress unused-variable warnings by "using" E. */ /* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__ #if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E)) # define YY_USE(E) ((void) (E))
#else #else
# define YYUSE(E) /* empty */ # define YY_USE(E) /* empty */
#endif #endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop") _Pragma ("GCC diagnostic pop")
#else #else
@ -590,7 +608,7 @@ static const yytype_int8 yytranslate[] =
}; };
#if YYDEBUG #if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] = static const yytype_uint8 yyrline[] =
{ {
0, 80, 80, 81, 82, 83, 84, 87, 87, 90, 0, 80, 80, 81, 82, 83, 84, 87, 87, 90,
@ -637,17 +655,6 @@ yysymbol_name (yysymbol_kind_t yysymbol)
} }
#endif #endif
#ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
static const yytype_int16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 10
};
#endif
#define YYPACT_NINF (-51) #define YYPACT_NINF (-51)
#define yypact_value_is_default(Yyn) \ #define yypact_value_is_default(Yyn) \
@ -658,8 +665,8 @@ static const yytype_int16 yytoknum[] =
#define yytable_value_is_error(Yyn) \ #define yytable_value_is_error(Yyn) \
0 0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */ STATE-NUM. */
static const yytype_int16 yypact[] = static const yytype_int16 yypact[] =
{ {
4, 62, 62, 62, 62, -51, 2, 87, 39, 58, 4, 62, 62, 62, 62, -51, 2, 87, 39, 58,
@ -679,9 +686,9 @@ static const yytype_int16 yypact[] =
140, 171, 172, -51, -51, 174, 175, -51, -51 140, 171, 172, -51, -51, 174, 175, -51, -51
}; };
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */ means the default is an error. */
static const yytype_int8 yydefact[] = static const yytype_int8 yydefact[] =
{ {
0, 0, 0, 0, 0, 28, 27, 0, 0, 0, 0, 0, 0, 0, 0, 28, 27, 0, 0, 0,
@ -701,7 +708,7 @@ static const yytype_int8 yydefact[] =
0, 0, 0, 62, 65, 0, 0, 63, 66 0, 0, 0, 62, 65, 0, 0, 63, 66
}; };
/* YYPGOTO[NTERM-NUM]. */ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] = static const yytype_int8 yypgoto[] =
{ {
-51, -51, -51, -51, -51, -51, 0, -51, -51, -51, -51, -51, -51, -51, -51, -51, 0, -51, -51, -51,
@ -711,19 +718,19 @@ static const yytype_int8 yypgoto[] =
-35, -51 -35, -51
}; };
/* YYDEFGOTO[NTERM-NUM]. */ /* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] = static const yytype_uint8 yydefgoto[] =
{ {
-1, 13, 14, 36, 15, 94, 79, 17, 18, 19, 0, 13, 14, 36, 15, 94, 79, 17, 18, 19,
57, 80, 112, 20, 21, 58, 22, 37, 23, 66, 57, 80, 112, 20, 21, 58, 22, 37, 23, 66,
129, 42, 24, 38, 89, 114, 90, 25, 116, 117, 129, 42, 24, 38, 89, 114, 90, 25, 116, 117,
135, 26, 95, 126, 27, 119, 145, 28, 120, 146, 135, 26, 95, 126, 27, 119, 145, 28, 120, 146,
29, 30 29, 30
}; };
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule whose positive, shift that token. If negative, reduce the rule whose
number is the opposite. If YYTABLE_NINF, syntax error. */ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] = static const yytype_int16 yytable[] =
{ {
16, 32, 33, 34, 35, 41, 81, 1, 2, 48, 16, 32, 33, 34, 35, 41, 81, 1, 2, 48,
@ -770,8 +777,8 @@ static const yytype_int16 yycheck[] =
13, 11, -1, 12, 12, 11, 11, -1, 114, 66 13, 11, -1, 12, 12, 11, 11, -1, 114, 66
}; };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
symbol of state STATE-NUM. */ state STATE-NUM. */
static const yytype_int8 yystos[] = static const yytype_int8 yystos[] =
{ {
0, 3, 4, 8, 9, 12, 13, 15, 17, 19, 0, 3, 4, 8, 9, 12, 13, 15, 17, 19,
@ -791,7 +798,7 @@ static const yytype_int8 yystos[] =
32, 14, 14, 12, 12, 62, 65, 11, 11 32, 14, 14, 12, 12, 62, 65, 11, 11
}; };
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
static const yytype_int8 yyr1[] = static const yytype_int8 yyr1[] =
{ {
0, 26, 27, 27, 27, 27, 27, 29, 28, 31, 0, 26, 27, 27, 27, 27, 27, 29, 28, 31,
@ -804,7 +811,7 @@ static const yytype_int8 yyr1[] =
67 67
}; };
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
static const yytype_int8 yyr2[] = static const yytype_int8 yyr2[] =
{ {
0, 2, 1, 1, 1, 1, 1, 0, 4, 0, 0, 2, 1, 1, 1, 1, 1, 0, 4, 0,
@ -826,6 +833,7 @@ enum { YYENOMEM = -2 };
#define YYACCEPT goto yyacceptlab #define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab #define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab #define YYERROR goto yyerrorlab
#define YYNOMEM goto yyexhaustedlab
#define YYRECOVERING() (!!yyerrstatus) #define YYRECOVERING() (!!yyerrstatus)
@ -866,10 +874,7 @@ do { \
YYFPRINTF Args; \ YYFPRINTF Args; \
} while (0) } while (0)
/* This macro is provided for backward compatibility. */
# ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
@ -893,15 +898,11 @@ yy_symbol_value_print (FILE *yyo,
yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{ {
FILE *yyoutput = yyo; FILE *yyoutput = yyo;
YYUSE (yyoutput); YY_USE (yyoutput);
if (!yyvaluep) if (!yyvaluep)
return; return;
# ifdef YYPRINT
if (yykind < YYNTOKENS)
YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
# endif
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yykind); YY_USE (yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END YY_IGNORE_MAYBE_UNINITIALIZED_END
} }
@ -1015,13 +1016,13 @@ static void
yydestruct (const char *yymsg, yydestruct (const char *yymsg,
yysymbol_kind_t yykind, YYSTYPE *yyvaluep) yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{ {
YYUSE (yyvaluep); YY_USE (yyvaluep);
if (!yymsg) if (!yymsg)
yymsg = "Deleting"; yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yykind); YY_USE (yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END YY_IGNORE_MAYBE_UNINITIALIZED_END
} }
@ -1084,6 +1085,7 @@ yyparse (void)
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate; goto yysetstate;
@ -1109,7 +1111,7 @@ yysetstate:
if (yyss + yystacksize - 1 <= yyssp) if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE #if !defined yyoverflow && !defined YYSTACK_RELOCATE
goto yyexhaustedlab; YYNOMEM;
#else #else
{ {
/* Get the current used size of the three stacks, in elements. */ /* Get the current used size of the three stacks, in elements. */
@ -1137,7 +1139,7 @@ yysetstate:
# else /* defined YYSTACK_RELOCATE */ # else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */ /* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize) if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab; YYNOMEM;
yystacksize *= 2; yystacksize *= 2;
if (YYMAXDEPTH < yystacksize) if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH; yystacksize = YYMAXDEPTH;
@ -1148,7 +1150,7 @@ yysetstate:
YY_CAST (union yyalloc *, YY_CAST (union yyalloc *,
YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; YYNOMEM;
YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
@ -1170,6 +1172,7 @@ yysetstate:
} }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL) if (yystate == YYFINAL)
YYACCEPT; YYACCEPT;
@ -1551,6 +1554,7 @@ yyerrorlab:
label yyerrorlab therefore never appears in user code. */ label yyerrorlab therefore never appears in user code. */
if (0) if (0)
YYERROR; YYERROR;
++yynerrs;
/* Do not reclaim the symbols of the rule whose action triggered /* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */ this YYERROR. */
@ -1611,7 +1615,7 @@ yyerrlab1:
`-------------------------------------*/ `-------------------------------------*/
yyacceptlab: yyacceptlab:
yyresult = 0; yyresult = 0;
goto yyreturn; goto yyreturnlab;
/*-----------------------------------. /*-----------------------------------.
@ -1619,24 +1623,22 @@ yyacceptlab:
`-----------------------------------*/ `-----------------------------------*/
yyabortlab: yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturnlab;
#if !defined yyoverflow /*-----------------------------------------------------------.
/*-------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
| yyexhaustedlab -- memory exhaustion comes here. | `-----------------------------------------------------------*/
`-------------------------------------------------*/
yyexhaustedlab: yyexhaustedlab:
yyerror (YY_("memory exhausted")); yyerror (YY_("memory exhausted"));
yyresult = 2; yyresult = 2;
goto yyreturn; goto yyreturnlab;
#endif
/*-------------------------------------------------------. /*----------------------------------------------------------.
| yyreturn -- parsing is finished, clean up and return. | | yyreturnlab -- parsing is finished, clean up and return. |
`-------------------------------------------------------*/ `----------------------------------------------------------*/
yyreturn: yyreturnlab:
if (yychar != YYEMPTY) if (yychar != YYEMPTY)
{ {
/* Make sure we have latest lookahead translation. See comments at /* Make sure we have latest lookahead translation. See comments at

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.7.4. */ /* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc. Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -16,7 +16,7 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License 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/>. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -35,8 +35,8 @@
especially those whose name start with YY_ or yy_. They are especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */ private implementation details that can be changed or removed. */
#ifndef YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED #ifndef YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED
# define YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED # define YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED
/* Debug traces. */ /* Debug traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
@ -90,6 +90,8 @@ typedef int YYSTYPE;
extern YYSTYPE ExprIntrplval; extern YYSTYPE ExprIntrplval;
int ExprIntrpparse (void); int ExprIntrpparse (void);
#endif /* !YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED */
#endif /* !YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED */

@ -56,27 +56,27 @@ static TCollection_AsciiString ExprIntrp_funcdefname;
static Standard_Integer ExprIntrp_nbargs; static Standard_Integer ExprIntrp_nbargs;
static Standard_Integer ExprIntrp_nbdiff; static Standard_Integer ExprIntrp_nbdiff;
extern "C" void ExprIntrp_StartFunction() void ExprIntrp_StartFunction()
{ {
const TCollection_AsciiString& name = ExprIntrp_GetResult(); const TCollection_AsciiString& name = ExprIntrp_GetResult();
ExprIntrp_Recept.PushName(name); ExprIntrp_Recept.PushName(name);
ExprIntrp_nbargs = 0; ExprIntrp_nbargs = 0;
} }
extern "C" void ExprIntrp_StartDerivate() void ExprIntrp_StartDerivate()
{ {
const TCollection_AsciiString& name = ExprIntrp_GetResult(); const TCollection_AsciiString& name = ExprIntrp_GetResult();
ExprIntrp_Recept.PushName(name); ExprIntrp_Recept.PushName(name);
} }
extern "C" void ExprIntrp_EndDerivate() void ExprIntrp_EndDerivate()
{ {
int degree; int degree;
degree = ExprIntrp_GetDegree(); degree = ExprIntrp_GetDegree();
ExprIntrp_Recept.PushValue(degree); ExprIntrp_Recept.PushValue(degree);
} }
extern "C" void ExprIntrp_Derivation() void ExprIntrp_Derivation()
{ {
ExprIntrp_Recept.PushValue(1); ExprIntrp_Recept.PushValue(1);
const TCollection_AsciiString& thename = ExprIntrp_GetResult(); const TCollection_AsciiString& thename = ExprIntrp_GetResult();
@ -90,14 +90,14 @@ extern "C" void ExprIntrp_Derivation()
ExprIntrp_Recept.Push(namexp); ExprIntrp_Recept.Push(namexp);
} }
extern "C" void ExprIntrp_DerivationValue() void ExprIntrp_DerivationValue()
{ {
const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
ExprIntrp_Recept.PopValue(); ExprIntrp_Recept.PopValue();
ExprIntrp_Recept.PushValue(aStr.IntegerValue()); ExprIntrp_Recept.PushValue(aStr.IntegerValue());
} }
extern "C" void ExprIntrp_EndDerivation() void ExprIntrp_EndDerivation()
{ {
Standard_Integer degree = ExprIntrp_Recept.PopValue(); Standard_Integer degree = ExprIntrp_Recept.PopValue();
Handle(Expr_NamedUnknown) var = Handle(Expr_NamedUnknown)::DownCast(ExprIntrp_Recept.Pop()); Handle(Expr_NamedUnknown) var = Handle(Expr_NamedUnknown)::DownCast(ExprIntrp_Recept.Pop());
@ -106,13 +106,13 @@ extern "C" void ExprIntrp_EndDerivation()
ExprIntrp_Recept.Push(exp); ExprIntrp_Recept.Push(exp);
} }
extern "C" void ExprIntrp_StartDifferential() void ExprIntrp_StartDifferential()
{ {
ExprIntrp_StartDerivate(); ExprIntrp_StartDerivate();
ExprIntrp_nbdiff = 0; ExprIntrp_nbdiff = 0;
} }
extern "C" void ExprIntrp_DiffDegreeVar() void ExprIntrp_DiffDegreeVar()
{ {
const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
const char* s = aStr.ToCString(); const char* s = aStr.ToCString();
@ -125,20 +125,20 @@ extern "C" void ExprIntrp_DiffDegreeVar()
ExprIntrp_nbdiff++; ExprIntrp_nbdiff++;
} }
extern "C" void ExprIntrp_DiffVar() void ExprIntrp_DiffVar()
{ {
ExprIntrp_Recept.PushValue(1); ExprIntrp_Recept.PushValue(1);
ExprIntrp_DiffDegreeVar(); ExprIntrp_DiffDegreeVar();
} }
extern "C" void ExprIntrp_DiffDegree() void ExprIntrp_DiffDegree()
{ {
const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
Standard_Integer deg = aStr.IntegerValue(); Standard_Integer deg = aStr.IntegerValue();
ExprIntrp_Recept.PushValue(deg); ExprIntrp_Recept.PushValue(deg);
} }
extern "C" void ExprIntrp_VerDiffDegree() void ExprIntrp_VerDiffDegree()
{ {
const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
Standard_Integer deg = aStr.IntegerValue(); Standard_Integer deg = aStr.IntegerValue();
@ -149,7 +149,7 @@ extern "C" void ExprIntrp_VerDiffDegree()
ExprIntrp_Recept.PushValue(deg); ExprIntrp_Recept.PushValue(deg);
} }
extern "C" void ExprIntrp_EndDifferential() void ExprIntrp_EndDifferential()
{ {
TCollection_AsciiString name = ExprIntrp_Recept.PopName(); TCollection_AsciiString name = ExprIntrp_Recept.PopName();
Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.GetFunction(name); Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.GetFunction(name);
@ -172,7 +172,7 @@ extern "C" void ExprIntrp_EndDifferential()
ExprIntrp_Recept.PushFunction(thefunc); ExprIntrp_Recept.PushFunction(thefunc);
} }
extern "C" void ExprIntrp_EndDiffFunction() void ExprIntrp_EndDiffFunction()
{ {
Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.PopFunction(); Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.PopFunction();
if (thefunc.IsNull()) { if (thefunc.IsNull()) {
@ -276,7 +276,7 @@ static Handle(Expr_GeneralExpression) ExprIntrp_StandardFunction(const TCollecti
} }
extern "C" void ExprIntrp_EndDerFunction() void ExprIntrp_EndDerFunction()
{ {
TCollection_AsciiString name = ExprIntrp_Recept.PopName(); TCollection_AsciiString name = ExprIntrp_Recept.PopName();
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
@ -323,7 +323,7 @@ extern "C" void ExprIntrp_EndDerFunction()
} }
} }
extern "C" void ExprIntrp_EndFunction() void ExprIntrp_EndFunction()
{ {
TCollection_AsciiString name = ExprIntrp_Recept.PopName(); TCollection_AsciiString name = ExprIntrp_Recept.PopName();
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
@ -370,17 +370,17 @@ extern "C" void ExprIntrp_EndFunction()
} }
} }
extern "C" void ExprIntrp_NextFuncArg() void ExprIntrp_NextFuncArg()
{ {
ExprIntrp_nbargs++; ExprIntrp_nbargs++;
} }
extern "C" void ExprIntrp_EndFuncArg() void ExprIntrp_EndFuncArg()
{ {
ExprIntrp_nbargs++; ExprIntrp_nbargs++;
} }
extern "C" void ExprIntrp_SumOperator() void ExprIntrp_SumOperator()
{ {
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@ -389,7 +389,7 @@ extern "C" void ExprIntrp_SumOperator()
ExprIntrp_Recept.Push(res); ExprIntrp_Recept.Push(res);
} }
extern "C" void ExprIntrp_MinusOperator() void ExprIntrp_MinusOperator()
{ {
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@ -397,7 +397,7 @@ extern "C" void ExprIntrp_MinusOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified()); ExprIntrp_Recept.Push(res->ShallowSimplified());
} }
extern "C" void ExprIntrp_DivideOperator() void ExprIntrp_DivideOperator()
{ {
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@ -405,7 +405,7 @@ extern "C" void ExprIntrp_DivideOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified()); ExprIntrp_Recept.Push(res->ShallowSimplified());
} }
extern "C" void ExprIntrp_ExpOperator() void ExprIntrp_ExpOperator()
{ {
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@ -413,7 +413,7 @@ extern "C" void ExprIntrp_ExpOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified()); ExprIntrp_Recept.Push(res->ShallowSimplified());
} }
extern "C" void ExprIntrp_ProductOperator() void ExprIntrp_ProductOperator()
{ {
Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop();
@ -421,20 +421,20 @@ extern "C" void ExprIntrp_ProductOperator()
ExprIntrp_Recept.Push(res->ShallowSimplified()); ExprIntrp_Recept.Push(res->ShallowSimplified());
} }
extern "C" void ExprIntrp_UnaryMinusOperator() void ExprIntrp_UnaryMinusOperator()
{ {
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
Handle(Expr_UnaryMinus) res = new Expr_UnaryMinus(op); Handle(Expr_UnaryMinus) res = new Expr_UnaryMinus(op);
ExprIntrp_Recept.Push(res->ShallowSimplified()); ExprIntrp_Recept.Push(res->ShallowSimplified());
} }
extern "C" void ExprIntrp_UnaryPlusOperator() void ExprIntrp_UnaryPlusOperator()
{ {
Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop();
ExprIntrp_Recept.Push(op); ExprIntrp_Recept.Push(op);
} }
extern "C" void ExprIntrp_VariableIdentifier() void ExprIntrp_VariableIdentifier()
{ {
const TCollection_AsciiString& thename = ExprIntrp_GetResult(); const TCollection_AsciiString& thename = ExprIntrp_GetResult();
Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename); Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename);
@ -445,7 +445,7 @@ extern "C" void ExprIntrp_VariableIdentifier()
ExprIntrp_Recept.Push(nameexp); ExprIntrp_Recept.Push(nameexp);
} }
extern "C" void ExprIntrp_NumValue() void ExprIntrp_NumValue()
{ {
const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
Standard_Real value = aStr.RealValue(); Standard_Real value = aStr.RealValue();
@ -453,12 +453,12 @@ extern "C" void ExprIntrp_NumValue()
ExprIntrp_Recept.Push(nval); ExprIntrp_Recept.Push(nval);
} }
extern "C" void ExprIntrp_AssignVariable() void ExprIntrp_AssignVariable()
{ {
ExprIntrp_assname = ExprIntrp_GetResult(); ExprIntrp_assname = ExprIntrp_GetResult();
} }
extern "C" void ExprIntrp_Deassign() void ExprIntrp_Deassign()
{ {
const TCollection_AsciiString& thename = ExprIntrp_GetResult(); const TCollection_AsciiString& thename = ExprIntrp_GetResult();
Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename); Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename);
@ -472,25 +472,25 @@ extern "C" void ExprIntrp_Deassign()
var->Deassign(); var->Deassign();
} }
extern "C" void ExprIntrp_DefineFunction() void ExprIntrp_DefineFunction()
{ {
ExprIntrp_funcdefname = ExprIntrp_Recept.PopName(); ExprIntrp_funcdefname = ExprIntrp_Recept.PopName();
ExprIntrp_Recept.PushValue(ExprIntrp_nbargs); ExprIntrp_Recept.PushValue(ExprIntrp_nbargs);
} }
extern "C" void ExprIntrp_close() void ExprIntrp_close()
{ {
ExprIntrp_stop_string(); ExprIntrp_stop_string();
} }
extern "C" void ExprIntrperror(char* msg) void ExprIntrperror(const char* msg)
{ {
ExprIntrp_close(); ExprIntrp_close();
throw ExprIntrp_SyntaxError(msg); throw ExprIntrp_SyntaxError(msg);
} }
extern "C" void ExprIntrp_EndOfEqual() void ExprIntrp_EndOfEqual()
{ {
Handle(Expr_GeneralExpression) memb2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) memb2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) memb1 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) memb1 = ExprIntrp_Recept.Pop();
@ -498,7 +498,7 @@ extern "C" void ExprIntrp_EndOfEqual()
ExprIntrp_Recept.PushRelation(res); ExprIntrp_Recept.PushRelation(res);
} }
extern "C" void ExprIntrp_EndOfRelation() void ExprIntrp_EndOfRelation()
{ {
Handle(Expr_SystemRelation) sys; Handle(Expr_SystemRelation) sys;
Handle(Expr_GeneralRelation) currel; Handle(Expr_GeneralRelation) currel;
@ -524,7 +524,7 @@ extern "C" void ExprIntrp_EndOfRelation()
} }
} }
extern "C" void ExprIntrp_EndOfAssign() void ExprIntrp_EndOfAssign()
{ {
Handle(Expr_NamedExpression) namexp = ExprIntrp_Recept.GetNamed(ExprIntrp_assname); Handle(Expr_NamedExpression) namexp = ExprIntrp_Recept.GetNamed(ExprIntrp_assname);
Handle(Expr_NamedUnknown) namu; Handle(Expr_NamedUnknown) namu;
@ -542,7 +542,7 @@ extern "C" void ExprIntrp_EndOfAssign()
namu->Assign(ExprIntrp_Recept.Pop()); namu->Assign(ExprIntrp_Recept.Pop());
} }
extern "C" void ExprIntrp_EndOfFuncDef() void ExprIntrp_EndOfFuncDef()
{ {
Handle(Expr_GeneralExpression) theexp = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) theexp = ExprIntrp_Recept.Pop();
Standard_Integer nbargs = ExprIntrp_Recept.PopValue(); Standard_Integer nbargs = ExprIntrp_Recept.PopValue();
@ -571,13 +571,13 @@ extern "C" void ExprIntrp_EndOfFuncDef()
ExprIntrp_Recept.Use(thefunc); ExprIntrp_Recept.Use(thefunc);
} }
extern "C" void ExprIntrp_ConstantIdentifier() void ExprIntrp_ConstantIdentifier()
{ {
const TCollection_AsciiString& thename = ExprIntrp_GetResult(); const TCollection_AsciiString& thename = ExprIntrp_GetResult();
ExprIntrp_Recept.PushName(thename); ExprIntrp_Recept.PushName(thename);
} }
extern "C" void ExprIntrp_ConstantDefinition() void ExprIntrp_ConstantDefinition()
{ {
TCollection_AsciiString name = ExprIntrp_Recept.PopName(); TCollection_AsciiString name = ExprIntrp_Recept.PopName();
const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
@ -589,7 +589,7 @@ extern "C" void ExprIntrp_ConstantDefinition()
} }
extern "C" void ExprIntrp_Sumator() void ExprIntrp_Sumator()
{ {
Handle(Expr_NumericValue) number = Handle(Expr_NumericValue)::DownCast(ExprIntrp_Recept.Pop()); Handle(Expr_NumericValue) number = Handle(Expr_NumericValue)::DownCast(ExprIntrp_Recept.Pop());
Standard_Integer nb = (Standard_Integer) number->GetValue(); Standard_Integer nb = (Standard_Integer) number->GetValue();
@ -617,7 +617,7 @@ extern "C" void ExprIntrp_Sumator()
ExprIntrp_Recept.Push(res->ShallowSimplified()); ExprIntrp_Recept.Push(res->ShallowSimplified());
} }
extern "C" void ExprIntrp_Productor() void ExprIntrp_Productor()
{ {
Handle(Expr_NumericValue) number = Handle(Expr_NumericValue)::DownCast(ExprIntrp_Recept.Pop()); Handle(Expr_NumericValue) number = Handle(Expr_NumericValue)::DownCast(ExprIntrp_Recept.Pop());
Standard_Integer nb = (Standard_Integer) number->GetValue(); Standard_Integer nb = (Standard_Integer) number->GetValue();

@ -17,12 +17,8 @@
#ifndef ExprIntrp_yaccintrf_HeaderFile #ifndef ExprIntrp_yaccintrf_HeaderFile
#define ExprIntrp_yaccintrf_HeaderFile #define ExprIntrp_yaccintrf_HeaderFile
#ifdef __cplusplus
extern "C" {
#endif
int ExprIntrpparse(); int ExprIntrpparse();
void ExprIntrperror(char* msg); void ExprIntrperror(const char* msg);
void ExprIntrp_start_string(const char* str); void ExprIntrp_start_string(const char* str);
void ExprIntrp_stop_string(); void ExprIntrp_stop_string();
@ -32,17 +28,9 @@ void ExprIntrp_SetDegree();
int ExprIntrplex(void); int ExprIntrplex(void);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
const TCollection_AsciiString& ExprIntrp_GetResult (); const TCollection_AsciiString& ExprIntrp_GetResult ();
int ExprIntrp_GetDegree(); int ExprIntrp_GetDegree();
#endif #endif
#endif

@ -23,16 +23,16 @@ static int ExprIntrp_degree;
#ifndef _WIN32 #ifndef _WIN32
extern char* ExprIntrptext; extern char* ExprIntrptext;
#else #else
extern "C" char* ExprIntrptext; char* ExprIntrptext;
#endif // _WIN32 #endif // _WIN32
extern "C" void ExprIntrp_SetResult() void ExprIntrp_SetResult()
{ {
ExprIntrp_curres = ExprIntrptext; ExprIntrp_curres = ExprIntrptext;
} }
extern "C" void ExprIntrp_SetDegree() void ExprIntrp_SetDegree()
{ {
ExprIntrp_degree = (int)strlen(ExprIntrptext); ExprIntrp_degree = (int)strlen(ExprIntrptext);
} }

@ -1,8 +1,8 @@
ExprIntrp.cxx ExprIntrp.cxx
ExprIntrp.hxx ExprIntrp.hxx
ExprIntrp.lex ExprIntrp.lex
ExprIntrp.tab.c ExprIntrp.tab.cxx
ExprIntrp.tab.h ExprIntrp.tab.hxx
ExprIntrp.yacc ExprIntrp.yacc
ExprIntrp_Analysis.cxx ExprIntrp_Analysis.cxx
ExprIntrp_Analysis.hxx ExprIntrp_Analysis.hxx
@ -27,4 +27,4 @@ ExprIntrp_yaccanal.hxx
ExprIntrp_yaccintrf.cxx ExprIntrp_yaccintrf.cxx
ExprIntrp_yaccintrf.hxx ExprIntrp_yaccintrf.hxx
ExprIntrp_yacclex.cxx ExprIntrp_yacclex.cxx
lex.ExprIntrp.c lex.ExprIntrp.cxx

File diff suppressed because it is too large Load Diff

@ -95,14 +95,14 @@ public:
int lineno() const { return yylineno; } int lineno() const { return yylineno; }
int debug() const { return yy_flex_debug; } int debug() const { return yyflexdebug; }
void set_debug( int flag ) { yy_flex_debug = flag; } void set_debug( int flag ) { yyflexdebug = flag; }
protected: protected:
char* yytext; char* yytext;
int yyleng; int yyleng;
int yylineno; // only maintained if you use %option yylineno int yylineno; // only maintained if you use %option yylineno
int yy_flex_debug; // only has effect with -d or "%option debug" int yyflexdebug; // only has effect with -d or "%option debug"
}; };
} }
@ -139,6 +139,7 @@ public:
void yypush_buffer_state( yy_buffer_state* new_buffer ); void yypush_buffer_state( yy_buffer_state* new_buffer );
void yypop_buffer_state(); void yypop_buffer_state();
virtual int yyread(char *buf, size_t);
virtual int yylex(); virtual int yylex();
virtual void switch_streams( std::istream& new_in, std::ostream& new_out ); virtual void switch_streams( std::istream& new_in, std::ostream& new_out );
virtual void switch_streams( std::istream* new_in = 0, std::ostream* new_out = 0 ); virtual void switch_streams( std::istream* new_in = 0, std::ostream* new_out = 0 );
@ -149,7 +150,7 @@ protected:
virtual void LexerOutput( const char* buf, int size ); virtual void LexerOutput( const char* buf, int size );
virtual void LexerError( const char* msg ); virtual void LexerError( const char* msg );
void yyunput( int c, char* buf_ptr ); void yyunput_r( int c, char* buf_ptr );
int yyinput(); int yyinput();
void yy_load_buffer_state(); void yy_load_buffer_state();
@ -201,6 +202,7 @@ protected:
yy_state_type* yy_state_buf; yy_state_type* yy_state_buf;
yy_state_type* yy_state_ptr; yy_state_type* yy_state_ptr;
size_t yy_state_buf_max;
char* yy_full_match; char* yy_full_match;
int* yy_full_state; int* yy_full_state;

File diff suppressed because it is too large Load Diff

@ -27,12 +27,15 @@
case-insensitive enable case insensitive parsing(any ?i: and other case setting will be ignored) case-insensitive enable case insensitive parsing(any ?i: and other case setting will be ignored)
*/ */
%option c++ %option c++
%option 8bit warn nodefault %option 8bit
%option warn
%option noyywrap %option noyywrap
%option noinput %option noinput
%option yyclass="step::scanner" %option yyclass="step::scanner"
%option noyyalloc noyyfree noyyrealloc %option noyyalloc noyyfree noyyrealloc
%option case-insensitive %option case-insensitive
%option nounistd
%option never-interactive
%top{ %top{
// This file is part of Open CASCADE Technology software library. // This file is part of Open CASCADE Technology software library.

@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4. // A Bison parser, made by GNU Bison 3.8.2.
// Skeleton implementation for Bison LALR(1) parsers in C++ // Skeleton implementation for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// You should have received a copy of the GNU General Public License // 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/>.
// As a special exception, you may create a larger work that contains // As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work // part or all of the Bison parser skeleton and distribute that work
@ -117,7 +117,7 @@ void StepFile_Interrupt (Standard_CString theErrorMessage, const Standard_Boolea
#else // !YYDEBUG #else // !YYDEBUG
# define YYCDEBUG if (false) std::cerr # define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) # define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol)
# define YY_REDUCE_PRINT(Rule) static_cast<void> (0) # define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
# define YY_STACK_PRINT() static_cast<void> (0) # define YY_STACK_PRINT() static_cast<void> (0)
@ -150,9 +150,9 @@ namespace step {
parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
{} {}
/*---------------. /*---------.
| symbol kinds. | | symbol. |
`---------------*/ `---------*/
// basic_symbol. // basic_symbol.
template <typename Base> template <typename Base>
@ -170,11 +170,12 @@ namespace step {
{} {}
template <typename Base> template <typename Base>
parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v) parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (value_type) v)
: Base (t) : Base (t)
, value (YY_MOVE (v)) , value (YY_MOVE (v))
{} {}
template <typename Base> template <typename Base>
parser::symbol_kind_type parser::symbol_kind_type
parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
@ -182,6 +183,7 @@ namespace step {
return this->kind (); return this->kind ();
} }
template <typename Base> template <typename Base>
bool bool
parser::basic_symbol<Base>::empty () const YY_NOEXCEPT parser::basic_symbol<Base>::empty () const YY_NOEXCEPT
@ -198,28 +200,30 @@ namespace step {
} }
// by_kind. // by_kind.
parser::by_kind::by_kind () parser::by_kind::by_kind () YY_NOEXCEPT
: kind_ (symbol_kind::S_YYEMPTY) : kind_ (symbol_kind::S_YYEMPTY)
{} {}
#if 201103L <= YY_CPLUSPLUS #if 201103L <= YY_CPLUSPLUS
parser::by_kind::by_kind (by_kind&& that) parser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT
: kind_ (that.kind_) : kind_ (that.kind_)
{ {
that.clear (); that.clear ();
} }
#endif #endif
parser::by_kind::by_kind (const by_kind& that) parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT
: kind_ (that.kind_) : kind_ (that.kind_)
{} {}
parser::by_kind::by_kind (token_kind_type t) parser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT
: kind_ (yytranslate_ (t)) : kind_ (yytranslate_ (t))
{} {}
void void
parser::by_kind::clear () parser::by_kind::clear () YY_NOEXCEPT
{ {
kind_ = symbol_kind::S_YYEMPTY; kind_ = symbol_kind::S_YYEMPTY;
} }
@ -237,6 +241,7 @@ namespace step {
return kind_; return kind_;
} }
parser::symbol_kind_type parser::symbol_kind_type
parser::by_kind::type_get () const YY_NOEXCEPT parser::by_kind::type_get () const YY_NOEXCEPT
{ {
@ -244,6 +249,7 @@ namespace step {
} }
// by_state. // by_state.
parser::by_state::by_state () YY_NOEXCEPT parser::by_state::by_state () YY_NOEXCEPT
: state (empty_state) : state (empty_state)
@ -326,7 +332,7 @@ namespace step {
YY_SYMBOL_PRINT (yymsg, yysym); YY_SYMBOL_PRINT (yymsg, yysym);
// User destructor. // User destructor.
YYUSE (yysym.kind ()); YY_USE (yysym.kind ());
} }
#if YYDEBUG #if YYDEBUG
@ -335,7 +341,7 @@ namespace step {
parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
{ {
std::ostream& yyoutput = yyo; std::ostream& yyoutput = yyo;
YYUSE (yyoutput); YY_USE (yyoutput);
if (yysym.empty ()) if (yysym.empty ())
yyo << "empty symbol"; yyo << "empty symbol";
else else
@ -343,7 +349,7 @@ namespace step {
symbol_kind_type yykind = yysym.kind (); symbol_kind_type yykind = yysym.kind ();
yyo << (yykind < YYNTOKENS ? "token" : "nterm") yyo << (yykind < YYNTOKENS ? "token" : "nterm")
<< ' ' << yysym.name () << " ("; << ' ' << yysym.name () << " (";
YYUSE (yykind); YY_USE (yykind);
yyo << ')'; yyo << ')';
} }
} }
@ -369,7 +375,7 @@ namespace step {
} }
void void
parser::yypop_ (int n) parser::yypop_ (int n) YY_NOEXCEPT
{ {
yystack_.pop (n); yystack_.pop (n);
} }
@ -412,13 +418,13 @@ namespace step {
} }
bool bool
parser::yy_pact_value_is_default_ (int yyvalue) parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT
{ {
return yyvalue == yypact_ninf_; return yyvalue == yypact_ninf_;
} }
bool bool
parser::yy_table_value_is_error_ (int yyvalue) parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT
{ {
return yyvalue == yytable_ninf_; return yyvalue == yytable_ninf_;
} }
@ -884,16 +890,16 @@ namespace step {
// Actual number of expected tokens // Actual number of expected tokens
int yycount = 0; int yycount = 0;
int yyn = yypact_[+yyparser_.yystack_[0].state]; const int yyn = yypact_[+yyparser_.yystack_[0].state];
if (!yy_pact_value_is_default_ (yyn)) if (!yy_pact_value_is_default_ (yyn))
{ {
/* Start YYX at -YYN if negative to avoid negative indexes in /* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for YYCHECK. In other words, skip the first -YYN actions for
this state because they are default actions. */ this state because they are default actions. */
int yyxbegin = yyn < 0 ? -yyn : 0; const int yyxbegin = yyn < 0 ? -yyn : 0;
// Stay within bounds of both yycheck and yytname. // Stay within bounds of both yycheck and yytname.
int yychecklim = yylast_ - yyn + 1; const int yychecklim = yylast_ - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
for (int yyx = yyxbegin; yyx < yyxend; ++yyx) for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
&& !yy_table_value_is_error_ (yytable_[yyx + yyn])) && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
@ -914,6 +920,9 @@ namespace step {
int int
parser::yy_syntax_error_arguments_ (const context& yyctx, parser::yy_syntax_error_arguments_ (const context& yyctx,
symbol_kind_type yyarg[], int yyargn) const symbol_kind_type yyarg[], int yyargn) const
@ -1038,7 +1047,7 @@ namespace step {
const signed char const signed char
parser::yydefgoto_[] = parser::yydefgoto_[] =
{ {
-1, 71, 62, 2, 3, 4, 5, 11, 12, 15, 0, 71, 62, 2, 3, 4, 5, 11, 12, 15,
32, 33, 19, 34, 35, 36, 23, 24, 54, 49, 32, 33, 19, 34, 35, 36, 23, 24, 54, 49,
50, 74, 75, 67, 59, 25, 51 50, 74, 75, 67, 59, 25, 51
}; };
@ -1163,7 +1172,7 @@ namespace step {
#endif // YYDEBUG #endif // YYDEBUG
parser::symbol_kind_type parser::symbol_kind_type
parser::yytranslate_ (int t) parser::yytranslate_ (int t) YY_NOEXCEPT
{ {
// YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
// TOKEN-NUM as returned by yylex. // TOKEN-NUM as returned by yylex.
@ -1206,7 +1215,7 @@ namespace step {
if (t <= 0) if (t <= 0)
return symbol_kind::S_YYEOF; return symbol_kind::S_YYEOF;
else if (t <= code_max) else if (t <= code_max)
return YY_CAST (symbol_kind_type, translate_table[t]); return static_cast <symbol_kind_type> (translate_table[t]);
else else
return symbol_kind::S_YYUNDEF; return symbol_kind::S_YYUNDEF;
} }

@ -1,8 +1,8 @@
// A Bison parser, made by GNU Bison 3.7.4. // A Bison parser, made by GNU Bison 3.8.2.
// Skeleton interface for Bison LALR(1) parsers in C++ // Skeleton interface for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc. // Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// You should have received a copy of the GNU General Public License // 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/>.
// As a special exception, you may create a larger work that contains // As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work // part or all of the Bison parser skeleton and distribute that work
@ -127,17 +127,23 @@ namespace step {
/* Suppress unused-variable warnings by "using" E. */ /* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__ #if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E)) # define YY_USE(E) ((void) (E))
#else #else
# define YYUSE(E) /* empty */ # define YY_USE(E) /* empty */
#endif #endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop") _Pragma ("GCC diagnostic pop")
#else #else
@ -198,12 +204,18 @@ namespace step {
class parser class parser
{ {
public: public:
#ifndef YYSTYPE #ifdef YYSTYPE
/// Symbol semantic values. # ifdef __GNUC__
typedef int semantic_type; # pragma GCC message "bison: do not #define YYSTYPE in C++, use %define api.value.type"
# endif
typedef YYSTYPE value_type;
#else #else
typedef YYSTYPE semantic_type; /// Symbol semantic values.
typedef int value_type;
#endif #endif
/// Backward compatibility (Bison 3.8).
typedef value_type semantic_type;
/// Syntax errors thrown from user actions. /// Syntax errors thrown from user actions.
struct syntax_error : std::runtime_error struct syntax_error : std::runtime_error
@ -251,7 +263,7 @@ namespace step {
}; };
/// Token kind, as returned by yylex. /// Token kind, as returned by yylex.
typedef token::yytokentype token_kind_type; typedef token::token_kind_type token_kind_type;
/// Backward compatibility alias (Bison 3.6). /// Backward compatibility alias (Bison 3.6).
typedef token_kind_type token_type; typedef token_kind_type token_type;
@ -339,7 +351,7 @@ namespace step {
typedef Base super_type; typedef Base super_type;
/// Default constructor. /// Default constructor.
basic_symbol () basic_symbol () YY_NOEXCEPT
: value () : value ()
{} {}
@ -358,7 +370,7 @@ namespace step {
/// Constructor for symbols with semantic value. /// Constructor for symbols with semantic value.
basic_symbol (typename Base::kind_type t, basic_symbol (typename Base::kind_type t,
YY_RVREF (semantic_type) v); YY_RVREF (value_type) v);
/// Destroy the symbol. /// Destroy the symbol.
~basic_symbol () ~basic_symbol ()
@ -366,8 +378,10 @@ namespace step {
clear (); clear ();
} }
/// Destroy contents, and record that is empty. /// Destroy contents, and record that is empty.
void clear () void clear () YY_NOEXCEPT
{ {
Base::clear (); Base::clear ();
} }
@ -388,7 +402,7 @@ namespace step {
void move (basic_symbol& s); void move (basic_symbol& s);
/// The semantic value. /// The semantic value.
semantic_type value; value_type value;
private: private:
#if YY_CPLUSPLUS < 201103L #if YY_CPLUSPLUS < 201103L
@ -400,25 +414,27 @@ namespace step {
/// Type access provider for token (enum) based symbols. /// Type access provider for token (enum) based symbols.
struct by_kind struct by_kind
{ {
/// Default constructor.
by_kind ();
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that);
#endif
/// Copy constructor.
by_kind (const by_kind& that);
/// The symbol kind as needed by the constructor. /// The symbol kind as needed by the constructor.
typedef token_kind_type kind_type; typedef token_kind_type kind_type;
/// Default constructor.
by_kind () YY_NOEXCEPT;
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind (by_kind&& that) YY_NOEXCEPT;
#endif
/// Copy constructor.
by_kind (const by_kind& that) YY_NOEXCEPT;
/// Constructor from (external) token numbers. /// Constructor from (external) token numbers.
by_kind (kind_type t); by_kind (kind_type t) YY_NOEXCEPT;
/// Record that this symbol is empty. /// Record that this symbol is empty.
void clear (); void clear () YY_NOEXCEPT;
/// Steal the symbol kind from \a that. /// Steal the symbol kind from \a that.
void move (by_kind& that); void move (by_kind& that);
@ -492,8 +508,8 @@ namespace step {
{ {
public: public:
context (const parser& yyparser, const symbol_type& yyla); context (const parser& yyparser, const symbol_type& yyla);
const symbol_type& lookahead () const { return yyla_; } const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
symbol_kind_type token () const { return yyla_.kind (); } symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }
/// Put in YYARG at most YYARGN of the expected tokens, and return the /// Put in YYARG at most YYARGN of the expected tokens, and return the
/// number of tokens stored in YYARG. If YYARG is null, return the /// number of tokens stored in YYARG. If YYARG is null, return the
/// number of expected tokens (guaranteed to be less than YYNTOKENS). /// number of expected tokens (guaranteed to be less than YYNTOKENS).
@ -530,19 +546,19 @@ namespace step {
/// Whether the given \c yypact_ value indicates a defaulted state. /// Whether the given \c yypact_ value indicates a defaulted state.
/// \param yyvalue the value to check /// \param yyvalue the value to check
static bool yy_pact_value_is_default_ (int yyvalue); static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT;
/// Whether the given \c yytable_ value indicates a syntax error. /// Whether the given \c yytable_ value indicates a syntax error.
/// \param yyvalue the value to check /// \param yyvalue the value to check
static bool yy_table_value_is_error_ (int yyvalue); static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT;
static const signed char yypact_ninf_; static const signed char yypact_ninf_;
static const signed char yytable_ninf_; static const signed char yytable_ninf_;
/// Convert a scanner token kind \a t to a symbol kind. /// Convert a scanner token kind \a t to a symbol kind.
/// In theory \a t should be a token_kind_type, but character literals /// In theory \a t should be a token_kind_type, but character literals
/// are valid, yet not members of the token_type enum. /// are valid, yet not members of the token_kind_type enum.
static symbol_kind_type yytranslate_ (int t); static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT;
/// Convert the symbol name \a n to a form suitable for a diagnostic. /// Convert the symbol name \a n to a form suitable for a diagnostic.
static std::string yytnamerr_ (const char *yystr); static std::string yytnamerr_ (const char *yystr);
@ -574,14 +590,14 @@ namespace step {
static const signed char yycheck_[]; static const signed char yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
// symbol of state STATE-NUM. // state STATE-NUM.
static const signed char yystos_[]; static const signed char yystos_[];
// YYR1[YYN] -- Symbol number of symbol that rule YYN derives. // YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.
static const signed char yyr1_[]; static const signed char yyr1_[];
// YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.
static const signed char yyr2_[]; static const signed char yyr2_[];
@ -680,7 +696,7 @@ namespace step {
typedef typename S::size_type size_type; typedef typename S::size_type size_type;
typedef typename std::ptrdiff_t index_type; typedef typename std::ptrdiff_t index_type;
stack (size_type n = 200) stack (size_type n = 200) YY_NOEXCEPT
: seq_ (n) : seq_ (n)
{} {}
@ -759,7 +775,7 @@ namespace step {
class slice class slice
{ {
public: public:
slice (const stack& stack, index_type range) slice (const stack& stack, index_type range) YY_NOEXCEPT
: stack_ (stack) : stack_ (stack)
, range_ (range) , range_ (range)
{} {}
@ -809,7 +825,7 @@ namespace step {
void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
/// Pop \a n symbols from the stack. /// Pop \a n symbols from the stack.
void yypop_ (int n = 1); void yypop_ (int n = 1) YY_NOEXCEPT;
/// Constants. /// Constants.
enum enum