diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake index f3f20a689d..70c9cabf72 100644 --- a/adm/cmake/occt_macros.cmake +++ b/adm/cmake/occt_macros.cmake @@ -636,8 +636,8 @@ macro (FLEX_AND_BISON_TARGET_APPLY THE_PACKAGE_NAME RELATIVE_SOURCES_DIR) set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}") # choose appropriate extension for generated files: "cxx" if source file contains # instruction to generate C++ code, "c" otherwise - set (BISON_OUTPUT_FILE_EXT "c") - set (FLEX_OUTPUT_FILE_EXT "c") + set (BISON_OUTPUT_FILE_EXT "cxx") + set (FLEX_OUTPUT_FILE_EXT "cxx") file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT) foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT}) string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE}) diff --git a/src/ExpToCasExe/exptocas.tab.cxx b/src/ExpToCasExe/exptocas.tab.cxx index 725caec05a..0317e12b00 100644 --- a/src/ExpToCasExe/exptocas.tab.cxx +++ b/src/ExpToCasExe/exptocas.tab.cxx @@ -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++ -// 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 // it under the terms of the GNU General Public License as published by @@ -15,7 +15,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 . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // 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 # 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 (0) # define YY_STACK_PRINT() static_cast (0) @@ -209,9 +209,9 @@ namespace exptocas { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ // basic_symbol. template @@ -229,11 +229,12 @@ namespace exptocas { {} template - parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v) + parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (value_type) v) : Base (t) , value (YY_MOVE (v)) {} + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -241,6 +242,7 @@ namespace exptocas { return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -257,28 +259,30 @@ namespace exptocas { } // by_kind. - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #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_) { that.clear (); } #endif - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : 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)) {} + + void - parser::by_kind::clear () + parser::by_kind::clear () YY_NOEXCEPT { kind_ = symbol_kind::S_YYEMPTY; } @@ -296,6 +300,7 @@ namespace exptocas { return kind_; } + parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT { @@ -303,6 +308,7 @@ namespace exptocas { } + // by_state. parser::by_state::by_state () YY_NOEXCEPT : state (empty_state) @@ -385,7 +391,7 @@ namespace exptocas { YY_SYMBOL_PRINT (yymsg, yysym); // User destructor. - YYUSE (yysym.kind ()); + YY_USE (yysym.kind ()); } #if YYDEBUG @@ -394,7 +400,7 @@ namespace exptocas { parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const { std::ostream& yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (yysym.empty ()) yyo << "empty symbol"; else @@ -402,7 +408,7 @@ namespace exptocas { symbol_kind_type yykind = yysym.kind (); yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << yysym.name () << " ("; - YYUSE (yykind); + YY_USE (yykind); yyo << ')'; } } @@ -428,7 +434,7 @@ namespace exptocas { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -471,13 +477,13 @@ namespace exptocas { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -1085,6 +1091,10 @@ namespace exptocas { + + + + const short parser::yypact_ninf_ = -134; const signed char parser::yytable_ninf_ = -1; @@ -1143,10 +1153,10 @@ namespace exptocas { -64, 31, -134, -134, -127, -134, -134, -7, 18, -131 }; - const short + const unsigned char 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, 85, 86, 87, 88, 119, 121, 123, 124, 106, 166 }; @@ -1304,7 +1314,7 @@ namespace exptocas { #endif // YYDEBUG parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -1348,7 +1358,7 @@ namespace exptocas { if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } diff --git a/src/ExpToCasExe/exptocas.tab.hxx b/src/ExpToCasExe/exptocas.tab.hxx index 039b4bb374..f1aee055a8 100644 --- a/src/ExpToCasExe/exptocas.tab.hxx +++ b/src/ExpToCasExe/exptocas.tab.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. // 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 // it under the terms of the GNU General Public License as published by @@ -15,7 +15,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 . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // 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. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* 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 ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -219,9 +225,14 @@ namespace exptocas { class parser { 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. - union semantic_type + union value_type { int num; @@ -237,9 +248,10 @@ namespace exptocas { }; -#else - typedef YYSTYPE semantic_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Syntax errors thrown from user actions. struct syntax_error : std::runtime_error @@ -302,7 +314,7 @@ namespace exptocas { }; /// 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). typedef token_kind_type token_type; @@ -412,7 +424,7 @@ namespace exptocas { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () {} @@ -431,7 +443,7 @@ namespace exptocas { /// Constructor for symbols with semantic value. basic_symbol (typename Base::kind_type t, - YY_RVREF (semantic_type) v); + YY_RVREF (value_type) v); /// Destroy the symbol. ~basic_symbol () @@ -439,8 +451,10 @@ namespace exptocas { clear (); } + + /// Destroy contents, and record that is empty. - void clear () + void clear () YY_NOEXCEPT { Base::clear (); } @@ -464,7 +478,7 @@ namespace exptocas { void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; private: #if YY_CPLUSPLUS < 201103L @@ -476,25 +490,27 @@ namespace exptocas { /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. - void clear (); + void clear () YY_NOEXCEPT; /// Steal the symbol kind from \a that. void move (by_kind& that); @@ -586,19 +602,19 @@ namespace exptocas { /// Whether the given \c yypact_ value indicates a defaulted state. /// \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. /// \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 signed char yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; #if YYDEBUG || 0 /// For a symbol, its name in clear. @@ -620,7 +636,7 @@ namespace exptocas { static const short yypgoto_[]; // YYDEFGOTO[NTERM-NUM]. - static const short yydefgoto_[]; + static const unsigned char yydefgoto_[]; // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If // positive, shift that token. If negative, reduce the rule whose @@ -629,14 +645,14 @@ namespace exptocas { static const short yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. 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_[]; - // 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_[]; @@ -735,7 +751,7 @@ namespace exptocas { typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -814,7 +830,7 @@ namespace exptocas { class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -864,7 +880,7 @@ namespace exptocas { void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum diff --git a/src/ExpToCasExe/lex.exptocas.cxx b/src/ExpToCasExe/lex.exptocas.cxx index 59c0574de6..dba0ba0b3d 100644 --- a/src/ExpToCasExe/lex.exptocas.cxx +++ b/src/ExpToCasExe/lex.exptocas.cxx @@ -1,11 +1,45 @@ + +/* A lexical scanner generated by flex */ +#line 88 "/home/coder/work/OCCT/src/ExpToCasExe/exptocas.lex" // Pre-include stdlib.h to avoid redefinition of integer type macros (INT8_MIN and similar in generated code) #if !defined(_MSC_VER) || (_MSC_VER >= 1600) // Visual Studio 2010+ #include "stdint.h" #endif -#define YY_INT_ALIGNED short int -/* A lexical scanner generated by flex */ +/* Target: C/C++ */ +/* START of m4 controls */ +/* M4_YY_TABLES_VERIFY = 0 */ +/* M4_MODE_NO_DO_STDINIT */ +/* M4_MODE_NO_YYTEXT_IS_ARRAY */ +/* M4_MODE_NO_YYMORE_USED */ +/* M4_MODE_NO_REAL_FULLSPD */ +/* M4_MODE_NO_REAL_FULLTBL */ +/* M4_MODE_NO_CPP_USE_READ */ +/* M4_MODE_NO_VARIABLE_TRAILING_CONTEXT_RULES */ +/* M4_MODE_FIND_ACTION_REJECT_REALLY_USED */ +/* M4_MODE_NO_USES_REJECT */ +/* M4_MODE_USEMECS */ +/* M4_MODE_FIND_ACTION_COMPRESSED */ +/* M4_MODE_NO_FULLSPD */ +/* M4_MODE_NO_BOL_NEEDED */ +/* M4_MODE_USEECS */ +/* M4_MODE_GENTABLES */ +/* M4_MODE_INTERACTIVE */ +/* M4_MODE_NO_FULLSPD_OR_FULLTBL */ +/* M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE */ +/* M4_MODE_YYCLASS */ +/* M4_MODE_NO_YYWRAP */ +/* M4_MODE_INTERACTIVE */ +/* M4_MODE_CXX_ONLY */ +/* M4_MODE_PREFIX = exptocas */ +/* M4_YY_NO_UNISTD_H */ +/* M4_MODE_NO_REWRITE */ +/* END of m4 controls */ + + + + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 @@ -15,6 +49,19 @@ #define FLEX_BETA #endif + + + + + + + + + + + + + /* The c++ scanner is a mess. The FlexLexer.h header file relies on the * following macro. This is required in order to pass the c++-multiple-scanners * test in the regression suite. We get reports that it breaks inheritance. @@ -23,105 +70,119 @@ */ #define yyFlexLexer exptocasFlexLexer + + + + + + + + #ifdef yyalloc #define exptocasalloc_ALREADY_DEFINED #else #define yyalloc exptocasalloc #endif + #ifdef yyrealloc #define exptocasrealloc_ALREADY_DEFINED #else #define yyrealloc exptocasrealloc #endif + #ifdef yyfree #define exptocasfree_ALREADY_DEFINED #else #define yyfree exptocasfree #endif + + + + + + + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ + + /* end standard C headers. */ -/* flex integer type definitions */ +/* begin standard C++ headers. */ + +#include +#include +#include +#include +#include +/* end standard C++ headers. */ -#ifndef FLEXINT_H -#define FLEXINT_H -/* C99 systems have . Non-C99 systems may or may not. */ +/* flex integer type definitions */ -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#ifndef YYFLEX_INTTYPES_DEFINED +#define YYFLEX_INTTYPES_DEFINED -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif +/* Prefer C99 integer types if available. */ +# if defined(__cplusplus) && __cplusplus >= 201103L +#include +# define YYFLEX_USE_STDINT +# endif +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* Include and not because Solaris 2.6 has the former + * and not the latter. + */ #include +# define YYFLEX_USE_STDINT +# else +# if defined(_MSC_VER) && _MSC_VER >= 1600 +/* Visual C++ 2010 does not define __STDC_VERSION__ and has but not + * . + */ +#include +# define YYFLEX_USE_STDINT +# endif +# endif +# ifdef YYFLEX_USE_STDINT typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; +# else +typedef unsigned char flex_uint8_t; typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; +# ifdef __STDC__ +typedef signed char flex_int8_t; +/* ISO C only requires at least 16 bits for int. */ +# ifdef __cplusplus +#include +# else +#include +# endif +# if UINT_MAX >= 4294967295 +# define YYFLEX_INT32_DEFINED +typedef int flex_int32_t; typedef unsigned int flex_uint32_t; +# endif +# else +typedef char flex_int8_t; +# endif +# ifndef YYFLEX_INT32_DEFINED +typedef long int flex_int32_t; +typedef unsigned long int flex_uint32_t; +# endif +# endif +#endif /* YYFLEX_INTTYPES_DEFINED */ -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ -#include -#include -#include -#include -#include -/* end standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const @@ -135,20 +196,57 @@ typedef unsigned int flex_uint32_t; /* Returned upon end-of-file. */ #define YY_NULL 0 + /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ +#define yybegin(s) (yy_start) = 1 + 2 * (s) +/* Legacy interface */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ +#define yystart() (((yy_start) - 1) / 2) +/* Legacy interfaces */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ @@ -157,25 +255,20 @@ typedef unsigned int flex_uint32_t; #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif -/* The state buf must be large enough to hold one state per character in the main buffer. + +/* The state buf must be large enough to hold one state per character in the main buffer, + * plus the start state, plus the two end-of-buffer byte states. */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#define YY_STATE_BUF_EXTRA_SPACE 3 +#define YY_STATE_BUF_SIZE (YY_BUF_SIZE + YY_STATE_BUF_EXTRA_SPACE) + + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *yybuffer; +/* Legacy interface */ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif @@ -184,8 +277,13 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif + extern int yyleng; + + + + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -206,13 +304,17 @@ extern int yyleng; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) +#define yyunput(c) yyunput_r( c, (yytext_ptr) ) +/* Legacy interface */ +#define unput(c) yyunput_r( c, (yytext_ptr) ) + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { + std::streambuf* yy_input_file; char *yy_ch_buf; /* input buffer */ @@ -245,10 +347,10 @@ struct yy_buffer_state * If so, '^' rules will be active on the next match, otherwise * not. */ - int yy_at_bol; + int yyatbol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -274,55 +376,91 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ + + + /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ +#define yy_current_buffer() ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) +/* Legacy interface */ +#define YY_CURRENT_BUFFER yy_current_buffer() /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + + + void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); + #define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ +#define yy_set_interactive(is_interactive) { \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ +} +#define yysetbol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + YY_CURRENT_BUFFER_LVALUE->yyatbol = at_bol; \ +} +#define yyatbol() (YY_CURRENT_BUFFER_LVALUE->yyatbol) +/* Legacy interface */ +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yyatbol) #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + YY_CURRENT_BUFFER_LVALUE->yyatbol = at_bol; \ +} + /* Begin user sect3 */ + + + #define YY_SKIP_YYWRAP + + typedef flex_uint8_t YY_CHAR; + #define yytext_ptr yytext #define YY_INTERACTIVE + + + + + + + + #include -inline int yyFlexLexer::yywrap() { return 1; } +int yyFlexLexer::yywrap() { return 1;} + + int yyFlexLexer::yylex() { LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" ); @@ -331,26 +469,91 @@ int yyFlexLexer::yylex() #define YY_DECL int exptocas::scanner::yylex() + + + + +/* %% [1.5] DFA */ +/* START of m4 controls */ +/* M4_MODE_NO_NULTRANS */ +/* M4_MODE_NO_NULTRANS_FULLTBL */ +/* M4_MODE_NO_NULTRANS_FULLSPD */ +/* END of m4 controls */ + +/* START of Flex-generated definitions */ +#define YY_NUM_RULES 56 +#define YY_END_OF_BUFFER 57 +#define YY_JAMBASE 413 +#define YY_JAMSTATE 305 +#define YY_NUL_EC 1 +#define YY_OFFSET_TYPE flex_int16_t +/* END of Flex-generated definitions */ + + + + + +struct yy_trans_info + { + /* We require that yy_verify and yy_nxt must be of the same size int. */ + + + /* We generate a bogus 'struct yy_trans_info' data type + * so we can guarantee that it is always declared in the skel. + * This is so we can compile "sizeof(struct yy_trans_info)" + * in any scanner. + */ + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + + }; + + + /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ + do { \ (yytext_ptr) = yy_bp; \ + \ yyleng = (int) (yy_cp - yy_bp); \ + \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 56 -#define YY_END_OF_BUFFER 57 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[306] = - { 0, + \ + (yy_c_buf_p) = yy_cp; \ + } while(0) + + + + + +/* %% [2.0] data tables for the DFA are inserted here */ + + + + + + + + +/* footprint: 29833 bytes */ +/* tblend: 453 */ +/* numecs: 40 */ +/* num_rules: 56 */ +/* lastdfa: 304 */ + +/* m4 controls begin */ +/* M4_MODE_HAS_BACKING_UP */ +/* M4_MODE_NEED_YY_CP */ +/* m4 controls end */ + + + + + +static const flex_int16_t yy_accept[306] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 44, 57, 54, 52, 55, 40, 40, 54, 39, 53, 53, 53, 53, 53, 53, 53, 53, @@ -385,10 +588,13 @@ static const flex_int16_t yy_accept[306] = 53, 0, 53, 0, 53, 0, 53, 0, 53, 0, 53, 0, 53, 51, 0 - } ; +}; + + -static const YY_CHAR yy_ec[256] = - { 0, + +/* Character equivalence-class mapping */ +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -417,18 +623,29 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - } ; +}; + + + -static const YY_CHAR yy_meta[41] = - { 0, +/* Character meta-equivalence-class mappings */ +static const YY_CHAR yy_meta[41] = { 0, 1, 2, 3, 2, 2, 2, 1, 1, 2, 4, 2, 2, 5, 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 4, 4, 2 - } ; +}; + + + + + + + + -static const flex_int16_t yy_base[316] = - { 0, + +static const flex_int16_t yy_base[316] = { 0, 0, 0, 24, 26, 29, 35, 52, 54, 45, 51, 61, 62, 79, 119, 412, 413, 409, 413, 403, 413, 400, 398, 75, 79, 381, 0, 381, 373, 379, 45, @@ -464,10 +681,12 @@ static const flex_int16_t yy_base[316] = 44, 60, 37, 413, 413, 199, 204, 209, 214, 216, 221, 223, 228, 233, 237 - } ; +}; + + + -static const flex_int16_t yy_def[316] = - { 0, +static const flex_int16_t yy_def[316] = { 0, 305, 1, 1, 1, 1, 1, 306, 306, 307, 307, 308, 308, 309, 309, 305, 305, 305, 305, 305, 305, 305, 310, 310, 310, 310, 310, 310, 310, 310, 310, @@ -503,10 +722,12 @@ static const flex_int16_t yy_def[316] = 310, 305, 310, 305, 0, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305 - } ; +}; -static const flex_int16_t yy_nxt[454] = - { 0, + + + +static const flex_int16_t yy_nxt[454] = { 0, 16, 17, 18, 16, 19, 20, 16, 20, 21, 22, 20, 20, 23, 24, 25, 26, 27, 28, 26, 26, 29, 26, 30, 26, 31, 32, 26, 26, 33, 34, @@ -557,10 +778,12 @@ static const flex_int16_t yy_nxt[454] = 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305 - } ; +}; + -static const flex_int16_t yy_chk[454] = - { 0, + + +static const flex_int16_t yy_chk[454] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -611,18 +834,44 @@ static const flex_int16_t yy_chk[454] = 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, 305 - } ; +}; + + + + + + + + + + + + + + + /* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. + * any uses of yyreject() which flex missed. */ +#define yyreject() reject_used_but_not_detected #define REJECT reject_used_but_not_detected + + + + + #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -// Created: Thu Oct 28 12:21:16 1999 -// Author: Andrey BETENEV + + + +/* %% [3.0] static declarations conditional on mode switches go here */ + +// Created: Thu Oct 28 12:21:16 1999 +// Author: Andrey BETENEV // Copyright (c) 1999-2020 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. @@ -692,7 +941,9 @@ int ec_error ( const std::string& s, const std::string& text ) /* c++ generate C++ parser class */ -#define YY_NO_UNISTD_H 1 + + + // Tell flex which function to define #ifdef YY_DECL @@ -706,6 +957,8 @@ typedef exptocas::parser::token token; /* Section 2 */ /* parsing rules */ + + #define INITIAL 0 #define TYP 1 #define ENT 2 @@ -714,18 +967,19 @@ typedef exptocas::parser::token token; #define RULE 5 #define FUN 6 -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - + + + + + #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif + + + + #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif @@ -734,36 +988,94 @@ static void yy_flex_strncpy ( char *, const char *, int ); static int yy_flex_strlen ( const char * ); #endif -#ifndef YY_NO_INPUT + + +#ifndef YY_NO_YYINPUT #endif -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ + + + +/* + * Amount of stuff to slurp up with each read. + * We assume the stdio library has already + * chosen a fit size foe whatever platform + * we're running on. + */ +#define YY_READ_BUF_SIZE BUFSIZ + +/* Size of default input buffer. We want to be able to fit two + * OS-level reads, but efficiency gains as the buffer size + * increases fall off after that + */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE (2 * YY_READ_BUF_SIZE) #endif + /* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -#define ECHO LexerOutput( yytext, yyleng ) +#ifndef yyecho + + +#define yyecho() LexerOutput( yytext, yyleng ) + +#endif +/* Legacy interface */ +#define ECHO yyecho() + + + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 #endif + + + +void yyFlexLexer::LexerError( const char* msg ) { + std::cerr << msg << std::endl; + exit( YY_EXIT_FAILURE ); +} + + + +/* Report a fatal error. Legacy interface. */ +#ifndef YY_FATAL_ERROR + + +#define YY_FATAL_ERROR(msg) LexerError( msg ) + +#endif + +/* Legacy interface */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) do {result = yyread(buf, max_size );} while (0) + + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -\ - if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ + +int yyFlexLexer::yyread(char *buf, size_t max_size) { + + + int result; + + + + if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) { YY_FATAL_ERROR( "input in flex scanner failed" ); + } + return result; +} #endif + + + + /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. @@ -772,26 +1084,27 @@ static int yy_flex_strlen ( const char * ); #define yyterminate() return YY_NULL #endif + + /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) LexerError( msg ) -#endif -/* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 + + #define YY_DECL int yyFlexLexer::yylex() + #endif /* !YY_DECL */ + /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ @@ -799,468 +1112,630 @@ static int yy_flex_strlen ( const char * ); #define YY_USER_ACTION #endif -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif + #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION + + + + + + + + + + /** The main scanner function which does all the work. */ -YY_DECL -{ +YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; - if ( !(yy_init) ) - { + + + + + + + + + + if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! (yy_start) ) + if ( ! (yy_start) ) { (yy_start) = 1; /* first start state */ + } + if ( ! yyin ) { + - if ( ! yyin ) yyin.rdbuf(std::cin.rdbuf()); - if ( ! yyout ) + } + if ( ! yyout ) { + + yyout.rdbuf(std::cout.rdbuf()); - if ( ! YY_CURRENT_BUFFER ) { + } + if ( yy_current_buffer() == NULL ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } + + yy_load_buffer_state( ); - } + } + /* open scope of user declarationns */ { +/* %% [4.0] user's declarations go here */ + + + + while ( /*CONSTCOND*/1 ) { /* loops until end-of-file is reached */ + + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + + /* Generate the code to find the start state. */ + + + yy_current_state = (yy_start); + + /* Set up for storing up states. */ + + + + + yy_match: + /* Generate the code to find the next match. */ + + + + + + + do { + + int yy_c = *(yy_ec+YY_SC_TO_UI(*yy_cp)); + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + + + /* Generate code to keep backing-up information. */ + + + if ( yy_accept[yy_current_state] ) { + + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. + + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { + yy_current_state = (int) yy_def[yy_current_state]; + + + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice */ - yy_bp = yy_cp; - yy_current_state = (yy_start); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 306 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { + yy_c = yy_meta[yy_c]; + } + + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + + + + ++yy_cp; + } - while ( yy_base[yy_current_state] != 413 ); + while ( yy_base[yy_current_state] != YY_JAMBASE ); + + + + + + + + yy_find_action: + /* code to find the action number goes here */ + + -yy_find_action: yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; } - YY_DO_BEFORE_ACTION; -do_action: /* This label is used only to access EOF actions. */ + YY_DO_BEFORE_ACTION; + + + + do_action: /* This label is used only to access EOF actions. */ + + + + switch ( yy_act ) { /* beginning of action switch */ + - switch ( yy_act ) - { /* beginning of action switch */ case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + + /* Backing-up info for compressed tables is taken \after/ */ + /* yy_cp has been incremented for the next state. */ + yy_cp = (yy_last_accepting_cpos); + + -case 1: + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + + +/* %% [5.0] user actions get inserted here */ + case 1: YY_RULE_SETUP + { /* Eat line comments */ } - YY_BREAK -case 2: + /*LINTED*/break; + case 2: YY_RULE_SETUP + { ec_state = YYSTATE; BEGIN(COMM); } - YY_BREAK -case 3: + /*LINTED*/break; + case 3: YY_RULE_SETUP + { /* Eat multiline comments */ } - YY_BREAK -case 4: + /*LINTED*/break; + case 4: YY_RULE_SETUP + { BEGIN(ec_state); } - YY_BREAK -case 5: + /*LINTED*/break; + case 5: YY_RULE_SETUP + { return yylval->num = token::KSCHEM; } - YY_BREAK -case 6: + /*LINTED*/break; + case 6: YY_RULE_SETUP + { return yylval->num = token::KENDS; } - YY_BREAK -case 7: + /*LINTED*/break; + case 7: YY_RULE_SETUP + { BEGIN(TYP); return yylval->num = token::KTYP; } - YY_BREAK -case 8: + /*LINTED*/break; + case 8: YY_RULE_SETUP + { BEGIN(0); return yylval->num = token::KENDT; } - YY_BREAK -case 9: + /*LINTED*/break; + case 9: YY_RULE_SETUP + { BEGIN(ENT); return yylval->num = token::KENT; } - YY_BREAK -case 10: + /*LINTED*/break; + case 10: YY_RULE_SETUP + { BEGIN(0); return yylval->num = token::KENDE; } - YY_BREAK -case 11: -case 12: -case 13: + /*LINTED*/break; + case 11: + case 12: + case 13: YY_RULE_SETUP + { BEGIN(SKP); } - YY_BREAK -case 14: + /*LINTED*/break; + case 14: YY_RULE_SETUP + { /* eat contents of WHERE and DERIVE subclauses of ENTITY and TYPE */ } - YY_BREAK -case 15: + /*LINTED*/break; + case 15: YY_RULE_SETUP + { return yylval->num = token::KSEL; } - YY_BREAK -case 16: + /*LINTED*/break; + case 16: YY_RULE_SETUP + { return yylval->num = token::KENUM; } - YY_BREAK -case 17: + /*LINTED*/break; + case 17: YY_RULE_SETUP + { return yylval->num = token::KLIST; } - YY_BREAK -case 18: + /*LINTED*/break; + case 18: YY_RULE_SETUP + { return yylval->num = token::KARR; } - YY_BREAK -case 19: + /*LINTED*/break; + case 19: YY_RULE_SETUP + { return yylval->num = token::KSET; } - YY_BREAK -case 20: + /*LINTED*/break; + case 20: YY_RULE_SETUP + { return yylval->num = token::KBAG; } - YY_BREAK -case 21: + /*LINTED*/break; + case 21: YY_RULE_SETUP + { return yylval->num = token::KOF; } - YY_BREAK -case 22: + /*LINTED*/break; + case 22: YY_RULE_SETUP + { return yylval->num = token::KNUM; } - YY_BREAK -case 23: + /*LINTED*/break; + case 23: YY_RULE_SETUP + { return yylval->num = token::KINT; } - YY_BREAK -case 24: + /*LINTED*/break; + case 24: YY_RULE_SETUP + { return yylval->num = token::KDBL; } - YY_BREAK -case 25: + /*LINTED*/break; + case 25: YY_RULE_SETUP + { return yylval->num = token::KSTR; } - YY_BREAK -case 26: + /*LINTED*/break; + case 26: YY_RULE_SETUP + { return yylval->num = token::KLOG; } - YY_BREAK -case 27: + /*LINTED*/break; + case 27: YY_RULE_SETUP + { return yylval->num = token::KBOOL; } - YY_BREAK -case 28: + /*LINTED*/break; + case 28: YY_RULE_SETUP + { return yylval->num = token::KOPT; } - YY_BREAK -case 29: + /*LINTED*/break; + case 29: YY_RULE_SETUP + { return yylval->num = token::KUNIQ; } - YY_BREAK -case 30: + /*LINTED*/break; + case 30: YY_RULE_SETUP + { return yylval->num = token::KSELF; } - YY_BREAK -case 31: + /*LINTED*/break; + case 31: YY_RULE_SETUP + { return yylval->num = token::KABSTR; } - YY_BREAK -case 32: + /*LINTED*/break; + case 32: YY_RULE_SETUP + { return yylval->num = token::KSUBT; } - YY_BREAK -case 33: + /*LINTED*/break; + case 33: YY_RULE_SETUP + { return yylval->num = token::KSPRT; } - YY_BREAK -case 34: + /*LINTED*/break; + case 34: YY_RULE_SETUP + { return yylval->num = token::KANDOR; } - YY_BREAK -case 35: + /*LINTED*/break; + case 35: YY_RULE_SETUP + { return yylval->num = token::K1OF; } - YY_BREAK -case 36: + /*LINTED*/break; + case 36: YY_RULE_SETUP + { return yylval->num = token::KAND; } - YY_BREAK -case 37: + /*LINTED*/break; + case 37: YY_RULE_SETUP + { yylval->str = strdup ( yytext ); return token::NAME; } - YY_BREAK -case 38: + /*LINTED*/break; + case 38: YY_RULE_SETUP + { yylval->str = strdup ( yytext ); return token::NAME; } - YY_BREAK -case 39: + /*LINTED*/break; + case 39: YY_RULE_SETUP + { yylval->num = atoi ( yytext ); return token::NUMBER; } - YY_BREAK -case 40: + /*LINTED*/break; + case 40: YY_RULE_SETUP + { return yylval->num = yytext[0]; } - YY_BREAK -case 41: + /*LINTED*/break; + case 41: YY_RULE_SETUP + { BEGIN(FUN); fun_level++; } - YY_BREAK -case 42: + /*LINTED*/break; + case 42: YY_RULE_SETUP + { ec_state = YYSTATE; BEGIN(COMM); /* eat comments in functions */ } - YY_BREAK -case 43: + /*LINTED*/break; + case 43: YY_RULE_SETUP + { /* Eat line comments in functions */ } - YY_BREAK -case 44: + /*LINTED*/break; + case 44: YY_RULE_SETUP + { /* eat FUNCTIONs - skip IDs explicitly */ } - YY_BREAK -case 45: + /*LINTED*/break; + case 45: /* rule 45 can match eol */ YY_RULE_SETUP + { /* eat FUNCTIONs - skip strings explicitly */ } - YY_BREAK -case 46: + /*LINTED*/break; + case 46: YY_RULE_SETUP + { /* eat FUNCTIONs - skip all other symbols in functions */ } - YY_BREAK -case 47: + /*LINTED*/break; + case 47: YY_RULE_SETUP + { fun_level--; if ( ! fun_level ) BEGIN(0); } - YY_BREAK -case 48: + /*LINTED*/break; + case 48: YY_RULE_SETUP + { BEGIN(RULE); /* eat RULEs */ } - YY_BREAK -case 49: + /*LINTED*/break; + case 49: YY_RULE_SETUP + { /* eat RULEs */ } - YY_BREAK -case 50: + /*LINTED*/break; + case 50: YY_RULE_SETUP + { BEGIN(0); } - YY_BREAK -case 51: + /*LINTED*/break; + case 51: /* rule 51 can match eol */ YY_RULE_SETUP + { /* eat CONSTANTs */ char *s = yytext; /* but don't forget to count lines.. */ while ( *s ) if ( *(s++) == '\n' ) ec_linenum++; } - YY_BREAK -case 52: + /*LINTED*/break; + case 52: YY_RULE_SETUP + { /* eat spaces */ } - YY_BREAK -case 53: + /*LINTED*/break; + case 53: YY_RULE_SETUP + { ec_error ( "unknown keyword ", yytext ); /* put unrecognized keywords to cerr */ } - YY_BREAK -case 54: + /*LINTED*/break; + case 54: YY_RULE_SETUP + { ec_error ( "unknown symbol ", yytext ); /* put unrecognized data to cerr */ } - YY_BREAK -case 55: + /*LINTED*/break; + case 55: /* rule 55 can match eol */ YY_RULE_SETUP + { ec_linenum++; /* count lines */ } - YY_BREAK -case 56: + /*LINTED*/break; + case 56: YY_RULE_SETUP -ECHO; - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(TYP): -case YY_STATE_EOF(ENT): -case YY_STATE_EOF(COMM): -case YY_STATE_EOF(SKP): -case YY_STATE_EOF(RULE): -case YY_STATE_EOF(FUN): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ +yyecho(); + /*LINTED*/break; + case YY_STATE_EOF(INITIAL): + /* FALLTHROUGH */ + case YY_STATE_EOF(TYP): + /* FALLTHROUGH */ + case YY_STATE_EOF(ENT): + /* FALLTHROUGH */ + case YY_STATE_EOF(COMM): + /* FALLTHROUGH */ + case YY_STATE_EOF(SKP): + /* FALLTHROUGH */ + case YY_STATE_EOF(RULE): + /* FALLTHROUGH */ + case YY_STATE_EOF(FUN): + /* FALLTHROUGH */ + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer() and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } + yy_next_state = yy_try_NUL_trans( yy_current_state ); - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } + yy_bp = (yytext_ptr) + YY_MORE_ADJ; - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; + if ( yy_next_state ) { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } else { + + - yy_current_state = yy_get_previous_state( ); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state( ); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } + /* Still need to initialize yy_cp, though + * yy_current_state was set up by + * yy_get_previous_state(). + */ + yy_cp = (yy_c_buf_p); + - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ + goto yy_find_action; + } + } else { /* not a NUL */ + switch ( yy_get_next_buffer( ) ) { + case EOB_ACT_END_OF_FILE: + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(yystart()); + goto do_action; + } else { + if ( ! (yy_did_buffer_switch_on_eof) ) { + YY_NEW_FILE; + } + } + break; + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); + } /* end EOB inner switch */ + } /* end if */ + break; + } /* case YY_END_OF_BUFFER */ + default: + YY_FATAL_ERROR("fatal flex scanner internal error--no action found" ); + } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ + + /* The contents of this function are C++ specific, so the () macro is not used. * This constructor simply maintains backward compatibility. * DEPRECATED @@ -1283,12 +1758,11 @@ yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ): /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::ctor_common() -{ +void yyFlexLexer::ctor_common() { yy_c_buf_p = 0; yy_init = 0; yy_start = 0; - yy_flex_debug = 0; + yyflexdebug = 0; yylineno = 1; // this will only get updated if %option yylineno yy_did_buffer_switch_on_eof = 0; @@ -1305,24 +1779,24 @@ void yyFlexLexer::ctor_common() yy_buffer_stack_top = 0; yy_buffer_stack_max = 0; + + yy_state_buf = 0; } /* The contents of this function are C++ specific, so the () macro is not used. */ -yyFlexLexer::~yyFlexLexer() -{ +yyFlexLexer::~yyFlexLexer() { delete [] yy_state_buf; yyfree( yy_start_stack ); - yy_delete_buffer( YY_CURRENT_BUFFER ); + yy_delete_buffer( yy_current_buffer() ); yyfree( yy_buffer_stack ); } /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out ) -{ +void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out ) { // was if( new_in ) yy_delete_buffer( YY_CURRENT_BUFFER ); yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); @@ -1352,35 +1826,38 @@ int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) int yyFlexLexer::LexerInput( char* buf, int max_size ) #endif { - if ( yyin.eof() || yyin.fail() ) + if ( yyin.eof() || yyin.fail() ) { return 0; - + } #ifdef YY_INTERACTIVE yyin.get( buf[0] ); - if ( yyin.eof() ) + if ( yyin.eof() ) { return 0; - - if ( yyin.bad() ) + } + if ( yyin.bad() ) { return -1; - + } return 1; #else (void) yyin.read( buf, max_size ); - if ( yyin.bad() ) + if ( yyin.bad() ) { return -1; - else - return yyin.gcount(); + } else { + return (int)yyin.gcount(); + } #endif } -void yyFlexLexer::LexerOutput( const char* buf, int size ) -{ +void yyFlexLexer::LexerOutput( const char* buf, int size ) { (void) yyout.write( buf, size ); } + + + /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: @@ -1388,129 +1865,116 @@ void yyFlexLexer::LexerOutput( const char* buf, int size ) * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ + + int yyFlexLexer::yy_get_next_buffer() + { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) { + YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); + } + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { + /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; - } - - else - { + } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; - } } + } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - for ( i = 0; i < number_to_move; ++i ) + for ( i = 0; i < number_to_move; ++i ) { *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + } + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) { /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = + } else { + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + yybuffer b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); - if ( b->yy_is_our_buffer ) - { + if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; - if ( new_size <= 0 ) + if ( new_size <= 0 ) { b->yy_buf_size += b->yy_buf_size / 8; - else + } else { b->yy_buf_size *= 2; - + } b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); - } - else + } else { /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) + } + if ( ! b->yy_ch_buf ) { YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - + } (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - } + } - if ( num_to_read > YY_READ_BUF_SIZE ) + if ( num_to_read > YY_READ_BUF_SIZE ) { num_to_read = YY_READ_BUF_SIZE; - + } /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { + if ( (yy_n_chars) == 0 ) { + if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); - } - - else - { + } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } } - - else + } else { ret_val = EOB_ACT_CONTINUE_SCAN; - + } if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1) + 2; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) { YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } @@ -1524,75 +1988,188 @@ int yyFlexLexer::yy_get_next_buffer() return ret_val; } + /* yy_get_previous_state - get the state just before the EOB char was reached */ - yy_state_type yyFlexLexer::yy_get_previous_state() + + +yy_state_type yyFlexLexer::yy_get_previous_state() + { yy_state_type yy_current_state; char *yy_cp; - - yy_current_state = (yy_start); + + + /* Generate the code to find the start state. */ + + + yy_current_state = (yy_start); + + /* Set up for storing up states. */ + + + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { + /* Generate the code to find the next state. */ + + + + + + + + + + int yy_c = (*yy_cp ? *(yy_ec+YY_SC_TO_UI(*yy_cp)) : YY_NUL_EC); + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + + + /* Generate code to keep backing-up information. */ + + + if ( yy_accept[yy_current_state] ) { - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 306 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } + + + + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { + yy_current_state = (int) yy_def[yy_current_state]; + + + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice + */ + + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { + yy_c = yy_meta[yy_c]; + } + + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + + + + + + + + } + return yy_current_state; } + /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + + +yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + { int yy_is_jam; - char *yy_cp = (yy_c_buf_p); + /* Generate code for handling NUL's, if needed. */ + + /* First, deal with backing up and setting up yy_cp if the scanner + * finds that it should JAM on the NUL. + * + * Only generate a definition for "yy_cp" if we'll generate code + * that uses it. Otherwise lint and the like complain. + */ + char *yy_cp = (yy_c_buf_p); + + + + + + + + + + + + int yy_c = YY_NUL_EC; + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + + + /* Generate code to keep backing-up information. */ + - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; + if ( yy_accept[yy_current_state] ) { + + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + + + + + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 306 ) + + + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice + */ + + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { yy_c = yy_meta[yy_c]; } + + } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 305); - return yy_is_jam ? 0 : yy_current_state; +yy_is_jam = (yy_current_state == YY_JAMSTATE); + + + + + + + + return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT - void yyFlexLexer::yyunput( int c, char* yy_bp) + + + + +void yyFlexLexer::yyunput_r( int c, char* yy_bp) + { char *yy_cp; - - yy_cp = (yy_c_buf_p); + + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { + /* need to shift things up to make room */ /* +2 for EOB chars. */ int number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ @@ -1600,111 +2177,132 @@ int yyFlexLexer::yy_get_next_buffer() char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) { *--dest = *--source; - + } yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { YY_FATAL_ERROR( "flex scanner push-back overflow" ); } + } *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } -#endif - int yyFlexLexer::yyinput() + + + + +int yyFlexLexer::yyinput() + { int c; - + *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ + } else { + /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ + switch ( yy_get_next_buffer( ) ) { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; + /* Reset buffer status. */ + yyrestart( yyin ); - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } + /*FALLTHROUGH*/ - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; + case EOB_ACT_END_OF_FILE: + if ( yywrap( ) ) { + return 0; + } + if ( ! (yy_did_buffer_switch_on_eof) ) { + YY_NEW_FILE; } + return yyinput(); + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); } } + } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); + + + + + return c; } + /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ - void yyFlexLexer::yyrestart( std::istream& input_file ) + + +void yyFlexLexer::yyrestart( std::istream& input_file ) + { - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); + + + if ( yy_current_buffer() == NULL ) { + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_init_buffer( YY_CURRENT_BUFFER_LVALUE, input_file ); yy_load_buffer_state( ); + + + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } + /** Delegate to the new version that takes an istream reference. * @param input_file A readable stream. * @@ -1718,33 +2316,39 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) yyrestart( *input_file ); } + /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) + + +void yyFlexLexer::yy_switch_to_buffer( yybuffer new_buffer ) + { - + + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); - */ + */ yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) + if ( yy_current_buffer() == new_buffer ) { return; - - if ( YY_CURRENT_BUFFER ) - { + } + if ( yy_current_buffer() ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe @@ -1753,11 +2357,18 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) (yy_did_buffer_switch_on_eof) = 1; } - void yyFlexLexer::yy_load_buffer_state() + + + +void yyFlexLexer::yy_load_buffer_state() + { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + + yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file); + (yy_hold_char) = *(yy_c_buf_p); } @@ -1767,23 +2378,26 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) * * @return the allocated buffer state. */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size ) + + +yybuffer yyFlexLexer::yy_create_buffer( std::istream& file, int size ) + { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + yybuffer b; + b = (yybuffer) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( b == NULL ) { + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + } b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) + if ( b->yy_ch_buf == NULL ) { YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - + } b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); @@ -1791,72 +2405,99 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) return b; } + /** Delegate creation of buffers to the new version that takes an istream reference. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) +yybuffer yyFlexLexer::yy_create_buffer( std::istream* file, int size ) { return yy_create_buffer( *file, size ); } + /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ - void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); +void yyFlexLexer::yy_delete_buffer( yybuffer b ) +{ + + if ( b == NULL ) { + return; + } + if ( b == yy_current_buffer() ) { /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (yybuffer) 0; + } + if ( b->yy_is_our_buffer ) { + yyfree( (void *) b->yy_ch_buf ); + } yyfree( (void *) b ); } + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream& file ) + + +void yyFlexLexer::yy_init_buffer( yybuffer b, std::istream& file ) { int oerrno = errno; - + yy_flush_buffer( b ); + + b->yy_input_file = file.rdbuf(); - b->yy_fill_buffer = 1; - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } + + /* b->yy_input_file should never by NULL but we'll handle it cleanly + * on the off chance. + */ + if (b->yy_input_file == NULL){ + b->yy_fill_buffer = 0; + } else { + b->yy_fill_buffer = 1; + } + + + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != yy_current_buffer()) { + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param b the buffer state to be flushed, usually @c yy_current_buffer(). * */ - void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) + + +void yyFlexLexer::yy_flush_buffer( yybuffer b ) + { - if ( ! b ) + if ( b == NULL ) { return; - + } b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes @@ -1868,11 +2509,12 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; + b->yyatbol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) + if ( b == yy_current_buffer() ) { yy_load_buffer_state( ); + } } /** Pushes the new state onto the stack. The new state becomes @@ -1881,25 +2523,28 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) * @param new_buffer The new state. * */ -void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) + + +void yyFlexLexer::yypush_buffer_state (yybuffer new_buffer) + { - if (new_buffer == NULL) + if (new_buffer == NULL) { return; - + } yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { + if ( yy_current_buffer() != NULL ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) + if (yy_current_buffer()) { (yy_buffer_stack_top)++; + } YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ @@ -1907,45 +2552,53 @@ void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) (yy_did_buffer_switch_on_eof) = 1; } + /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ + + void yyFlexLexer::yypop_buffer_state (void) + { - if (!YY_CURRENT_BUFFER) + if (yy_current_buffer() == NULL) { return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); + } + yy_delete_buffer(yy_current_buffer() ); YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) + if ((yy_buffer_stack_top) > 0) { --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { + } + if (yy_current_buffer() != NULL) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } + /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ + + void yyFlexLexer::yyensure_buffer_stack(void) + { yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - + + if ((yy_buffer_stack) == NULL) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - if ( ! (yy_buffer_stack) ) + if ( (yy_buffer_stack == NULL) ) { YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + } memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1954,8 +2607,7 @@ void yyFlexLexer::yyensure_buffer_stack(void) return; } - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; @@ -1964,96 +2616,135 @@ void yyFlexLexer::yyensure_buffer_stack(void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); - if ( ! (yy_buffer_stack) ) + if ((yy_buffer_stack) == NULL) { YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + } /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } - void yyFlexLexer::yy_push_state( int _new_state ) + + + + + + + + + + + + + + + + + + + + + +void yyFlexLexer::yy_push_state( int _new_state ) + { - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) { yy_size_t new_size; (yy_start_stack_depth) += YY_START_STACK_INCR; new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); - if ( ! (yy_start_stack) ) + if ( ! (yy_start_stack) ) { (yy_start_stack) = (int *) yyalloc( new_size ); - else + } else { (yy_start_stack) = (int *) yyrealloc( (void *) (yy_start_stack), new_size ); - - if ( ! (yy_start_stack) ) + } + if ( ! (yy_start_stack) ) { YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } + } + (yy_start_stack)[(yy_start_stack_ptr)++] = yystart(); - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - - BEGIN(_new_state); + yybegin(_new_state); } - void yyFlexLexer::yy_pop_state() -{ - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); -} - int yyFlexLexer::yy_top_state() + + + +void yyFlexLexer::yy_pop_state() + { - return (yy_start_stack)[(yy_start_stack_ptr) - 1]; + if ( --(yy_start_stack_ptr) < 0 ) { + YY_FATAL_ERROR( "start-condition stack underflow" ); + } + yybegin((yy_start_stack)[(yy_start_stack_ptr)]); } -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif -void yyFlexLexer::LexerError( const char* msg ) + + + + +int yyFlexLexer::yy_top_state() + { - std::cerr << msg << std::endl; - exit( YY_EXIT_FAILURE ); + return (yy_start_stack_ptr) > 0 ? (yy_start_stack)[(yy_start_stack_ptr) - 1] : yystart(); } + /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ + do { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } while ( 0 ) + + /* Accessor methods (get/set functions) to struct members. */ + + + + + + + + + + + /* * Internal utility routines. */ + + #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) { s1[i] = s2[i]; + } } #endif + + #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { @@ -2065,13 +2756,15 @@ static int yy_flex_strlen (const char * s ) } #endif -void *yyalloc (yy_size_t size ) -{ + + +void *yyalloc (yy_size_t size ) { return malloc(size); } -void *yyrealloc (void * ptr, yy_size_t size ) -{ + + +void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those @@ -2083,12 +2776,22 @@ void *yyrealloc (void * ptr, yy_size_t size ) return realloc(ptr, size); } -void yyfree (void * ptr ) -{ + + +void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } -#define YYTABLES_NAME "yytables" + + + + + + + + + + /************************************/ /* Section 3 */ @@ -2106,3 +2809,4 @@ int main ( void ) } */ + diff --git a/src/ExprIntrp/ExprIntrp.lex b/src/ExprIntrp/ExprIntrp.lex index 86cc5ca73d..45eec9eeb1 100644 --- a/src/ExprIntrp/ExprIntrp.lex +++ b/src/ExprIntrp/ExprIntrp.lex @@ -17,7 +17,7 @@ %option yywrap %{ -#include +#include #include diff --git a/src/ExprIntrp/ExprIntrp.tab.c b/src/ExprIntrp/ExprIntrp.tab.cxx similarity index 95% rename from src/ExprIntrp/ExprIntrp.tab.c rename to src/ExprIntrp/ExprIntrp.tab.cxx index 42379f3ef1..c943e85d36 100644 --- a/src/ExprIntrp/ExprIntrp.tab.c +++ b/src/ExprIntrp/ExprIntrp.tab.cxx @@ -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 - 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. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -46,10 +46,10 @@ USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ -#define YYBISON 30704 +#define YYBISON 30802 /* Bison version string. */ -#define YYBISON_VERSION "3.7.4" +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -151,7 +151,7 @@ extern void ExprIntrp_EndOfEqual(); # endif # endif -#include "ExprIntrp.tab.h" +#include "ExprIntrp.tab.hxx" /* Symbol kind. */ enum yysymbol_kind_t { @@ -267,6 +267,18 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #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 + . */ +#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__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #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. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* 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 ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -590,7 +608,7 @@ static const yytype_int8 yytranslate[] = }; #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[] = { 0, 80, 80, 81, 82, 83, 84, 87, 87, 90, @@ -637,17 +655,6 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #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_value_is_default(Yyn) \ @@ -658,8 +665,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 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 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_int8 yydefact[] = { 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 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -51, -51, -51, -51, -51, -51, 0, -51, -51, -51, @@ -711,19 +718,19 @@ static const yytype_int8 yypgoto[] = -35, -51 }; - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +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, 129, 42, 24, 38, 89, 114, 90, 25, 116, 117, 135, 26, 95, 126, 27, 119, 145, 28, 120, 146, 29, 30 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 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 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int8 yystos[] = { 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 }; - /* 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[] = { 0, 26, 27, 27, 27, 27, 27, 29, 28, 31, @@ -804,7 +811,7 @@ static const yytype_int8 yyr1[] = 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[] = { 0, 2, 1, 1, 1, 1, 1, 0, 4, 0, @@ -826,6 +833,7 @@ enum { YYENOMEM = -2 }; #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -866,10 +874,7 @@ do { \ YYFPRINTF Args; \ } 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) \ @@ -893,15 +898,11 @@ yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; -# ifdef YYPRINT - if (yykind < YYNTOKENS) - YYPRINT (yyo, yytoknum[yykind], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1015,13 +1016,13 @@ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1084,6 +1085,7 @@ yyparse (void) YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1109,7 +1111,7 @@ yyparse (void) if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1137,7 +1139,7 @@ yyparse (void) # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1148,7 +1150,7 @@ yyparse (void) YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE @@ -1170,6 +1172,7 @@ yyparse (void) } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1551,6 +1554,7 @@ yyparse (void) label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -1611,7 +1615,7 @@ yyparse (void) `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -1619,24 +1623,22 @@ yyparse (void) `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - goto yyreturn; -#endif + goto yyreturnlab; -/*-------------------------------------------------------. -| yyreturn -- parsing is finished, clean up and return. | -`-------------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at diff --git a/src/ExprIntrp/ExprIntrp.tab.h b/src/ExprIntrp/ExprIntrp.tab.hxx similarity index 89% rename from src/ExprIntrp/ExprIntrp.tab.h rename to src/ExprIntrp/ExprIntrp.tab.hxx index 069d7f41ee..d50e2a1859 100644 --- a/src/ExprIntrp/ExprIntrp.tab.h +++ b/src/ExprIntrp/ExprIntrp.tab.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 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. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains 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 private implementation details that can be changed or removed. */ -#ifndef YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED -# define YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED +#ifndef YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED +# define YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -90,6 +90,8 @@ typedef int YYSTYPE; extern YYSTYPE ExprIntrplval; + int ExprIntrpparse (void); -#endif /* !YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_H_INCLUDED */ + +#endif /* !YY_EXPRINTRP_EXPRINTRP_EXPRINTRP_TAB_HXX_INCLUDED */ diff --git a/src/ExprIntrp/ExprIntrp_yaccintrf.cxx b/src/ExprIntrp/ExprIntrp_yaccintrf.cxx index 2511894316..15d893cae6 100644 --- a/src/ExprIntrp/ExprIntrp_yaccintrf.cxx +++ b/src/ExprIntrp/ExprIntrp_yaccintrf.cxx @@ -56,27 +56,27 @@ static TCollection_AsciiString ExprIntrp_funcdefname; static Standard_Integer ExprIntrp_nbargs; static Standard_Integer ExprIntrp_nbdiff; -extern "C" void ExprIntrp_StartFunction() +void ExprIntrp_StartFunction() { const TCollection_AsciiString& name = ExprIntrp_GetResult(); ExprIntrp_Recept.PushName(name); ExprIntrp_nbargs = 0; } -extern "C" void ExprIntrp_StartDerivate() +void ExprIntrp_StartDerivate() { const TCollection_AsciiString& name = ExprIntrp_GetResult(); ExprIntrp_Recept.PushName(name); } -extern "C" void ExprIntrp_EndDerivate() +void ExprIntrp_EndDerivate() { int degree; degree = ExprIntrp_GetDegree(); ExprIntrp_Recept.PushValue(degree); } -extern "C" void ExprIntrp_Derivation() +void ExprIntrp_Derivation() { ExprIntrp_Recept.PushValue(1); const TCollection_AsciiString& thename = ExprIntrp_GetResult(); @@ -90,14 +90,14 @@ extern "C" void ExprIntrp_Derivation() ExprIntrp_Recept.Push(namexp); } -extern "C" void ExprIntrp_DerivationValue() +void ExprIntrp_DerivationValue() { const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); ExprIntrp_Recept.PopValue(); ExprIntrp_Recept.PushValue(aStr.IntegerValue()); } -extern "C" void ExprIntrp_EndDerivation() +void ExprIntrp_EndDerivation() { Standard_Integer degree = ExprIntrp_Recept.PopValue(); Handle(Expr_NamedUnknown) var = Handle(Expr_NamedUnknown)::DownCast(ExprIntrp_Recept.Pop()); @@ -106,13 +106,13 @@ extern "C" void ExprIntrp_EndDerivation() ExprIntrp_Recept.Push(exp); } -extern "C" void ExprIntrp_StartDifferential() +void ExprIntrp_StartDifferential() { ExprIntrp_StartDerivate(); ExprIntrp_nbdiff = 0; } -extern "C" void ExprIntrp_DiffDegreeVar() +void ExprIntrp_DiffDegreeVar() { const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); const char* s = aStr.ToCString(); @@ -125,20 +125,20 @@ extern "C" void ExprIntrp_DiffDegreeVar() ExprIntrp_nbdiff++; } -extern "C" void ExprIntrp_DiffVar() +void ExprIntrp_DiffVar() { ExprIntrp_Recept.PushValue(1); ExprIntrp_DiffDegreeVar(); } -extern "C" void ExprIntrp_DiffDegree() +void ExprIntrp_DiffDegree() { const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); Standard_Integer deg = aStr.IntegerValue(); ExprIntrp_Recept.PushValue(deg); } -extern "C" void ExprIntrp_VerDiffDegree() +void ExprIntrp_VerDiffDegree() { const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); Standard_Integer deg = aStr.IntegerValue(); @@ -149,7 +149,7 @@ extern "C" void ExprIntrp_VerDiffDegree() ExprIntrp_Recept.PushValue(deg); } -extern "C" void ExprIntrp_EndDifferential() +void ExprIntrp_EndDifferential() { TCollection_AsciiString name = ExprIntrp_Recept.PopName(); Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.GetFunction(name); @@ -172,7 +172,7 @@ extern "C" void ExprIntrp_EndDifferential() ExprIntrp_Recept.PushFunction(thefunc); } -extern "C" void ExprIntrp_EndDiffFunction() +void ExprIntrp_EndDiffFunction() { Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.PopFunction(); 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(); 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(); 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++; } -extern "C" void ExprIntrp_EndFuncArg() +void ExprIntrp_EndFuncArg() { ExprIntrp_nbargs++; } -extern "C" void ExprIntrp_SumOperator() +void ExprIntrp_SumOperator() { Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); @@ -389,7 +389,7 @@ extern "C" void ExprIntrp_SumOperator() ExprIntrp_Recept.Push(res); } -extern "C" void ExprIntrp_MinusOperator() +void ExprIntrp_MinusOperator() { Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); @@ -397,7 +397,7 @@ extern "C" void ExprIntrp_MinusOperator() ExprIntrp_Recept.Push(res->ShallowSimplified()); } -extern "C" void ExprIntrp_DivideOperator() +void ExprIntrp_DivideOperator() { Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); @@ -405,7 +405,7 @@ extern "C" void ExprIntrp_DivideOperator() ExprIntrp_Recept.Push(res->ShallowSimplified()); } -extern "C" void ExprIntrp_ExpOperator() +void ExprIntrp_ExpOperator() { Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); @@ -413,7 +413,7 @@ extern "C" void ExprIntrp_ExpOperator() ExprIntrp_Recept.Push(res->ShallowSimplified()); } -extern "C" void ExprIntrp_ProductOperator() +void ExprIntrp_ProductOperator() { Handle(Expr_GeneralExpression) op2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) op1 = ExprIntrp_Recept.Pop(); @@ -421,20 +421,20 @@ extern "C" void ExprIntrp_ProductOperator() ExprIntrp_Recept.Push(res->ShallowSimplified()); } -extern "C" void ExprIntrp_UnaryMinusOperator() +void ExprIntrp_UnaryMinusOperator() { Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop(); Handle(Expr_UnaryMinus) res = new Expr_UnaryMinus(op); ExprIntrp_Recept.Push(res->ShallowSimplified()); } -extern "C" void ExprIntrp_UnaryPlusOperator() +void ExprIntrp_UnaryPlusOperator() { Handle(Expr_GeneralExpression) op = ExprIntrp_Recept.Pop(); ExprIntrp_Recept.Push(op); } -extern "C" void ExprIntrp_VariableIdentifier() +void ExprIntrp_VariableIdentifier() { const TCollection_AsciiString& thename = ExprIntrp_GetResult(); Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename); @@ -445,7 +445,7 @@ extern "C" void ExprIntrp_VariableIdentifier() ExprIntrp_Recept.Push(nameexp); } -extern "C" void ExprIntrp_NumValue() +void ExprIntrp_NumValue() { const TCollection_AsciiString& aStr = ExprIntrp_GetResult(); Standard_Real value = aStr.RealValue(); @@ -453,12 +453,12 @@ extern "C" void ExprIntrp_NumValue() ExprIntrp_Recept.Push(nval); } -extern "C" void ExprIntrp_AssignVariable() +void ExprIntrp_AssignVariable() { ExprIntrp_assname = ExprIntrp_GetResult(); } -extern "C" void ExprIntrp_Deassign() +void ExprIntrp_Deassign() { const TCollection_AsciiString& thename = ExprIntrp_GetResult(); Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename); @@ -472,25 +472,25 @@ extern "C" void ExprIntrp_Deassign() var->Deassign(); } -extern "C" void ExprIntrp_DefineFunction() +void ExprIntrp_DefineFunction() { ExprIntrp_funcdefname = ExprIntrp_Recept.PopName(); ExprIntrp_Recept.PushValue(ExprIntrp_nbargs); } -extern "C" void ExprIntrp_close() +void ExprIntrp_close() { ExprIntrp_stop_string(); } -extern "C" void ExprIntrperror(char* msg) +void ExprIntrperror(const char* msg) { ExprIntrp_close(); throw ExprIntrp_SyntaxError(msg); } -extern "C" void ExprIntrp_EndOfEqual() +void ExprIntrp_EndOfEqual() { Handle(Expr_GeneralExpression) memb2 = ExprIntrp_Recept.Pop(); Handle(Expr_GeneralExpression) memb1 = ExprIntrp_Recept.Pop(); @@ -498,7 +498,7 @@ extern "C" void ExprIntrp_EndOfEqual() ExprIntrp_Recept.PushRelation(res); } -extern "C" void ExprIntrp_EndOfRelation() +void ExprIntrp_EndOfRelation() { Handle(Expr_SystemRelation) sys; 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_NamedUnknown) namu; @@ -542,7 +542,7 @@ extern "C" void ExprIntrp_EndOfAssign() namu->Assign(ExprIntrp_Recept.Pop()); } -extern "C" void ExprIntrp_EndOfFuncDef() +void ExprIntrp_EndOfFuncDef() { Handle(Expr_GeneralExpression) theexp = ExprIntrp_Recept.Pop(); Standard_Integer nbargs = ExprIntrp_Recept.PopValue(); @@ -571,13 +571,13 @@ extern "C" void ExprIntrp_EndOfFuncDef() ExprIntrp_Recept.Use(thefunc); } -extern "C" void ExprIntrp_ConstantIdentifier() +void ExprIntrp_ConstantIdentifier() { const TCollection_AsciiString& thename = ExprIntrp_GetResult(); ExprIntrp_Recept.PushName(thename); } -extern "C" void ExprIntrp_ConstantDefinition() +void ExprIntrp_ConstantDefinition() { TCollection_AsciiString name = ExprIntrp_Recept.PopName(); 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()); Standard_Integer nb = (Standard_Integer) number->GetValue(); @@ -617,7 +617,7 @@ extern "C" void ExprIntrp_Sumator() ExprIntrp_Recept.Push(res->ShallowSimplified()); } -extern "C" void ExprIntrp_Productor() +void ExprIntrp_Productor() { Handle(Expr_NumericValue) number = Handle(Expr_NumericValue)::DownCast(ExprIntrp_Recept.Pop()); Standard_Integer nb = (Standard_Integer) number->GetValue(); diff --git a/src/ExprIntrp/ExprIntrp_yaccintrf.hxx b/src/ExprIntrp/ExprIntrp_yaccintrf.hxx index 046c4f2465..28d93e1615 100644 --- a/src/ExprIntrp/ExprIntrp_yaccintrf.hxx +++ b/src/ExprIntrp/ExprIntrp_yaccintrf.hxx @@ -17,12 +17,8 @@ #ifndef ExprIntrp_yaccintrf_HeaderFile #define ExprIntrp_yaccintrf_HeaderFile -#ifdef __cplusplus -extern "C" { -#endif - int ExprIntrpparse(); -void ExprIntrperror(char* msg); +void ExprIntrperror(const char* msg); void ExprIntrp_start_string(const char* str); void ExprIntrp_stop_string(); @@ -32,17 +28,9 @@ void ExprIntrp_SetDegree(); int ExprIntrplex(void); -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus - #include const TCollection_AsciiString& ExprIntrp_GetResult (); int ExprIntrp_GetDegree(); #endif - -#endif diff --git a/src/ExprIntrp/ExprIntrp_yacclex.cxx b/src/ExprIntrp/ExprIntrp_yacclex.cxx index 76079a2e06..23e29b1cb4 100644 --- a/src/ExprIntrp/ExprIntrp_yacclex.cxx +++ b/src/ExprIntrp/ExprIntrp_yacclex.cxx @@ -20,19 +20,14 @@ static TCollection_AsciiString ExprIntrp_curres; static int ExprIntrp_degree; -#ifndef _WIN32 extern char* ExprIntrptext; -#else -extern "C" char* ExprIntrptext; -#endif // _WIN32 - -extern "C" void ExprIntrp_SetResult() +void ExprIntrp_SetResult() { ExprIntrp_curres = ExprIntrptext; } -extern "C" void ExprIntrp_SetDegree() +void ExprIntrp_SetDegree() { ExprIntrp_degree = (int)strlen(ExprIntrptext); } diff --git a/src/ExprIntrp/FILES b/src/ExprIntrp/FILES index eec6c4ce3b..a248f4683a 100755 --- a/src/ExprIntrp/FILES +++ b/src/ExprIntrp/FILES @@ -1,8 +1,8 @@ ExprIntrp.cxx ExprIntrp.hxx ExprIntrp.lex -ExprIntrp.tab.c -ExprIntrp.tab.h +ExprIntrp.tab.cxx +ExprIntrp.tab.hxx ExprIntrp.yacc ExprIntrp_Analysis.cxx ExprIntrp_Analysis.hxx @@ -27,4 +27,4 @@ ExprIntrp_yaccanal.hxx ExprIntrp_yaccintrf.cxx ExprIntrp_yaccintrf.hxx ExprIntrp_yacclex.cxx -lex.ExprIntrp.c +lex.ExprIntrp.cxx diff --git a/src/ExprIntrp/lex.ExprIntrp.c b/src/ExprIntrp/lex.ExprIntrp.cxx similarity index 59% rename from src/ExprIntrp/lex.ExprIntrp.c rename to src/ExprIntrp/lex.ExprIntrp.cxx index 0bd3db536e..0a1bea4238 100644 --- a/src/ExprIntrp/lex.ExprIntrp.c +++ b/src/ExprIntrp/lex.ExprIntrp.cxx @@ -1,32 +1,33 @@ -#define YY_INT_ALIGNED short int - /* A lexical scanner generated by flex */ -#define yy_create_buffer ExprIntrp_create_buffer -#define yy_delete_buffer ExprIntrp_delete_buffer -#define yy_scan_buffer ExprIntrp_scan_buffer -#define yy_scan_string ExprIntrp_scan_string -#define yy_scan_bytes ExprIntrp_scan_bytes -#define yy_init_buffer ExprIntrp_init_buffer -#define yy_flush_buffer ExprIntrp_flush_buffer -#define yy_load_buffer_state ExprIntrp_load_buffer_state -#define yy_switch_to_buffer ExprIntrp_switch_to_buffer -#define yypush_buffer_state ExprIntrppush_buffer_state -#define yypop_buffer_state ExprIntrppop_buffer_state -#define yyensure_buffer_stack ExprIntrpensure_buffer_stack -#define yy_flex_debug ExprIntrp_flex_debug -#define yyin ExprIntrpin -#define yyleng ExprIntrpleng -#define yylex ExprIntrplex -#define yylineno ExprIntrplineno -#define yyout ExprIntrpout -#define yyrestart ExprIntrprestart -#define yytext ExprIntrptext -#define yywrap ExprIntrpwrap -#define yyalloc ExprIntrpalloc -#define yyrealloc ExprIntrprealloc -#define yyfree ExprIntrpfree +/* Target: C/C++ */ +/* START of m4 controls */ +/* M4_YY_TABLES_VERIFY = 0 */ +/* M4_MODE_NO_DO_STDINIT */ +/* M4_MODE_NO_YYTEXT_IS_ARRAY */ +/* M4_MODE_NO_YYMORE_USED */ +/* M4_MODE_NO_REAL_FULLSPD */ +/* M4_MODE_NO_REAL_FULLTBL */ +/* M4_MODE_NO_CPP_USE_READ */ +/* M4_MODE_NO_VARIABLE_TRAILING_CONTEXT_RULES */ +/* M4_MODE_FIND_ACTION_REJECT_REALLY_USED */ +/* M4_MODE_NO_USES_REJECT */ +/* M4_MODE_USEMECS */ +/* M4_MODE_FIND_ACTION_COMPRESSED */ +/* M4_MODE_NO_FULLSPD */ +/* M4_MODE_NO_BOL_NEEDED */ +/* M4_MODE_USEECS */ +/* M4_MODE_GENTABLES */ +/* M4_MODE_INTERACTIVE */ +/* M4_MODE_NO_FULLSPD_OR_FULLTBL */ +/* M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE */ +/* M4_MODE_YYWRAP */ +/* M4_MODE_INTERACTIVE */ +/* M4_MODE_C_ONLY */ +/* M4_MODE_PREFIX = ExprIntrp */ +/* M4_MODE_NO_REWRITE */ +/* END of m4 controls */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 @@ -258,10 +259,10 @@ #define yyout ExprIntrpout #endif -#ifdef yy_flex_debug -#define ExprIntrp_flex_debug_ALREADY_DEFINED +#ifdef yyflexdebug +#define ExprIntrpflexdebug_ALREADY_DEFINED #else -#define yy_flex_debug ExprIntrp_flex_debug +#define yyflexdebug ExprIntrpflexdebug #endif #ifdef yylineno @@ -273,6 +274,23 @@ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ + +/* Feature test macros. Flex uses functions that require a minimum set of + * macros defined. As defining some macros may hide function declarations that + * user code might use, be conservative and respect user's definitions as much + * as possible. In glibc, feature test macros may not be all set up until one + * of the libc header (that includes ) is included. This creates + * a circular dependency when we check the macros. is the safest + * header we can include and does not declare too many functions we don't need. + */ +#if !defined(__GNU_LIBRARY__) && defined(__STDC__) +#include +#endif +#if !(defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ + defined(_POSIX_SOURCE)) +# define _POSIX_C_SOURCE 1 /* Required for fileno() */ +# define _POSIX_SOURCE 1 +#endif #include #include #include @@ -280,75 +298,67 @@ /* end standard C headers. */ -/* flex integer type definitions */ +/* begin standard C++ headers. */ -#ifndef FLEXINT_H -#define FLEXINT_H +/* flex integer type definitions */ -/* C99 systems have . Non-C99 systems may or may not. */ +#ifndef YYFLEX_INTTYPES_DEFINED +#define YYFLEX_INTTYPES_DEFINED -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* Prefer C99 integer types if available. */ -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. +# if defined(__cplusplus) && __cplusplus >= 201103L +#include +# define YYFLEX_USE_STDINT +# endif +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* Include and not because Solaris 2.6 has the former + * and not the latter. */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - #include +# define YYFLEX_USE_STDINT +# else +# if defined(_MSC_VER) && _MSC_VER >= 1600 +/* Visual C++ 2010 does not define __STDC_VERSION__ and has but not + * . + */ +#include +# define YYFLEX_USE_STDINT +# endif +# endif +# ifdef YYFLEX_USE_STDINT typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; +# else +typedef unsigned char flex_uint8_t; typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; +# ifdef __STDC__ +typedef signed char flex_int8_t; +/* ISO C only requires at least 16 bits for int. */ +# ifdef __cplusplus +#include +# else +#include +# endif +# if UINT_MAX >= 4294967295 +# define YYFLEX_INT32_DEFINED +typedef int flex_int32_t; typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ +# endif +# else +typedef char flex_int8_t; +# endif +# ifndef YYFLEX_INT32_DEFINED +typedef long int flex_int32_t; +typedef unsigned long int flex_uint32_t; +# endif +# endif +#endif /* YYFLEX_INTTYPES_DEFINED */ /* TODO: this is always defined, so inline it */ #define yyconst const @@ -371,11 +381,15 @@ typedef unsigned int flex_uint32_t; * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ +#define yybegin(s) (yy_start) = 1 + 2 * (s) +/* Legacy interface */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ +#define yystart() (((yy_start) - 1) / 2) +/* Legacy interfaces */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ @@ -384,25 +398,16 @@ typedef unsigned int flex_uint32_t; #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. +/* The state buf must be large enough to hold one state per character in the main buffer, + * plus the start state, plus the two end-of-buffer byte states. */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#define YY_STATE_BUF_EXTRA_SPACE 3 +#define YY_STATE_BUF_SIZE (YY_BUF_SIZE + YY_STATE_BUF_EXTRA_SPACE) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *yybuffer; +/* Legacy interface */ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif @@ -435,12 +440,15 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) +#define yyunput(c) yyunput_r( c, (yytext_ptr) ) +/* Legacy interface */ +#define unput(c) yyunput_r( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { + FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ @@ -473,10 +481,10 @@ struct yy_buffer_state * If so, '^' rules will be active on the next match, otherwise * not. */ - int yy_at_bol; + int yyatbol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -505,7 +513,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ +static yybuffer * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -513,9 +521,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ +#define yy_current_buffer() ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) +/* Legacy interface */ +#define YY_CURRENT_BUFFER yy_current_buffer() /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -537,46 +547,59 @@ static int yy_start = 0; /* start state number */ static int yy_did_buffer_switch_on_eof; void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yy_switch_to_buffer ( yybuffer new_buffer ); +yybuffer yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( yybuffer b ); +void yy_flush_buffer ( yybuffer b ); +void yypush_buffer_state ( yybuffer new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) +static void yy_init_buffer ( yybuffer b, FILE *file ); +#define yy_flush_current_buffer() yy_flush_buffer( yy_current_buffer() ) +#define YY_FLUSH_BUFFER yy_flush_current_buffer() -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); +yybuffer yy_scan_buffer ( char *base, yy_size_t size ); +yybuffer yy_scan_string ( const char *yy_str ); +yybuffer yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ +#define yy_set_interactive(is_interactive) { \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ +} +#define yysetbol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + YY_CURRENT_BUFFER_LVALUE->yyatbol = at_bol; \ +} +#define yyatbol() (YY_CURRENT_BUFFER_LVALUE->yyatbol) +/* Legacy interface */ +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yyatbol) #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + YY_CURRENT_BUFFER_LVALUE->yyatbol = at_bol; \ +} + +/* Begin user sect3 */ typedef flex_uint8_t YY_CHAR; @@ -587,47 +610,98 @@ typedef int yy_state_type; extern int yylineno; int yylineno = 1; +/* Watch out: yytext_ptr is a variable when yytext is an array, + * but it's a macro when yytext is a pointer. + */ + extern char *yytext; + #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext +/* %% [1.5] DFA */ +/* START of m4 controls */ +/* M4_MODE_NO_NULTRANS */ +/* M4_MODE_NO_NULTRANS_FULLTBL */ +/* M4_MODE_NO_NULTRANS_FULLSPD */ +/* END of m4 controls */ + +/* START of Flex-generated definitions */ +#define YY_NUM_RULES 26 +#define YY_END_OF_BUFFER 27 +#define YY_JAMBASE 77 +#define YY_JAMSTATE 54 +#define YY_NUL_EC 1 +#define YY_OFFSET_TYPE flex_int16_t +/* END of Flex-generated definitions */ + static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); +static void yynoreturn yypanic ( const char* msg ); + +struct yy_trans_info + { + /* We require that yy_verify and yy_nxt must be of the same size int. */ + + /* We generate a bogus 'struct yy_trans_info' data type + * so we can guarantee that it is always declared in the skel. + * This is so we can compile "sizeof(struct yy_trans_info)" + * in any scanner. + */ + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + + }; /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ + do { \ (yytext_ptr) = yy_bp; \ + \ yyleng = (int) (yy_cp - yy_bp); \ + \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 26 -#define YY_END_OF_BUFFER 27 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[55] = - { 0, + \ + (yy_c_buf_p) = yy_cp; \ + } while(0) + +extern int yyflexdebug; +int yyflexdebug = 0; +/* Legacy interface */ +#ifndef yy_flex_debug +#define yy_flex_debug yyflexdebug +#endif + +/* %% [2.0] data tables for the DFA are inserted here */ + +/* footprint: 6712 bytes */ +/* tblend: 116 */ +/* numecs: 39 */ +/* num_rules: 26 */ +/* lastdfa: 53 */ + +/* m4 controls begin */ +/* M4_MODE_HAS_BACKING_UP */ +/* M4_MODE_NEED_YY_CP */ +/* m4 controls end */ + +static const flex_int16_t yy_accept[55] = { 0, 0, 0, 27, 26, 1, 25, 8, 10, 7, 2, 12, 3, 22, 4, 24, 26, 15, 13, 23, 23, 23, 23, 23, 9, 11, 5, 25, 6, 22, 0, 14, 23, 23, 23, 23, 23, 0, 21, 23, 23, 23, 23, 19, 23, 23, 23, 20, 18, 23, 17, 23, 23, 16, 0 - } ; +}; -static const YY_CHAR yy_ec[256] = - { 0, +/* Character equivalence-class mapping */ +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -656,38 +730,35 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - } ; +}; -static const YY_CHAR yy_meta[40] = - { 0, +/* Character meta-equivalence-class mappings */ +static const YY_CHAR yy_meta[40] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 - } ; +}; -static const flex_int16_t yy_base[56] = - { 0, +static const flex_int16_t yy_base[56] = { 0, 0, 0, 75, 77, 77, 71, 77, 77, 67, 77, 77, 77, 30, 77, 77, 63, 77, 77, 0, 38, 42, 35, 31, 77, 77, 77, 64, 77, 31, 37, 77, 0, 34, 19, 32, 33, 51, 50, 26, 25, 27, 29, 0, 19, 19, 14, 0, 0, 21, 0, 21, 16, 0, 77, 45 - } ; +}; -static const flex_int16_t yy_def[56] = - { 0, +static const flex_int16_t yy_def[56] = { 0, 54, 1, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 54, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 0, 54 - } ; +}; -static const flex_int16_t yy_nxt[117] = - { 0, +static const flex_int16_t yy_nxt[117] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 4, 19, 19, 19, 19, 19, @@ -701,10 +772,9 @@ static const flex_int16_t yy_nxt[117] = 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54 - } ; +}; -static const flex_int16_t yy_chk[117] = - { 0, +static const flex_int16_t yy_chk[117] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -718,22 +788,28 @@ static const flex_int16_t yy_chk[117] = 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54 - } ; +}; +/* Definitions for backing up. We don't need them if yyreject() + * is being used because then we use an alternative backing-up + * technique instead. + */ static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int yy_flex_debug; -int yy_flex_debug = 0; - /* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. + * any uses of yyreject() which flex missed. */ +#define yyreject() reject_used_but_not_detected #define REJECT reject_used_but_not_detected + #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET + char *yytext; + +/* %% [3.0] static declarations conditional on mode switches go here */ /* Copyright (c) 1997-1999 Matra Datavision @@ -750,7 +826,7 @@ char *yytext; Alternatively, this file may be used under the terms of Open CASCADE commercial license or contractual agreement. */ -#include +#include #include @@ -817,15 +893,15 @@ static int yywrap() * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ + #include + #endif - + #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals ( void ); - /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ @@ -867,9 +943,9 @@ extern int yywrap ( void ); #endif #endif -#ifndef YY_NO_UNPUT +#ifndef YY_NO_YYUNPUT - static void yyunput ( int c, char *buf_ptr ); + static void yyunput_r ( int c, char *buf_ptr ); #endif @@ -881,67 +957,94 @@ static void yy_flex_strncpy ( char *, const char *, int ); static int yy_flex_strlen ( const char * ); #endif -#ifndef YY_NO_INPUT -#ifdef __cplusplus +#ifndef YY_NO_YYINPUT + static int yyinput ( void ); -#else -static int input ( void ); +#ifndef __cplusplus +#define input yyinput #endif #endif -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ +/* + * Amount of stuff to slurp up with each read. + * We assume the stdio library has already + * chosen a fit size foe whatever platform + * we're running on. + */ +#define YY_READ_BUF_SIZE BUFSIZ + +/* Size of default input buffer. We want to be able to fit two + * OS-level reads, but efficiency gains as the buffer size + * increases fall off after that + */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE (2 * YY_READ_BUF_SIZE) #endif /* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO +#ifndef yyecho + /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#define yyecho() do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) + +#endif +/* Legacy interface */ +#define ECHO yyecho() + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 #endif +/* Report a fatal error. Legacy interface. */ +#ifndef YY_FATAL_ERROR + +#define YY_FATAL_ERROR(msg) yypanic( msg ) + +#endif + +/* Legacy interface */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) do {result = yyread(buf, max_size );} while (0) + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ +static int yyread(char *buf, size_t max_size ) { + + int result; + + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) { + int c = '*'; + yy_size_t n; + for ( n = 0; n < max_size && + (c = getc( yyin )) != EOF && c != '\n'; ++n ) { + buf[n] = (char) c; + } + if ( c == '\n' ) { + buf[n++] = (char) c; + } + if ( c == EOF && ferror( yyin ) ) { + YY_FATAL_ERROR( "input in flex scanner failed" ); + } + result = n; + } else { + errno=0; + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) { + if( errno != EINTR) { + YY_FATAL_ERROR( "input in flex scanner failed" ); + break; + } + errno=0; + clearerr(yyin); + } + } + + return result; +} #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -957,13 +1060,6 @@ static int input ( void ); #define YY_START_STACK_INCR 25 #endif -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ @@ -973,6 +1069,7 @@ static int input ( void ); extern int yylex (void); #define YY_DECL int yylex (void) + #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -982,338 +1079,393 @@ extern int yylex (void); #define YY_USER_ACTION #endif -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - #define YY_RULE_SETUP \ - YY_USER_ACTION + YY_USER_ACTION /** The main scanner function which does all the work. */ -YY_DECL -{ +YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; - if ( !(yy_init) ) - { + if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! (yy_start) ) + if ( ! (yy_start) ) { (yy_start) = 1; /* first start state */ + } + if ( ! yyin ) { - if ( ! yyin ) yyin = stdin; - if ( ! yyout ) + } + if ( ! yyout ) { + yyout = stdout; - if ( ! YY_CURRENT_BUFFER ) { + } + if ( yy_current_buffer() == NULL ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); - } + } + /* open scope of user declarationns */ { +/* %% [4.0] user's declarations go here */ + + while ( /*CONSTCOND*/1 ) { /* loops until end-of-file is reached */ + + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + /* Generate the code to find the start state. */ + + yy_current_state = (yy_start); + + /* Set up for storing up states. */ + + yy_match: + /* Generate the code to find the next match. */ - /* Support of yytext. */ - *yy_cp = (yy_hold_char); + do { + + int yy_c = *(yy_ec+YY_SC_TO_UI(*yy_cp)); + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + /* Generate code to keep backing-up information. */ + + if ( yy_accept[yy_current_state] ) { - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { + yy_current_state = (int) yy_def[yy_current_state]; + + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice */ - yy_bp = yy_cp; - yy_current_state = (yy_start); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 55 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 77 ); + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { + yy_c = yy_meta[yy_c]; + } + + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; -yy_find_action: + ++yy_cp; + + } + while ( yy_base[yy_current_state] != YY_JAMBASE ); + + yy_find_action: + /* code to find the action number goes here */ + yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; } - YY_DO_BEFORE_ACTION; + YY_DO_BEFORE_ACTION; -do_action: /* This label is used only to access EOF actions. */ + do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) { /* beginning of action switch */ - switch ( yy_act ) - { /* beginning of action switch */ case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + + /* Backing-up info for compressed tables is taken \after/ */ + /* yy_cp has been incremented for the next state. */ + yy_cp = (yy_last_accepting_cpos); + + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; -case 1: +/* %% [5.0] user actions get inserted here */ + case 1: YY_RULE_SETUP + {;} - YY_BREAK -case 2: + /*LINTED*/break; + case 2: YY_RULE_SETUP + {return(SUMOP) ;} - YY_BREAK -case 3: + /*LINTED*/break; + case 3: YY_RULE_SETUP + {return(MINUSOP) ;} - YY_BREAK -case 4: + /*LINTED*/break; + case 4: YY_RULE_SETUP + {return(DIVIDEOP) ;} - YY_BREAK -case 5: + /*LINTED*/break; + case 5: YY_RULE_SETUP + {return(EXPOP) ;} - YY_BREAK -case 6: + /*LINTED*/break; + case 6: YY_RULE_SETUP + {return(EXPOP) ;} - YY_BREAK -case 7: + /*LINTED*/break; + case 7: YY_RULE_SETUP + {return(MULTOP) ;} - YY_BREAK -case 8: + /*LINTED*/break; + case 8: YY_RULE_SETUP + {return(PARENTHESIS);} - YY_BREAK -case 9: + /*LINTED*/break; + case 9: YY_RULE_SETUP + {return(BRACKET);} - YY_BREAK -case 10: + /*LINTED*/break; + case 10: YY_RULE_SETUP + {return(ENDPARENTHESIS);} - YY_BREAK -case 11: + /*LINTED*/break; + case 11: YY_RULE_SETUP + {return(ENDBRACKET);} - YY_BREAK -case 12: + /*LINTED*/break; + case 12: YY_RULE_SETUP + {return(COMMA);} - YY_BREAK -case 13: + /*LINTED*/break; + case 13: YY_RULE_SETUP + {return(DIFFERENTIAL);} - YY_BREAK -case 14: + /*LINTED*/break; + case 14: YY_RULE_SETUP + {return(ASSIGNOP);} - YY_BREAK -case 15: + /*LINTED*/break; + case 15: YY_RULE_SETUP + {return(EQUALOP);} - YY_BREAK -case 16: + /*LINTED*/break; + case 16: YY_RULE_SETUP + {return(DEASSIGNKEY);} - YY_BREAK -case 17: + /*LINTED*/break; + case 17: YY_RULE_SETUP + {return(DERIVKEY);} - YY_BREAK -case 18: + /*LINTED*/break; + case 18: YY_RULE_SETUP + {return(CONSTKEY);} - YY_BREAK -case 19: + /*LINTED*/break; + case 19: YY_RULE_SETUP + {return(SUMKEY);} - YY_BREAK -case 20: + /*LINTED*/break; + case 20: YY_RULE_SETUP + {return(PRODKEY);} - YY_BREAK -case 21: + /*LINTED*/break; + case 21: YY_RULE_SETUP + {ExprIntrp_SetResult(); return(VALUE);} - YY_BREAK -case 22: + /*LINTED*/break; + case 22: YY_RULE_SETUP + {ExprIntrp_SetResult(); return(VALUE);} - YY_BREAK -case 23: + /*LINTED*/break; + case 23: YY_RULE_SETUP + {ExprIntrp_SetResult(); return(IDENTIFIER);} - YY_BREAK -case 24: + /*LINTED*/break; + case 24: YY_RULE_SETUP + {return(RELSEPARATOR);} - YY_BREAK -case 25: + /*LINTED*/break; + case 25: YY_RULE_SETUP + {ExprIntrp_SetDegree();return(DERIVATE);} - YY_BREAK -case 26: + /*LINTED*/break; + case 26: YY_RULE_SETUP -ECHO; - YY_BREAK -case YY_STATE_EOF(INITIAL): - yyterminate(); - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; +yyecho(); + /*LINTED*/break; + case YY_STATE_EOF(INITIAL): + /* FALLTHROUGH */ + yyterminate(); - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + case YY_END_OF_BUFFER: { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer() and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_current_state = yy_get_previous_state( ); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } + if ( yy_next_state ) { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } else { + + /* Still need to initialize yy_cp, though + * yy_current_state was set up by + * yy_get_previous_state(). + */ + yy_cp = (yy_c_buf_p); - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ + goto yy_find_action; + } + } else { /* not a NUL */ + switch ( yy_get_next_buffer( ) ) { + case EOB_ACT_END_OF_FILE: + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(yystart()); + goto do_action; + } else { + if ( ! (yy_did_buffer_switch_on_eof) ) { + YY_NEW_FILE; + } + } + break; + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); + } /* end EOB inner switch */ + } /* end if */ + break; + } /* case YY_END_OF_BUFFER */ + default: + YY_FATAL_ERROR("fatal flex scanner internal error--no action found" ); + } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ @@ -1325,129 +1477,115 @@ case YY_STATE_EOF(INITIAL): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ + static int yy_get_next_buffer (void) + { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) { + YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); + } + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { + /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; - } - - else - { + } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; - } } + } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - for ( i = 0; i < number_to_move; ++i ) + for ( i = 0; i < number_to_move; ++i ) { *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + } + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) { /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = + } else { + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + yybuffer b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); - if ( b->yy_is_our_buffer ) - { + if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; - if ( new_size <= 0 ) + if ( new_size <= 0 ) { b->yy_buf_size += b->yy_buf_size / 8; - else + } else { b->yy_buf_size *= 2; - + } b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); - } - else + } else { /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) + } + if ( ! b->yy_ch_buf ) { YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - + } (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - } + } - if ( num_to_read > YY_READ_BUF_SIZE ) + if ( num_to_read > YY_READ_BUF_SIZE ) { num_to_read = YY_READ_BUF_SIZE; - + } /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { + if ( (yy_n_chars) == 0 ) { + if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); - } - - else - { + } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } } - - else + } else { ret_val = EOB_ACT_CONTINUE_SCAN; - + } if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1) + 2; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) { YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } @@ -1463,30 +1601,56 @@ static int yy_get_next_buffer (void) /* yy_get_previous_state - get the state just before the EOB char was reached */ - static yy_state_type yy_get_previous_state (void) +static yy_state_type yy_get_previous_state (void) + { yy_state_type yy_current_state; char *yy_cp; - - yy_current_state = (yy_start); + + /* Generate the code to find the start state. */ + + yy_current_state = (yy_start); + + /* Set up for storing up states. */ + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { + /* Generate the code to find the next state. */ + + int yy_c = (*yy_cp ? *(yy_ec+YY_SC_TO_UI(*yy_cp)) : YY_NUL_EC); + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + /* Generate code to keep backing-up information. */ + + if ( yy_accept[yy_current_state] ) { - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 55 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { + yy_current_state = (int) yy_def[yy_current_state]; + + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice + */ + + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { + yy_c = yy_meta[yy_c]; + } + + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + + } + return yy_current_state; } @@ -1495,135 +1659,114 @@ static int yy_get_next_buffer (void) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) + +static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) + { int yy_is_jam; - char *yy_cp = (yy_c_buf_p); + /* Generate code for handling NUL's, if needed. */ - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 55 ) - yy_c = yy_meta[yy_c]; + /* First, deal with backing up and setting up yy_cp if the scanner + * finds that it should JAM on the NUL. + * + * Only generate a definition for "yy_cp" if we'll generate code + * that uses it. Otherwise lint and the like complain. + */ + char *yy_cp = (yy_c_buf_p); + + int yy_c = YY_NUL_EC; + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + /* Generate code to keep backing-up information. */ + + if ( yy_accept[yy_current_state] ) { + + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 54); - return yy_is_jam ? 0 : yy_current_state; -} + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { + yy_current_state = (int) yy_def[yy_current_state]; -#ifndef YY_NO_UNPUT + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice + */ - static void yyunput (int c, char * yy_bp ) -{ - char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { + yy_c = yy_meta[yy_c]; } - *--yy_cp = (char) c; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} +yy_is_jam = (yy_current_state == YY_JAMSTATE); -#endif + return yy_is_jam ? 0 : yy_current_state; +} -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif +#ifndef YY_NO_YYINPUT +int yyinput (void) { int c; - + *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ + } else { + /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); + switch ( yy_get_next_buffer( ) ) { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ - /*FALLTHROUGH*/ + /* Reset buffer status. */ + yyrestart( yyin ); - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; + /*FALLTHROUGH*/ - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; + case EOB_ACT_END_OF_FILE: + if ( yywrap( ) ) { + return 0; + } + if ( ! (yy_did_buffer_switch_on_eof) ) { + YY_NEW_FILE; } + return yyinput(); + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); } } + } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ @@ -1631,49 +1774,60 @@ static int yy_get_next_buffer (void) return c; } -#endif /* ifndef YY_NO_INPUT */ + +#endif /* ifndef YY_NO_YYINPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file ) + +void yyrestart (FILE * input_file ) + { - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); + + if ( yy_current_buffer() == NULL ) { + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_init_buffer( YY_CURRENT_BUFFER_LVALUE, input_file ); yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + +void yy_switch_to_buffer (yybuffer new_buffer ) + { - + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); - */ + */ yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) + if ( yy_current_buffer() == new_buffer ) { return; - - if ( YY_CURRENT_BUFFER ) - { + } + if ( yy_current_buffer() ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); @@ -1687,10 +1841,13 @@ static int yy_get_next_buffer (void) } static void yy_load_buffer_state (void) + { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } @@ -1700,23 +1857,25 @@ static void yy_load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) + +yybuffer yy_create_buffer (FILE * file, int size ) + { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + yybuffer b; + b = (yybuffer) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( b == NULL ) { + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + } b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) + if ( b->yy_ch_buf == NULL ) { YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - + } b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); @@ -1728,18 +1887,20 @@ static void yy_load_buffer_state (void) * @param b a buffer created with yy_create_buffer() * */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; +void yy_delete_buffer (yybuffer b ) - if ( b->yy_is_our_buffer ) +{ + + if ( b == NULL ) { + return; + } + if ( b == yy_current_buffer() ) { /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (yybuffer) 0; + } + if ( b->yy_is_our_buffer ) { yyfree( (void *) b->yy_ch_buf ); - + } yyfree( (void *) b ); } @@ -1747,24 +1908,33 @@ static void yy_load_buffer_state (void) * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +static void yy_init_buffer (yybuffer b, FILE * file ) { int oerrno = errno; - + yy_flush_buffer( b ); b->yy_input_file = file; - b->yy_fill_buffer = 1; - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } + /* b->yy_input_file should never by NULL but we'll handle it cleanly + * on the off chance. + */ + if (b->yy_input_file == NULL){ + b->yy_fill_buffer = 0; + } else { + b->yy_fill_buffer = 1; + } + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != yy_current_buffer()) { + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; @@ -1772,14 +1942,16 @@ static void yy_load_buffer_state (void) } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param b the buffer state to be flushed, usually @c yy_current_buffer(). * */ - void yy_flush_buffer (YY_BUFFER_STATE b ) + +void yy_flush_buffer (yybuffer b ) + { - if ( ! b ) + if ( b == NULL ) { return; - + } b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes @@ -1791,11 +1963,12 @@ static void yy_load_buffer_state (void) b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; + b->yyatbol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) + if ( b == yy_current_buffer() ) { yy_load_buffer_state( ); + } } /** Pushes the new state onto the stack. The new state becomes @@ -1804,25 +1977,27 @@ static void yy_load_buffer_state (void) * @param new_buffer The new state. * */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) + +void yypush_buffer_state (yybuffer new_buffer ) + { - if (new_buffer == NULL) + if (new_buffer == NULL) { return; - + } yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { + if ( yy_current_buffer() != NULL ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) + if (yy_current_buffer()) { (yy_buffer_stack_top)++; + } YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ @@ -1834,17 +2009,19 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) * The next element becomes the new top. * */ + void yypop_buffer_state (void) + { - if (!YY_CURRENT_BUFFER) + if (yy_current_buffer() == NULL) { return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); + } + yy_delete_buffer(yy_current_buffer() ); YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) + if ((yy_buffer_stack_top) > 0) { --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { + } + if (yy_current_buffer() != NULL) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1853,22 +2030,24 @@ void yypop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ + static void yyensure_buffer_stack (void) + { yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - + + if ((yy_buffer_stack) == NULL) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - if ( ! (yy_buffer_stack) ) + if ( (yy_buffer_stack == NULL) ) { YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + } memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1877,8 +2056,7 @@ static void yyensure_buffer_stack (void) return; } - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; @@ -1887,9 +2065,9 @@ static void yyensure_buffer_stack (void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); - if ( ! (yy_buffer_stack) ) + if ((yy_buffer_stack) == NULL) { YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + } /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1902,27 +2080,27 @@ static void yyensure_buffer_stack (void) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +yybuffer yy_scan_buffer (char * base, yy_size_t size ) { - YY_BUFFER_STATE b; - + yybuffer b; + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) + base[size-1] != YY_END_OF_BUFFER_CHAR ) { /* They forgot to leave room for the EOB's. */ return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) + } + b = (yybuffer) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( b == NULL ) { YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - + } b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; - b->yy_at_bol = 1; + b->yyatbol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; @@ -1939,9 +2117,9 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) +yybuffer yy_scan_string (const char * yystr ) { - + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } @@ -1952,28 +2130,27 @@ YY_BUFFER_STATE yy_scan_string (const char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; +yybuffer yy_scan_bytes (const char * yybytes, int _yybytes_len ) { + yybuffer b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); - if ( ! buf ) + if ( buf == 0 ) { YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) + } + for ( i = 0; i < _yybytes_len; ++i ) { buf[i] = yybytes[i]; - + } buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); - if ( ! b ) + if ( b == NULL ) { YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - + } /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ @@ -1982,85 +2159,67 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) return b; } -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ + do { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ -int yyget_lineno (void) -{ - - return yylineno; +int yyget_lineno (void) { + + return yylineno; } /** Get the input stream. * */ -FILE *yyget_in (void) -{ - return yyin; +FILE *yyget_in (void) { + return yyin; } /** Get the output stream. * */ -FILE *yyget_out (void) -{ - return yyout; +FILE *yyget_out (void) { + return yyout; } /** Get the length of the current token. * */ -int yyget_leng (void) -{ - return yyleng; +int yyget_leng (void) { + return yyleng; } /** Get the current token. * */ -char *yyget_text (void) -{ - return yytext; +char *yyget_text (void) { + return yytext; } /** Set the current line number. * @param _line_number line number * */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; +void yyset_lineno (int _line_number ) { + + yylineno = _line_number; } /** Set the input stream. This does not discard the current @@ -2069,62 +2228,54 @@ void yyset_lineno (int _line_number ) * * @see yy_switch_to_buffer */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; +void yyset_in (FILE * _in_str ) { + yyin = _in_str ; } -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; +void yyset_out (FILE * _out_str ) { + yyout = _out_str ; } -int yyget_debug (void) -{ - return yy_flex_debug; +int yyget_debug (void) { + return yyflexdebug; } -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; +void yyset_debug (int _bdebug ) { + yyflexdebug = _bdebug ; } -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ +static int yy_init_globals (void) { + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; + (yy_buffer_stack) = NULL; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = NULL; + (yy_init) = 0; + (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; + yyin = stdin; + yyout = stdout; #else - yyin = NULL; - yyout = NULL; + yyin = NULL; + yyout = NULL; #endif - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; +int yylex_destroy (void) { + + /* Pop the buffer stack, destroying each element. */ + while(yy_current_buffer()) { yypop_buffer_state(); } @@ -2132,11 +2283,11 @@ int yylex_destroy (void) yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); - return 0; + return 0; } /* @@ -2144,12 +2295,12 @@ int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) { s1[i] = s2[i]; + } } #endif @@ -2164,13 +2315,11 @@ static int yy_flex_strlen (const char * s ) } #endif -void *yyalloc (yy_size_t size ) -{ +void *yyalloc (yy_size_t size ) { return malloc(size); } -void *yyrealloc (void * ptr, yy_size_t size ) -{ +void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those @@ -2182,10 +2331,7 @@ void *yyrealloc (void * ptr, yy_size_t size ) return realloc(ptr, size); } -void yyfree (void * ptr ) -{ +void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } -#define YYTABLES_NAME "yytables" - diff --git a/src/FlexLexer/FlexLexer.h b/src/FlexLexer/FlexLexer.h index c4dad2b142..9b54949df8 100644 --- a/src/FlexLexer/FlexLexer.h +++ b/src/FlexLexer/FlexLexer.h @@ -95,14 +95,14 @@ class FlexLexer int lineno() const { return yylineno; } - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } + int debug() const { return yyflexdebug; } + void set_debug( int flag ) { yyflexdebug = flag; } protected: char* yytext; int yyleng; 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 @@ class yyFlexLexer : public FlexLexer { void yypush_buffer_state( yy_buffer_state* new_buffer ); void yypop_buffer_state(); + virtual int yyread(char *buf, size_t); virtual int yylex(); 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 ); @@ -148,8 +149,8 @@ class yyFlexLexer : public FlexLexer { virtual int LexerInput( char* buf, int max_size ); virtual void LexerOutput( const char* buf, int size ); virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); + + void yyunput_r( int c, char* buf_ptr ); int yyinput(); void yy_load_buffer_state(); @@ -201,6 +202,7 @@ class yyFlexLexer : public FlexLexer { yy_state_type* yy_state_buf; yy_state_type* yy_state_ptr; + size_t yy_state_buf_max; char* yy_full_match; int* yy_full_state; diff --git a/src/StepFile/lex.step.cxx b/src/StepFile/lex.step.cxx index 2436b0f008..2c61acf436 100644 --- a/src/StepFile/lex.step.cxx +++ b/src/StepFile/lex.step.cxx @@ -6,9 +6,44 @@ #include "stdint.h" #endif -#define YY_INT_ALIGNED short int -/* A lexical scanner generated by flex */ +/* Target: C/C++ */ +/* START of m4 controls */ +/* M4_YY_TABLES_VERIFY = 0 */ +/* M4_MODE_NO_DO_STDINIT */ +/* M4_MODE_NO_YYTEXT_IS_ARRAY */ +/* M4_MODE_YYMORE_USED */ +/* M4_MODE_NO_REAL_FULLSPD */ +/* M4_MODE_NO_REAL_FULLTBL */ +/* M4_MODE_NO_CPP_USE_READ */ +/* M4_MODE_VARIABLE_TRAILING_CONTEXT_RULES */ +/* M4_MODE_FIND_ACTION_REJECT_REALLY_USED */ +/* M4_MODE_USES_REJECT */ +/* M4_MODE_USEMECS */ +/* M4_MODE_FIND_ACTION_REJECT */ +/* M4_MODE_NO_FULLSPD */ +/* M4_MODE_NO_BOL_NEEDED */ +/* M4_MODE_USEECS */ +/* M4_MODE_GENTABLES */ +/* M4_MODE_NO_INTERACTIVE */ +/* M4_MODE_NO_FULLSPD_OR_FULLTBL */ +/* M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE */ +/* M4_MODE_YYCLASS */ +/* M4_MODE_NO_YYWRAP */ +/* M4_MODE_CXX_ONLY */ +/* M4_MODE_PREFIX = step */ +/* M4_MODE_NO_YYINPUT */ +/* M4_YY_NO_FLEX_ALLOC */ +/* M4_YY_NO_FLEX_REALLOC */ +/* M4_YY_NO_FLEX_FREE */ +/* M4_YY_NO_UNISTD_H */ +/* M4_YY_NEVER_INTERACTIVE */ +/* M4_MODE_NO_REWRITE */ +/* END of m4 controls */ + + + + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 @@ -18,6 +53,19 @@ #define FLEX_BETA #endif + + + + + + + + + + + + + /* The c++ scanner is a mess. The FlexLexer.h header file relies on the * following macro. This is required in order to pass the c++-multiple-scanners * test in the regression suite. We get reports that it breaks inheritance. @@ -26,105 +74,119 @@ */ #define yyFlexLexer stepFlexLexer + + + + + + + + #ifdef yyalloc #define stepalloc_ALREADY_DEFINED #else #define yyalloc stepalloc #endif + #ifdef yyrealloc #define steprealloc_ALREADY_DEFINED #else #define yyrealloc steprealloc #endif + #ifdef yyfree #define stepfree_ALREADY_DEFINED #else #define yyfree stepfree #endif + + + + + + + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ + + /* end standard C headers. */ -/* flex integer type definitions */ +/* begin standard C++ headers. */ -#ifndef FLEXINT_H -#define FLEXINT_H +#include +#include +#include +#include +#include +/* end standard C++ headers. */ -/* C99 systems have . Non-C99 systems may or may not. */ -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* flex integer type definitions */ -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif +#ifndef YYFLEX_INTTYPES_DEFINED +#define YYFLEX_INTTYPES_DEFINED +/* Prefer C99 integer types if available. */ + +# if defined(__cplusplus) && __cplusplus >= 201103L +#include +# define YYFLEX_USE_STDINT +# endif +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* Include and not because Solaris 2.6 has the former + * and not the latter. + */ #include +# define YYFLEX_USE_STDINT +# else +# if defined(_MSC_VER) && _MSC_VER >= 1600 +/* Visual C++ 2010 does not define __STDC_VERSION__ and has but not + * . + */ +#include +# define YYFLEX_USE_STDINT +# endif +# endif +# ifdef YYFLEX_USE_STDINT typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; +# else +typedef unsigned char flex_uint8_t; typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; +# ifdef __STDC__ +typedef signed char flex_int8_t; +/* ISO C only requires at least 16 bits for int. */ +# ifdef __cplusplus +#include +# else +#include +# endif +# if UINT_MAX >= 4294967295 +# define YYFLEX_INT32_DEFINED +typedef int flex_int32_t; typedef unsigned int flex_uint32_t; +# endif +# else +typedef char flex_int8_t; +# endif +# ifndef YYFLEX_INT32_DEFINED +typedef long int flex_int32_t; +typedef unsigned long int flex_uint32_t; +# endif +# endif +#endif /* YYFLEX_INTTYPES_DEFINED */ -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ -#include -#include -#include -#include -#include -/* end standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const @@ -138,20 +200,57 @@ typedef unsigned int flex_uint32_t; /* Returned upon end-of-file. */ #define YY_NULL 0 + /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ +#define yybegin(s) (yy_start) = 1 + 2 * (s) +/* Legacy interface */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ +#define yystart() (((yy_start) - 1) / 2) +/* Legacy interfaces */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ @@ -160,25 +259,20 @@ typedef unsigned int flex_uint32_t; #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif -/* The state buf must be large enough to hold one state per character in the main buffer. + +/* The state buf must be large enough to hold one state per character in the main buffer, + * plus the start state, plus the two end-of-buffer byte states. */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#define YY_STATE_BUF_EXTRA_SPACE 3 +#define YY_STATE_BUF_SIZE (YY_BUF_SIZE + YY_STATE_BUF_EXTRA_SPACE) + + #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *yybuffer; +/* Legacy interface */ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif @@ -187,8 +281,13 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif + extern int yyleng; + + + + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -209,13 +308,17 @@ extern int yyleng; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) +#define yyunput(c) yyunput_r( c, (yytext_ptr) ) +/* Legacy interface */ +#define unput(c) yyunput_r( c, (yytext_ptr) ) + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { + std::streambuf* yy_input_file; char *yy_ch_buf; /* input buffer */ @@ -248,10 +351,10 @@ struct yy_buffer_state * If so, '^' rules will be active on the next match, otherwise * not. */ - int yy_at_bol; + int yyatbol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -277,55 +380,91 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ + + + /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ +#define yy_current_buffer() ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) +/* Legacy interface */ +#define YY_CURRENT_BUFFER yy_current_buffer() /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + + + void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); + #define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ +#define yy_set_interactive(is_interactive) { \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ +} +#define yysetbol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + YY_CURRENT_BUFFER_LVALUE->yyatbol = at_bol; \ +} +#define yyatbol() (YY_CURRENT_BUFFER_LVALUE->yyatbol) +/* Legacy interface */ +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yyatbol) #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ + if ( yy_current_buffer() == NULL ) { \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + YY_CURRENT_BUFFER_LVALUE->yyatbol = at_bol; \ +} + /* Begin user sect3 */ + + + #define YY_SKIP_YYWRAP + + typedef flex_uint8_t YY_CHAR; + #define yytext_ptr yytext -#define YY_INTERACTIVE + + + + + + + + + #include -inline int yyFlexLexer::yywrap() { return 1; } +int yyFlexLexer::yywrap() { return 1;} + + int yyFlexLexer::yylex() { LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" ); @@ -334,49 +473,92 @@ int yyFlexLexer::yylex() #define YY_DECL int step::scanner::yylex() + + + + +/* %% [1.5] DFA */ +/* START of m4 controls */ +/* M4_MODE_NO_NULTRANS */ +/* M4_MODE_NO_NULTRANS_FULLTBL */ +/* M4_MODE_NO_NULTRANS_FULLSPD */ +/* END of m4 controls */ + +/* START of Flex-generated definitions */ +#define YY_NUM_RULES 44 +#define YY_END_OF_BUFFER 45 +#define YY_JAMBASE 323 +#define YY_JAMSTATE 123 +#define YY_NUL_EC 49 +#define YY_OFFSET_TYPE flex_int16_t +/* END of Flex-generated definitions */ + + + + + +struct yy_trans_info + { + /* We require that yy_verify and yy_nxt must be of the same size int. */ + + + /* We generate a bogus 'struct yy_trans_info' data type + * so we can guarantee that it is always declared in the skel. + * This is so we can compile "sizeof(struct yy_trans_info)" + * in any scanner. + */ + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + + }; + + + /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ + do { \ (yytext_ptr) = yy_bp; \ (yytext_ptr) -= (yy_more_len); \ yyleng = (int) (yy_cp - (yytext_ptr)); \ + \ + \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 44 -#define YY_END_OF_BUFFER 45 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_acclist[167] = - { 0, - 2, 2, 45, 42, 44, 10, 42, 44, 12, 42, - 44, 13, 42, 44, 11, 42, 44, 42, 44, 42, - 44, 42, 44, 26, 42, 44, 42, 44, 5, 42, - 44, 23, 42, 44, 24, 44, 18, 42, 44, 25, - 42, 44, 42, 44, 37, 42, 44, 18, 40, 42, - 44, 28, 42, 44, 27, 42, 44, 40, 42, 44, - 40, 42, 44, 40, 42, 44, 40, 42, 44, 40, - 42, 44, 40, 42, 44, 14, 42, 44, 2, 44, - 12, 44, 3, 44, 43, 44, 8, 44, 6, 12, - 44, 7, 44, 41, 17,16400, 19, 18, 19, 19, + \ + (yy_c_buf_p) = yy_cp; \ + } while(0) - 19, 1, 19, 22, 18, 19, 40, 40, 22, 40, - 40, 40, 40, 40, 14, 2, 3, 3, 4, 8, - 9, 21, 15, 8208, 40, 40, 40, 40, 40, 40, - 8208, 20, 20, 20, 40, 40, 40, 40, 40, 36, - 40, 20, 20, 20, 40, 32, 40, 40, 40, 40, - 29, 38, 40, 40, 40, 40, 40, 31, 40, 30, - 35, 39, 40, 33, 34, 34 - } ; -static const flex_int16_t yy_accept[125] = - { 0, + + + +/* %% [2.0] data tables for the DFA are inserted here */ + + + + + + + + + +/* footprint: 21234 bytes */ +/* tblend: 372 */ +/* numecs: 49 */ +/* num_rules: 44 */ +/* lastdfa: 122 */ + +/* m4 controls begin */ +/* M4_MODE_HAS_BACKING_UP */ +/* m4 controls end */ + + + + + +static const flex_int16_t yy_accept[125] = { 0, 1, 1, 1, 2, 3, 3, 3, 3, 3, 4, 6, 9, 12, 15, 18, 20, 22, 24, 27, 29, 32, 35, 37, 40, 43, 45, 48, 52, 55, 58, @@ -391,10 +573,13 @@ static const flex_int16_t yy_accept[125] = 147, 147, 148, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 161, 162, 164, 166, 167, 167 - } ; +}; + -static const YY_CHAR yy_ec[256] = - { 0, + + +/* Character equivalence-class mapping */ +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -423,19 +608,52 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - } ; +}; + -static const YY_CHAR yy_meta[50] = - { 0, + + +/* Character meta-equivalence-class mappings */ +static const YY_CHAR yy_meta[50] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4, 1, 1, 1, 5, 1, 6, 1, 1, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 1 - } ; +}; + + + + + -static const flex_int16_t yy_base[135] = - { 0, + + +static const flex_int16_t yy_acclist[167] = { 0, + 2, 2, 45, 42, 44, 10, 42, 44, 12, 42, + 44, 13, 42, 44, 11, 42, 44, 42, 44, 42, + 44, 42, 44, 26, 42, 44, 42, 44, 5, 42, + 44, 23, 42, 44, 24, 44, 18, 42, 44, 25, + 42, 44, 42, 44, 37, 42, 44, 18, 40, 42, + 44, 28, 42, 44, 27, 42, 44, 40, 42, 44, + 40, 42, 44, 40, 42, 44, 40, 42, 44, 40, + 42, 44, 40, 42, 44, 14, 42, 44, 2, 44, + 12, 44, 3, 44, 43, 44, 8, 44, 6, 12, + 44, 7, 44, 41, 17,16400, 19, 18, 19, 19, + + 19, 1, 19, 22, 18, 19, 40, 40, 22, 40, + 40, 40, 40, 40, 14, 2, 3, 3, 4, 8, + 9, 21, 15, 8208, 40, 40, 40, 40, 40, 40, + 8208, 20, 20, 20, 40, 40, 40, 40, 40, 36, + 40, 20, 20, 20, 40, 32, 40, 40, 40, 40, + 29, 38, 40, 40, 40, 40, 40, 31, 40, 30, + 35, 39, 40, 33, 34, 34 +}; + + + + +static const flex_int16_t yy_base[135] = { 0, 0, 0, 47, 48, 255, 252, 49, 52, 253, 323, 323, 323, 323, 323, 0, 0, 221, 323, 18, 323, 323, 323, 36, 323, 39, 223, 46, 323, 323, 211, @@ -451,10 +669,12 @@ static const flex_int16_t yy_base[135] = 217, 218, 228, 225, 323, 233, 323, 240, 323, 82, 0, 0, 323, 265, 272, 279, 281, 83, 284, 287, 294, 301, 308, 315 - } ; +}; + + + -static const flex_int16_t yy_def[135] = - { 0, +static const flex_int16_t yy_def[135] = { 0, 123, 1, 124, 124, 125, 125, 126, 126, 123, 123, 123, 123, 123, 123, 127, 128, 123, 123, 123, 123, 123, 123, 123, 123, 129, 123, 130, 123, 123, 130, @@ -470,10 +690,12 @@ static const flex_int16_t yy_def[135] = 130, 130, 123, 130, 123, 130, 123, 123, 123, 130, 134, 134, 0, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123 - } ; +}; + + + -static const flex_int16_t yy_nxt[373] = - { 0, +static const flex_int16_t yy_nxt[373] = { 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 10, 23, 24, 23, 25, 26, 27, 28, 29, 30, 30, 30, 31, 32, 30, 33, 34, @@ -515,10 +737,12 @@ static const flex_int16_t yy_nxt[373] = 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123 - } ; +}; -static const flex_int16_t yy_chk[373] = - { 0, + + + +static const flex_int16_t yy_chk[373] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -560,24 +784,58 @@ static const flex_int16_t yy_chk[373] = 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123 - } ; +}; + + + + + + + + + + + + #define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_HEAD_MASK 0x4000 -#define REJECT \ + + + + + +#define yyreject() \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ + \ (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \ (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \ yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ + \ ++(yy_lp); \ goto find_rule; \ } +#define REJECT yyreject() + + + + + + #define yymore() ((yy_more_flag) = 1) #define YY_MORE_ADJ (yy_more_len) #define YY_RESTORE_YY_MORE_OFFSET + + + + + + + +/* %% [3.0] static declarations conditional on mode switches go here */ /* Copyright (c) 1999-2014 OPEN CASCADE SAS @@ -603,8 +861,8 @@ goto find_rule; \ noyyalloc disables default allocation function noyyfree disables default deallocation function noyyrealloc disables default reallocation function + case-insensitive enable case insensitive parsing(any ?i: and other case setting will be ignored) */ -#define YY_NO_INPUT 1 #include #include "stdio.h" @@ -660,23 +918,27 @@ long string in files Henri.stp and 401.stp*/ #pragma GCC diagnostic ignored "-Wunused-function" #endif + + + #define INITIAL 0 #define Com 1 #define End 2 #define Text 3 -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - + + + + + #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif + + + + #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif @@ -685,36 +947,94 @@ static void yy_flex_strncpy ( char *, const char *, int ); static int yy_flex_strlen ( const char * ); #endif -#ifndef YY_NO_INPUT +#define YY_NO_YYINPUT 1 + +#ifndef YY_NO_YYINPUT #endif -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ + + + +/* + * Amount of stuff to slurp up with each read. + * We assume the stdio library has already + * chosen a fit size foe whatever platform + * we're running on. + */ +#define YY_READ_BUF_SIZE BUFSIZ + +/* Size of default input buffer. We want to be able to fit two + * OS-level reads, but efficiency gains as the buffer size + * increases fall off after that + */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE (2 * YY_READ_BUF_SIZE) #endif + /* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -#define ECHO LexerOutput( yytext, yyleng ) +#ifndef yyecho + + +#define yyecho() LexerOutput( yytext, yyleng ) + #endif +/* Legacy interface */ +#define ECHO yyecho() + + + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + + + + +void yyFlexLexer::LexerError( const char* msg ) { + std::cerr << msg << std::endl; + exit( YY_EXIT_FAILURE ); +} + + + +/* Report a fatal error. Legacy interface. */ +#ifndef YY_FATAL_ERROR + + +#define YY_FATAL_ERROR(msg) LexerError( msg ) + +#endif + +/* Legacy interface */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) do {result = yyread(buf, max_size );} while (0) + /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -\ - if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ + +int yyFlexLexer::yyread(char *buf, size_t max_size) { + + + int result; + + + + if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) { YY_FATAL_ERROR( "input in flex scanner failed" ); + } + return result; +} #endif + + + + /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. @@ -723,490 +1043,629 @@ static int yy_flex_strlen ( const char * ); #define yyterminate() return YY_NULL #endif + + /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) LexerError( msg ) + + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + + +#define YY_DECL int yyFlexLexer::yylex() + +#endif /* !YY_DECL */ + + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION #endif -/* end tables serialization structures and prototypes */ -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 -#define YY_DECL int yyFlexLexer::yylex() -#endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif +#define YY_RULE_SETUP \ + YY_USER_ACTION + + + + + + + + + + + +/** The main scanner function which does all the work. + */ +YY_DECL { + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + + + + + + + + + + if ( !(yy_init) ) { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) { + (yy_start) = 1; /* first start state */ + } + if ( ! yyin ) { + + + yyin.rdbuf(std::cin.rdbuf()); + + } + if ( ! yyout ) { + + + yyout.rdbuf(std::cout.rdbuf()); + + } + if ( yy_current_buffer() == NULL ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + + /* Create the reject buffer large enough to save one state per allowed character. + * If the reject buffer already exists, keep using it. + */ + if ( ! (yy_state_buf) ) { + (yy_state_buf) = (yy_state_type *)yyalloc( ((YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) * sizeof(yy_state_type)) ); + if ( ! (yy_state_buf) ) { + YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); + } + (yy_state_buf_max) = (YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE); + } + + + yy_load_buffer_state( ); + } + + /* open scope of user declarationns */ + { +/* %% [4.0] user's declarations go here */ + + + while ( /*CONSTCOND*/1 ) { /* loops until end-of-file is reached */ + + + (yy_more_len) = 0; + if ( (yy_more_flag) ) { + (yy_more_len) = (int) ((yy_c_buf_p) - (yytext_ptr)); + (yy_more_flag) = 0; + } + + + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + + /* Generate the code to find the start state. */ + + + yy_current_state = (yy_start); + + /* Set up for storing up states. */ + + (yy_state_ptr) = (yy_state_buf); + *(yy_state_ptr)++ = yy_current_state; + + + + + yy_match: + /* Generate the code to find the next match. */ + + + -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif -#define YY_RULE_SETUP \ - YY_USER_ACTION -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; + do { + + int yy_c = *(yy_ec+YY_SC_TO_UI(*yy_cp)); + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - /* Create the reject buffer large enough to save one state per allowed character. */ - if ( ! (yy_state_buf) ) - (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); - if ( ! (yy_state_buf) ) - YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { + yy_current_state = (int) yy_def[yy_current_state]; - if ( ! yyin ) - yyin.rdbuf(std::cin.rdbuf()); - if ( ! yyout ) - yyout.rdbuf(std::cout.rdbuf()); + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice + */ - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { + yy_c = yy_meta[yy_c]; } - yy_load_buffer_state( ); - } + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - { - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - (yy_more_len) = 0; - if ( (yy_more_flag) ) - { - (yy_more_len) = (int) ((yy_c_buf_p) - (yytext_ptr)); - (yy_more_flag) = 0; - } - yy_cp = (yy_c_buf_p); + *(yy_state_ptr)++ = yy_current_state; + ++yy_cp; - /* Support of yytext. */ - *yy_cp = (yy_hold_char); + } + + while ( yy_current_state != YY_JAMSTATE ); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - yy_current_state = (yy_start); - (yy_state_ptr) = (yy_state_buf); - *(yy_state_ptr)++ = yy_current_state; -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 124 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - *(yy_state_ptr)++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 323 ); + yy_find_action: + /* code to find the action number goes here */ + + -yy_find_action: - yy_current_state = *--(yy_state_ptr); - (yy_lp) = yy_accept[yy_current_state]; + yy_current_state = *--(yy_state_ptr); + (yy_lp) = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[(yy_lp)]; - if ( yy_act & YY_TRAILING_HEAD_MASK || - (yy_looking_for_trail_begin) ) - { - if ( yy_act == (yy_looking_for_trail_begin) ) - { - (yy_looking_for_trail_begin) = 0; - yy_act &= ~YY_TRAILING_HEAD_MASK; - break; + for ( ; ; ) { /* loop until we find out what rule we matched */ + if ((yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1]) { + yy_act = yy_acclist[(yy_lp)]; + + if ((yy_act & YY_TRAILING_HEAD_MASK) != 0 || (yy_looking_for_trail_begin)) { + if (yy_act == (yy_looking_for_trail_begin)) { + (yy_looking_for_trail_begin) = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; } + } else if (( yy_act & YY_TRAILING_MASK) != 0) { + (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; + (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; + + } else { + (yy_full_match) = yy_cp; + (yy_full_state) = (yy_state_ptr); + (yy_full_lp) = (yy_lp); + break; } - else if ( yy_act & YY_TRAILING_MASK ) - { - (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; - (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; - } - else - { - (yy_full_match) = yy_cp; - (yy_full_state) = (yy_state_ptr); - (yy_full_lp) = (yy_lp); - break; - } - ++(yy_lp); + ++(yy_lp); goto find_rule; + + } - --yy_cp; - yy_current_state = *--(yy_state_ptr); - (yy_lp) = yy_accept[yy_current_state]; - } - YY_DO_BEFORE_ACTION; + --yy_cp; + + /* We could consolidate the following two lines with those at + * the beginning, but at the cost of complaints that we're + * branching inside a loop. + */ + yy_current_state = *--(yy_state_ptr); + (yy_lp) = yy_accept[yy_current_state]; + } /* close for */ + -do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ -case 1: + YY_DO_BEFORE_ACTION; + + + + do_action: /* This label is used only to access EOF actions. */ + + + + switch ( yy_act ) { /* beginning of action switch */ + +/* %% [5.0] user actions get inserted here */ + case 1: YY_RULE_SETUP + { BEGIN(Com); } /* start of comment - put the scanner in the "Com" state */ - YY_BREAK -case 2: + /*LINTED*/break; + case 2: YY_RULE_SETUP + {;} /* in comment, skip any characters except asterisk (and newline, handled by its own rule) */ - YY_BREAK -case 3: + /*LINTED*/break; + case 3: YY_RULE_SETUP + {;} /* in comment, skip any sequence of asterisks followed by other symbols (except slash or newline) */ - YY_BREAK -case 4: + /*LINTED*/break; + case 4: YY_RULE_SETUP + { BEGIN(INITIAL); } /* end of comment - reset the scanner to initial state */ - YY_BREAK -case 5: + /*LINTED*/break; + case 5: YY_RULE_SETUP + { BEGIN(Text); yymore(); } /* start of quoted text string - put the scanner in the "Text" state, but keep ' as part of yytext */ - YY_BREAK -case 6: + /*LINTED*/break; + case 6: /* rule 6 can match eol */ YY_RULE_SETUP + { yymore(); yylineno ++; } /* newline in text string - increment line counter and keep collecting yytext */ - YY_BREAK -case 7: + /*LINTED*/break; + case 7: YY_RULE_SETUP + { yymore(); } /* single ' inside text string - keep collecting yytext*/ - YY_BREAK -case 8: + /*LINTED*/break; + case 8: YY_RULE_SETUP + { yymore(); } /* a sequence of any characters except ' and \n - keep collecting yytext */ - YY_BREAK -case 9: + /*LINTED*/break; + case 9: /* rule 9 can match eol */ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ YY_LINENO_REWIND_TO(yy_bp + 1); (yy_c_buf_p) = yy_cp = yy_bp + 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_DO_BEFORE_ACTION; /* set up yytext */ YY_RULE_SETUP + { BEGIN(INITIAL); CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamText); return(token::QUID); } /* end of string (apostrophe followed by comma or closing parenthesis) - reset the scanner to initial state, record the value of all yytext collected */ - YY_BREAK -case 10: + /*LINTED*/break; + case 10: YY_RULE_SETUP + {;} - YY_BREAK -case 11: + /*LINTED*/break; + case 11: YY_RULE_SETUP + {;} - YY_BREAK -case 12: + /*LINTED*/break; + case 12: /* rule 12 can match eol */ YY_RULE_SETUP + { yylineno ++; } /* count lines (one rule for all start conditions) */ - YY_BREAK -case 13: + /*LINTED*/break; + case 13: YY_RULE_SETUP + {;} /* abv 30.06.00: for reading DOS files */ - YY_BREAK -case 14: + /*LINTED*/break; + case 14: YY_RULE_SETUP + {;} /* fix from C21. for test load e3i file with line 15 with null symbols */ - YY_BREAK -case 15: + /*LINTED*/break; + case 15: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_DO_BEFORE_ACTION; /* set up yytext */ YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); return(token::ENTITY); } - YY_BREAK -case 16: + /*LINTED*/break; + case 16: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); return(token::ENTITY); } - YY_BREAK -case 17: + /*LINTED*/break; + case 17: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); return(token::IDENT); } - YY_BREAK -case 18: + /*LINTED*/break; + case 18: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamInteger); return(token::QUID); } - YY_BREAK -case 19: + /*LINTED*/break; + case 19: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamReal); return(token::QUID); } - YY_BREAK -case 20: + /*LINTED*/break; + case 20: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamReal); return(token::QUID); } - YY_BREAK -case 21: + /*LINTED*/break; + case 21: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamHexa); return(token::QUID); } - YY_BREAK -case 22: + /*LINTED*/break; + case 22: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamEnum); return(token::QUID); } - YY_BREAK -case 23: + /*LINTED*/break; + case 23: YY_RULE_SETUP + { return ('('); } - YY_BREAK -case 24: + /*LINTED*/break; + case 24: YY_RULE_SETUP + { return (')'); } - YY_BREAK -case 25: + /*LINTED*/break; + case 25: YY_RULE_SETUP + { myDataModel->PrepareNewArg(); return (','); } - YY_BREAK -case 26: + /*LINTED*/break; + case 26: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamVoid); return(token::QUID); } - YY_BREAK -case 27: + /*LINTED*/break; + case 27: YY_RULE_SETUP + { return ('='); } - YY_BREAK -case 28: + /*LINTED*/break; + case 28: YY_RULE_SETUP + { return (';'); } - YY_BREAK -case 29: + /*LINTED*/break; + case 29: YY_RULE_SETUP + { return(token::STEP); } - YY_BREAK -case 30: + /*LINTED*/break; + case 30: YY_RULE_SETUP + { return(token::HEADER); } - YY_BREAK -case 31: + /*LINTED*/break; + case 31: YY_RULE_SETUP + { return(token::ENDSEC); } - YY_BREAK -case 32: + /*LINTED*/break; + case 32: YY_RULE_SETUP + { return(token::DATA); } - YY_BREAK -case 33: + /*LINTED*/break; + case 33: YY_RULE_SETUP + { return(token::ENDSTEP);} - YY_BREAK -case 34: + /*LINTED*/break; + case 34: YY_RULE_SETUP + { return(token::ENDSTEP);} - YY_BREAK -case 35: + /*LINTED*/break; + case 35: YY_RULE_SETUP + { BEGIN(End); return(token::ENDSTEP); } /* at the end of the STEP data, enter dedicated start condition "End" to skip everything that follows */ - YY_BREAK -case 36: + /*LINTED*/break; + case 36: YY_RULE_SETUP + { return(token::STEP); } - YY_BREAK -case 37: + /*LINTED*/break; + case 37: YY_RULE_SETUP + { return ('/'); } - YY_BREAK -case 38: + /*LINTED*/break; + case 38: YY_RULE_SETUP + { return(token::SCOPE); } - YY_BREAK -case 39: + /*LINTED*/break; + case 39: YY_RULE_SETUP + { return(token::ENDSCOPE); } - YY_BREAK -case 40: + /*LINTED*/break; + case 40: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); return(token::TYPE); } - YY_BREAK -case 41: + /*LINTED*/break; + case 41: YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); return(token::TYPE); } - YY_BREAK -case 42: + /*LINTED*/break; + case 42: /* rule 42 can match eol */ YY_RULE_SETUP + { CreateNewText(YYText(),YYLeng()); SetTypeArg(Interface_ParamMisc); return(token::QUID); } - YY_BREAK -case 43: + /*LINTED*/break; + case 43: YY_RULE_SETUP + {;} /* skip any characters (except newlines) */ - YY_BREAK -case 44: + /*LINTED*/break; + case 44: YY_RULE_SETUP -YY_FATAL_ERROR( "flex scanner jammed" ); - YY_BREAK - case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(Com): - case YY_STATE_EOF(End): - case YY_STATE_EOF(Text): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; +yyecho(); + /*LINTED*/break; + case YY_STATE_EOF(INITIAL): + /* FALLTHROUGH */ + case YY_STATE_EOF(Com): + /* FALLTHROUGH */ + case YY_STATE_EOF(End): + /* FALLTHROUGH */ + case YY_STATE_EOF(Text): + /* FALLTHROUGH */ + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer() and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } - yy_next_state = yy_try_NUL_trans( yy_current_state ); + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_next_state = yy_try_NUL_trans( yy_current_state ); - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } + yy_bp = (yytext_ptr) + YY_MORE_ADJ; - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } + if ( yy_next_state ) { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } else { + + - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } + /* Still need to initialize yy_cp, though + * yy_current_state was set up by + * yy_get_previous_state(). + */ + yy_cp = (yy_c_buf_p); - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + goto yy_find_action; + } + } else { /* not a NUL */ + switch ( yy_get_next_buffer( ) ) { + case EOB_ACT_END_OF_FILE: + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(yystart()); + goto do_action; + } else { + if ( ! (yy_did_buffer_switch_on_eof) ) { + YY_NEW_FILE; + } + } + break; + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; + yy_current_state = yy_get_previous_state( ); - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; - yy_current_state = yy_get_previous_state( ); + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } + yy_current_state = yy_get_previous_state( ); - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); + } /* end EOB inner switch */ + } /* end if */ + break; + } /* case YY_END_OF_BUFFER */ + default: + YY_FATAL_ERROR("fatal flex scanner internal error--no action found" ); + } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ + + /* The contents of this function are C++ specific, so the () macro is not used. * This constructor simply maintains backward compatibility. * DEPRECATED @@ -1229,12 +1688,11 @@ yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ): /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::ctor_common() -{ +void yyFlexLexer::ctor_common() { yy_c_buf_p = 0; yy_init = 0; yy_start = 0; - yy_flex_debug = 0; + yyflexdebug = 0; yylineno = 1; // this will only get updated if %option yylineno yy_did_buffer_switch_on_eof = 0; @@ -1251,24 +1709,25 @@ void yyFlexLexer::ctor_common() yy_buffer_stack_top = 0; yy_buffer_stack_max = 0; + + yy_state_buf = new yy_state_type[YY_STATE_BUF_SIZE]; + yy_state_buf_max = YY_STATE_BUF_SIZE; } /* The contents of this function are C++ specific, so the () macro is not used. */ -yyFlexLexer::~yyFlexLexer() -{ +yyFlexLexer::~yyFlexLexer() { delete [] yy_state_buf; yyfree( yy_start_stack ); - yy_delete_buffer( YY_CURRENT_BUFFER ); + yy_delete_buffer( yy_current_buffer() ); yyfree( yy_buffer_stack ); } /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out ) -{ +void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out ) { // was if( new_in ) yy_delete_buffer( YY_CURRENT_BUFFER ); yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); @@ -1298,35 +1757,38 @@ int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) int yyFlexLexer::LexerInput( char* buf, int max_size ) #endif { - if ( yyin.eof() || yyin.fail() ) + if ( yyin.eof() || yyin.fail() ) { return 0; - + } #ifdef YY_INTERACTIVE yyin.get( buf[0] ); - if ( yyin.eof() ) + if ( yyin.eof() ) { return 0; - - if ( yyin.bad() ) + } + if ( yyin.bad() ) { return -1; - + } return 1; #else (void) yyin.read( buf, max_size ); - if ( yyin.bad() ) + if ( yyin.bad() ) { return -1; - else - return static_cast(yyin.gcount()); + } else { + return (int)yyin.gcount(); + } #endif } -void yyFlexLexer::LexerOutput( const char* buf, int size ) -{ +void yyFlexLexer::LexerOutput( const char* buf, int size ) { (void) yyout.write( buf, size ); } + + + /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: @@ -1334,99 +1796,88 @@ void yyFlexLexer::LexerOutput( const char* buf, int size ) * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ + + int yyFlexLexer::yy_get_next_buffer() + { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) { + YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); + } + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { + /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; - } - - else - { + } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; - } } + } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - for ( i = 0; i < number_to_move; ++i ) + for ( i = 0; i < number_to_move; ++i ) { *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + } + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) { /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = + } else { + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +"input buffer overflow, can't enlarge buffer because scanner uses yyreject()" ); - } + } - if ( num_to_read > YY_READ_BUF_SIZE ) + if ( num_to_read > YY_READ_BUF_SIZE ) { num_to_read = YY_READ_BUF_SIZE; - + } /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { + if ( (yy_n_chars) == 0 ) { + if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); - } - - else - { + } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } } - - else + } else { ret_val = EOB_ACT_CONTINUE_SCAN; - + } if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1) + 2; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) { YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } @@ -1440,70 +1891,177 @@ int yyFlexLexer::yy_get_next_buffer() return ret_val; } + /* yy_get_previous_state - get the state just before the EOB char was reached */ - yy_state_type yyFlexLexer::yy_get_previous_state() + + +yy_state_type yyFlexLexer::yy_get_previous_state() + { yy_state_type yy_current_state; char *yy_cp; - - yy_current_state = (yy_start); + + + /* Generate the code to find the start state. */ - (yy_state_ptr) = (yy_state_buf); - *(yy_state_ptr)++ = yy_current_state; - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 49); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 124 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - *(yy_state_ptr)++ = yy_current_state; + yy_current_state = (yy_start); + + /* Set up for storing up states. */ + + (yy_state_ptr) = (yy_state_buf); + *(yy_state_ptr)++ = yy_current_state; + + + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { + /* Generate the code to find the next state. */ + + + + + + + + + + int yy_c = (*yy_cp ? *(yy_ec+YY_SC_TO_UI(*yy_cp)) : YY_NUL_EC); + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + + + + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { + yy_current_state = (int) yy_def[yy_current_state]; + + + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice + */ + + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { + yy_c = yy_meta[yy_c]; } + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + + + + + + + *(yy_state_ptr)++ = yy_current_state; + } + return yy_current_state; } + /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + + +yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + { int yy_is_jam; - - YY_CHAR yy_c = 49; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + /* Generate code for handling NUL's, if needed. */ + + /* First, deal with backing up and setting up yy_cp if the scanner + * finds that it should JAM on the NUL. + * + * Only generate a definition for "yy_cp" if we'll generate code + * that uses it. Otherwise lint and the like complain. + */ + + + + + + + + + + + + + int yy_c = YY_NUL_EC; + /* Save the backing-up info \before/ computing the next state + * because we always compute one more state than needed - we + * always proceed until we reach a jam state + */ + + + + + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 124 ) + + + /* We've arranged it so that templates are never chained + * to one another. This means we can afford to make a + * very simple test to see if we need to convert to + * yy_c's meta-equivalence class without worrying + * about erroneously looking up the meta-equivalence + * class twice + */ + + /* lastdfa + 2 == YY_JAMSTATE + 1 is the beginning of the templates */ + if (yy_current_state >= YY_JAMSTATE + 1) { yy_c = yy_meta[yy_c]; } + + } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 123); - if ( ! yy_is_jam ) + +yy_is_jam = (yy_current_state == YY_JAMSTATE); + + /* Only stack this state if it's a transition we + * actually make. If we stack it on a jam, then + * the state stack and yy_c_buf_p get out of sync. + */ + if ( ! yy_is_jam ) { *(yy_state_ptr)++ = yy_current_state; + } + + + + - return yy_is_jam ? 0 : yy_current_state; + + + return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT - void yyFlexLexer::yyunput( int c, char* yy_bp) + + + + +void yyFlexLexer::yyunput_r( int c, char* yy_bp) + { char *yy_cp; - - yy_cp = (yy_c_buf_p); + + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { + /* need to shift things up to make room */ /* +2 for EOB chars. */ int number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ @@ -1511,111 +2069,150 @@ int yyFlexLexer::yy_get_next_buffer() char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) { *--dest = *--source; - + } yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { YY_FATAL_ERROR( "flex scanner push-back overflow" ); } + } *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } -#endif - int yyFlexLexer::yyinput() + + + + +int yyFlexLexer::yyinput() + { int c; - + *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ + } else { + /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ + switch ( yy_get_next_buffer( ) ) { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; + /* Reset buffer status. */ + yyrestart( yyin ); - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } + /*FALLTHROUGH*/ - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; + case EOB_ACT_END_OF_FILE: + if ( yywrap( ) ) { + return 0; + } + if ( ! (yy_did_buffer_switch_on_eof) ) { + YY_NEW_FILE; } + return yyinput(); + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); } } + } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); + + + + + return c; } + /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ - void yyFlexLexer::yyrestart( std::istream& input_file ) + + +void yyFlexLexer::yyrestart( std::istream& input_file ) + { - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); + + size_t new_size = 0; + yy_state_type *new_state_buf = 0; + + + if ( yy_current_buffer() == NULL ) { + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_init_buffer( YY_CURRENT_BUFFER_LVALUE, input_file ); yy_load_buffer_state( ); + + + /* Ensure the reject state buffer is large enough. + */ + if ( (yy_state_buf_max) < (yy_size_t) (yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) { + new_size = yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE; + new_state_buf = (yy_state_type *)yyrealloc( (yy_state_buf), (new_size * sizeof(yy_state_type)) ); + + if ( new_state_buf == NULL ) { + YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); + } + else { + (yy_state_buf) = new_state_buf; + (yy_state_buf_max) = new_size; + } + } + + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } + /** Delegate to the new version that takes an istream reference. * @param input_file A readable stream. * @@ -1629,33 +2226,57 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) yyrestart( *input_file ); } + /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) + + +void yyFlexLexer::yy_switch_to_buffer( yybuffer new_buffer ) + { - + + size_t new_size = 0; + yy_state_type *new_state_buf = 0; + + /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); - */ + */ yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) + if ( yy_current_buffer() == new_buffer ) { return; - - if ( YY_CURRENT_BUFFER ) - { + } + if ( yy_current_buffer() ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); + + /* Ensure the reject state buffer is large enough. + */ + if ( (yy_state_buf_max) < (yy_size_t) (YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) { + new_size = YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE; + new_state_buf = (yy_state_type *)yyrealloc( (yy_state_buf), (new_size * sizeof(yy_state_type)) ); + + if ( new_state_buf == NULL ) { + YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); + } + else { + (yy_state_buf) = new_state_buf; + (yy_state_buf_max) = new_size; + } + } + + /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe @@ -1664,11 +2285,18 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) (yy_did_buffer_switch_on_eof) = 1; } - void yyFlexLexer::yy_load_buffer_state() + + + +void yyFlexLexer::yy_load_buffer_state() + { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + + yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file); + (yy_hold_char) = *(yy_c_buf_p); } @@ -1678,23 +2306,26 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) * * @return the allocated buffer state. */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size ) + + +yybuffer yyFlexLexer::yy_create_buffer( std::istream& file, int size ) + { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + yybuffer b; + b = (yybuffer) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( b == NULL ) { + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + } b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) + if ( b->yy_ch_buf == NULL ) { YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - + } b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); @@ -1702,72 +2333,99 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) return b; } + /** Delegate creation of buffers to the new version that takes an istream reference. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) +yybuffer yyFlexLexer::yy_create_buffer( std::istream* file, int size ) { return yy_create_buffer( *file, size ); } + /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ - void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); +void yyFlexLexer::yy_delete_buffer( yybuffer b ) +{ + + if ( b == NULL ) { + return; + } + if ( b == yy_current_buffer() ) { /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (yybuffer) 0; + } + if ( b->yy_is_our_buffer ) { + yyfree( (void *) b->yy_ch_buf ); + } yyfree( (void *) b ); } + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream& file ) + + +void yyFlexLexer::yy_init_buffer( yybuffer b, std::istream& file ) { int oerrno = errno; - + yy_flush_buffer( b ); + + b->yy_input_file = file.rdbuf(); - b->yy_fill_buffer = 1; - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } + + /* b->yy_input_file should never by NULL but we'll handle it cleanly + * on the off chance. + */ + if (b->yy_input_file == NULL){ + b->yy_fill_buffer = 0; + } else { + b->yy_fill_buffer = 1; + } + + + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != yy_current_buffer()) { + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param b the buffer state to be flushed, usually @c yy_current_buffer(). * */ - void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) + + +void yyFlexLexer::yy_flush_buffer( yybuffer b ) + { - if ( ! b ) + if ( b == NULL ) { return; - + } b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes @@ -1779,11 +2437,12 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; + b->yyatbol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) + if ( b == yy_current_buffer() ) { yy_load_buffer_state( ); + } } /** Pushes the new state onto the stack. The new state becomes @@ -1792,25 +2451,28 @@ void yyFlexLexer::yyrestart( std::istream* input_file ) * @param new_buffer The new state. * */ -void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) + + +void yyFlexLexer::yypush_buffer_state (yybuffer new_buffer) + { - if (new_buffer == NULL) + if (new_buffer == NULL) { return; - + } yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { + if ( yy_current_buffer() != NULL ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + } /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) + if (yy_current_buffer()) { (yy_buffer_stack_top)++; + } YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ @@ -1818,45 +2480,53 @@ void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) (yy_did_buffer_switch_on_eof) = 1; } + /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ + + void yyFlexLexer::yypop_buffer_state (void) + { - if (!YY_CURRENT_BUFFER) + if (yy_current_buffer() == NULL) { return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); + } + yy_delete_buffer(yy_current_buffer() ); YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) + if ((yy_buffer_stack_top) > 0) { --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { + } + if (yy_current_buffer() != NULL) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } + /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ + + void yyFlexLexer::yyensure_buffer_stack(void) + { yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - + + if ((yy_buffer_stack) == NULL) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - if ( ! (yy_buffer_stack) ) + if ( (yy_buffer_stack == NULL) ) { YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + } memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -1865,8 +2535,7 @@ void yyFlexLexer::yyensure_buffer_stack(void) return; } - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; @@ -1875,96 +2544,135 @@ void yyFlexLexer::yyensure_buffer_stack(void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); - if ( ! (yy_buffer_stack) ) + if ((yy_buffer_stack) == NULL) { YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + } /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } - void yyFlexLexer::yy_push_state( int _new_state ) + + + + + + + + + + + + + + + + + + + + + +void yyFlexLexer::yy_push_state( int _new_state ) + { - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) { yy_size_t new_size; (yy_start_stack_depth) += YY_START_STACK_INCR; new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); - if ( ! (yy_start_stack) ) + if ( ! (yy_start_stack) ) { (yy_start_stack) = (int *) yyalloc( new_size ); - else + } else { (yy_start_stack) = (int *) yyrealloc( (void *) (yy_start_stack), new_size ); - - if ( ! (yy_start_stack) ) + } + if ( ! (yy_start_stack) ) { YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } + } + (yy_start_stack)[(yy_start_stack_ptr)++] = yystart(); - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - - BEGIN(_new_state); + yybegin(_new_state); } - void yyFlexLexer::yy_pop_state() -{ - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); -} - int yyFlexLexer::yy_top_state() + + + +void yyFlexLexer::yy_pop_state() + { - return (yy_start_stack)[(yy_start_stack_ptr) - 1]; + if ( --(yy_start_stack_ptr) < 0 ) { + YY_FATAL_ERROR( "start-condition stack underflow" ); + } + yybegin((yy_start_stack)[(yy_start_stack_ptr)]); } -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif -void yyFlexLexer::LexerError( const char* msg ) + + + + +int yyFlexLexer::yy_top_state() + { - std::cerr << msg << std::endl; - exit( YY_EXIT_FAILURE ); + return (yy_start_stack_ptr) > 0 ? (yy_start_stack)[(yy_start_stack_ptr) - 1] : yystart(); } + /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ + do { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } while ( 0 ) + + /* Accessor methods (get/set functions) to struct members. */ + + + + + + + + + + + /* * Internal utility routines. */ + + #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; - for ( i = 0; i < n; ++i ) + for ( i = 0; i < n; ++i ) { s1[i] = s2[i]; + } } #endif + + #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { @@ -1976,7 +2684,22 @@ static int yy_flex_strlen (const char * s ) } #endif -#define YYTABLES_NAME "yytables" + + + + + + + + + + + + + + + + #include diff --git a/src/StepFile/step.lex b/src/StepFile/step.lex index d8850f63c1..a999e4ad66 100644 --- a/src/StepFile/step.lex +++ b/src/StepFile/step.lex @@ -27,12 +27,15 @@ case-insensitive enable case insensitive parsing(any ?i: and other case setting will be ignored) */ %option c++ -%option 8bit warn nodefault +%option 8bit +%option warn %option noyywrap %option noinput %option yyclass="step::scanner" %option noyyalloc noyyfree noyyrealloc %option case-insensitive +%option nounistd +%option never-interactive %top{ // This file is part of Open CASCADE Technology software library. diff --git a/src/StepFile/step.tab.cxx b/src/StepFile/step.tab.cxx index e86fbf346e..9531457ac6 100644 --- a/src/StepFile/step.tab.cxx +++ b/src/StepFile/step.tab.cxx @@ -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++ -// 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 // it under the terms of the GNU General Public License as published by @@ -15,7 +15,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 . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // 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 # 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 (0) # define YY_STACK_PRINT() static_cast (0) @@ -150,9 +150,9 @@ namespace step { parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW {} - /*---------------. - | symbol kinds. | - `---------------*/ + /*---------. + | symbol. | + `---------*/ // basic_symbol. template @@ -170,11 +170,12 @@ namespace step { {} template - parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v) + parser::basic_symbol::basic_symbol (typename Base::kind_type t, YY_RVREF (value_type) v) : Base (t) , value (YY_MOVE (v)) {} + template parser::symbol_kind_type parser::basic_symbol::type_get () const YY_NOEXCEPT @@ -182,6 +183,7 @@ namespace step { return this->kind (); } + template bool parser::basic_symbol::empty () const YY_NOEXCEPT @@ -198,28 +200,30 @@ namespace step { } // by_kind. - parser::by_kind::by_kind () + parser::by_kind::by_kind () YY_NOEXCEPT : kind_ (symbol_kind::S_YYEMPTY) {} #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_) { that.clear (); } #endif - parser::by_kind::by_kind (const by_kind& that) + parser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT : 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)) {} + + void - parser::by_kind::clear () + parser::by_kind::clear () YY_NOEXCEPT { kind_ = symbol_kind::S_YYEMPTY; } @@ -237,6 +241,7 @@ namespace step { return kind_; } + parser::symbol_kind_type parser::by_kind::type_get () const YY_NOEXCEPT { @@ -244,6 +249,7 @@ namespace step { } + // by_state. parser::by_state::by_state () YY_NOEXCEPT : state (empty_state) @@ -326,7 +332,7 @@ namespace step { YY_SYMBOL_PRINT (yymsg, yysym); // User destructor. - YYUSE (yysym.kind ()); + YY_USE (yysym.kind ()); } #if YYDEBUG @@ -335,7 +341,7 @@ namespace step { parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const { std::ostream& yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (yysym.empty ()) yyo << "empty symbol"; else @@ -343,7 +349,7 @@ namespace step { symbol_kind_type yykind = yysym.kind (); yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << yysym.name () << " ("; - YYUSE (yykind); + YY_USE (yykind); yyo << ')'; } } @@ -369,7 +375,7 @@ namespace step { } void - parser::yypop_ (int n) + parser::yypop_ (int n) YY_NOEXCEPT { yystack_.pop (n); } @@ -412,13 +418,13 @@ namespace step { } bool - parser::yy_pact_value_is_default_ (int yyvalue) + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } bool - parser::yy_table_value_is_error_ (int yyvalue) + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } @@ -882,16 +888,16 @@ namespace step { // Actual number of expected tokens 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)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for 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. - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + const int yychecklim = yylast_ - yyn + 1; + const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_ (yytable_[yyx + yyn])) @@ -912,6 +918,9 @@ namespace step { + + + int parser::yy_syntax_error_arguments_ (const context& yyctx, symbol_kind_type yyarg[], int yyargn) const @@ -1036,7 +1045,7 @@ namespace step { const signed char 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, 50, 74, 75, 67, 59, 25, 51 }; @@ -1161,7 +1170,7 @@ namespace step { #endif // YYDEBUG parser::symbol_kind_type - parser::yytranslate_ (int t) + parser::yytranslate_ (int t) YY_NOEXCEPT { // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to // TOKEN-NUM as returned by yylex. @@ -1204,7 +1213,7 @@ namespace step { if (t <= 0) return symbol_kind::S_YYEOF; else if (t <= code_max) - return YY_CAST (symbol_kind_type, translate_table[t]); + return static_cast (translate_table[t]); else return symbol_kind::S_YYUNDEF; } diff --git a/src/StepFile/step.tab.hxx b/src/StepFile/step.tab.hxx index 914aac07b0..c0c1a34223 100644 --- a/src/StepFile/step.tab.hxx +++ b/src/StepFile/step.tab.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. // 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 // it under the terms of the GNU General Public License as published by @@ -15,7 +15,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 . +// along with this program. If not, see . // As a special exception, you may create a larger work that contains // 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. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* 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 ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -198,12 +204,18 @@ namespace step { class parser { public: -#ifndef YYSTYPE - /// Symbol semantic values. - typedef int semantic_type; +#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 - typedef YYSTYPE semantic_type; + /// Symbol semantic values. + typedef int value_type; #endif + /// Backward compatibility (Bison 3.8). + typedef value_type semantic_type; + /// Syntax errors thrown from user actions. struct syntax_error : std::runtime_error @@ -251,7 +263,7 @@ namespace step { }; /// 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). typedef token_kind_type token_type; @@ -339,7 +351,7 @@ namespace step { typedef Base super_type; /// Default constructor. - basic_symbol () + basic_symbol () YY_NOEXCEPT : value () {} @@ -358,7 +370,7 @@ namespace step { /// Constructor for symbols with semantic value. basic_symbol (typename Base::kind_type t, - YY_RVREF (semantic_type) v); + YY_RVREF (value_type) v); /// Destroy the symbol. ~basic_symbol () @@ -366,8 +378,10 @@ namespace step { clear (); } + + /// Destroy contents, and record that is empty. - void clear () + void clear () YY_NOEXCEPT { Base::clear (); } @@ -388,7 +402,7 @@ namespace step { void move (basic_symbol& s); /// The semantic value. - semantic_type value; + value_type value; private: #if YY_CPLUSPLUS < 201103L @@ -400,25 +414,27 @@ namespace step { /// Type access provider for token (enum) based symbols. struct by_kind { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + /// Default constructor. - by_kind (); + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS /// Move constructor. - by_kind (by_kind&& that); + by_kind (by_kind&& that) YY_NOEXCEPT; #endif /// Copy constructor. - by_kind (const by_kind& that); - - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + by_kind (const by_kind& that) YY_NOEXCEPT; /// Constructor from (external) token numbers. - by_kind (kind_type t); + by_kind (kind_type t) YY_NOEXCEPT; + + /// Record that this symbol is empty. - void clear (); + void clear () YY_NOEXCEPT; /// Steal the symbol kind from \a that. void move (by_kind& that); @@ -492,8 +508,8 @@ namespace step { { public: context (const parser& yyparser, const symbol_type& yyla); - const symbol_type& lookahead () const { return yyla_; } - symbol_kind_type token () const { return yyla_.kind (); } + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } /// 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 expected tokens (guaranteed to be less than YYNTOKENS). @@ -530,19 +546,19 @@ namespace step { /// Whether the given \c yypact_ value indicates a defaulted state. /// \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. /// \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 yytable_ninf_; /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals - /// are valid, yet not members of the token_type enum. - static symbol_kind_type yytranslate_ (int t); + /// are valid, yet not members of the token_kind_type enum. + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. static std::string yytnamerr_ (const char *yystr); @@ -574,14 +590,14 @@ namespace step { static const signed char yycheck_[]; - // YYSTOS[STATE-NUM] -- The (internal number of the) accessing - // symbol of state STATE-NUM. + // YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + // state STATE-NUM. 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_[]; - // 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_[]; @@ -680,7 +696,7 @@ namespace step { typedef typename S::size_type size_type; typedef typename std::ptrdiff_t index_type; - stack (size_type n = 200) + stack (size_type n = 200) YY_NOEXCEPT : seq_ (n) {} @@ -759,7 +775,7 @@ namespace step { class slice { public: - slice (const stack& stack, index_type range) + slice (const stack& stack, index_type range) YY_NOEXCEPT : stack_ (stack) , range_ (range) {} @@ -809,7 +825,7 @@ namespace step { void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_ (int n = 1); + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. enum diff --git a/src/TKExpress/PACKAGES b/src/TKExpress/PACKAGES index 8e2074197b..b659cccb8d 100644 --- a/src/TKExpress/PACKAGES +++ b/src/TKExpress/PACKAGES @@ -1 +1,3 @@ Express +Expr +ExprIntrp \ No newline at end of file diff --git a/src/TKMath/PACKAGES b/src/TKMath/PACKAGES index 667e4859ef..87ab2ac244 100755 --- a/src/TKMath/PACKAGES +++ b/src/TKMath/PACKAGES @@ -13,5 +13,3 @@ BVH gp TColgp TopLoc -Expr -ExprIntrp