Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:01

0001 // A Bison parser, made by GNU Bison 3.7.4.
0002 
0003 // Skeleton interface for Bison LALR(1) parsers in C++
0004 
0005 // Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
0006 
0007 // This program is free software: you can redistribute it and/or modify
0008 // it under the terms of the GNU General Public License as published by
0009 // the Free Software Foundation, either version 3 of the License, or
0010 // (at your option) any later version.
0011 
0012 // This program is distributed in the hope that it will be useful,
0013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 // GNU General Public License for more details.
0016 
0017 // You should have received a copy of the GNU General Public License
0018 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
0019 
0020 // As a special exception, you may create a larger work that contains
0021 // part or all of the Bison parser skeleton and distribute that work
0022 // under terms of your choice, so long as that work isn't itself a
0023 // parser generator using the skeleton or a modified version thereof
0024 // as a parser skeleton.  Alternatively, if you modify or redistribute
0025 // the parser skeleton itself, you may (at your option) remove this
0026 // special exception, which will cause the skeleton and the resulting
0027 // Bison output files to be licensed under the GNU General Public
0028 // License without this special exception.
0029 
0030 // This special exception was added by the Free Software Foundation in
0031 // version 2.2 of Bison.
0032 
0033 
0034 /**
0035  ** \file StepFile/step.tab.hxx
0036  ** Define the step::parser class.
0037  */
0038 
0039 // C++ LALR(1) parser skeleton written by Akim Demaille.
0040 
0041 // DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
0042 // especially those whose name start with YY_ or yy_.  They are
0043 // private implementation details that can be changed or removed.
0044 
0045 #ifndef YY_STEP_STEPFILE_STEP_TAB_HXX_INCLUDED
0046 # define YY_STEP_STEPFILE_STEP_TAB_HXX_INCLUDED
0047 // "%code requires" blocks.
0048 
0049 // This file is part of Open CASCADE Technology software library.
0050 // This file is generated, do not modify it directly; edit source file step.yacc instead.
0051 
0052 #include <StepFile_ReadData.hxx>
0053 namespace step {
0054   class scanner;
0055 };
0056 
0057 #ifdef _MSC_VER
0058 // disable MSVC warning C4522: 'step::parser::stack_symbol_type': multiple assignment operators
0059 #pragma warning(disable: 4522)
0060 // disable MSVC warning C4512: 'step::parser::stack::slice' : assignment operator could not be generated
0061 #pragma warning(disable: 4512)
0062 #endif
0063 
0064 
0065 
0066 
0067 # include <cstdlib> // std::abort
0068 # include <iostream>
0069 # include <stdexcept>
0070 # include <string>
0071 # include <vector>
0072 
0073 #if defined __cplusplus
0074 # define YY_CPLUSPLUS __cplusplus
0075 #else
0076 # define YY_CPLUSPLUS 199711L
0077 #endif
0078 
0079 // Support move semantics when possible.
0080 #if 201103L <= YY_CPLUSPLUS
0081 # define YY_MOVE           std::move
0082 # define YY_MOVE_OR_COPY   move
0083 # define YY_MOVE_REF(Type) Type&&
0084 # define YY_RVREF(Type)    Type&&
0085 # define YY_COPY(Type)     Type
0086 #else
0087 # define YY_MOVE
0088 # define YY_MOVE_OR_COPY   copy
0089 # define YY_MOVE_REF(Type) Type&
0090 # define YY_RVREF(Type)    const Type&
0091 # define YY_COPY(Type)     const Type&
0092 #endif
0093 
0094 // Support noexcept when possible.
0095 #if 201103L <= YY_CPLUSPLUS
0096 # define YY_NOEXCEPT noexcept
0097 # define YY_NOTHROW
0098 #else
0099 # define YY_NOEXCEPT
0100 # define YY_NOTHROW throw ()
0101 #endif
0102 
0103 // Support constexpr when possible.
0104 #if 201703 <= YY_CPLUSPLUS
0105 # define YY_CONSTEXPR constexpr
0106 #else
0107 # define YY_CONSTEXPR
0108 #endif
0109 
0110 
0111 
0112 #ifndef YY_ATTRIBUTE_PURE
0113 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
0114 #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
0115 # else
0116 #  define YY_ATTRIBUTE_PURE
0117 # endif
0118 #endif
0119 
0120 #ifndef YY_ATTRIBUTE_UNUSED
0121 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
0122 #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
0123 # else
0124 #  define YY_ATTRIBUTE_UNUSED
0125 # endif
0126 #endif
0127 
0128 /* Suppress unused-variable warnings by "using" E.  */
0129 #if ! defined lint || defined __GNUC__
0130 # define YYUSE(E) ((void) (E))
0131 #else
0132 # define YYUSE(E) /* empty */
0133 #endif
0134 
0135 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
0136 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
0137 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
0138     _Pragma ("GCC diagnostic push")                                     \
0139     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
0140     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
0141 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
0142     _Pragma ("GCC diagnostic pop")
0143 #else
0144 # define YY_INITIAL_VALUE(Value) Value
0145 #endif
0146 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
0147 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
0148 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
0149 #endif
0150 #ifndef YY_INITIAL_VALUE
0151 # define YY_INITIAL_VALUE(Value) /* Nothing. */
0152 #endif
0153 
0154 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
0155 # define YY_IGNORE_USELESS_CAST_BEGIN                          \
0156     _Pragma ("GCC diagnostic push")                            \
0157     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
0158 # define YY_IGNORE_USELESS_CAST_END            \
0159     _Pragma ("GCC diagnostic pop")
0160 #endif
0161 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
0162 # define YY_IGNORE_USELESS_CAST_BEGIN
0163 # define YY_IGNORE_USELESS_CAST_END
0164 #endif
0165 
0166 # ifndef YY_CAST
0167 #  ifdef __cplusplus
0168 #   define YY_CAST(Type, Val) static_cast<Type> (Val)
0169 #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
0170 #  else
0171 #   define YY_CAST(Type, Val) ((Type) (Val))
0172 #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
0173 #  endif
0174 # endif
0175 # ifndef YY_NULLPTR
0176 #  if defined __cplusplus
0177 #   if 201103L <= __cplusplus
0178 #    define YY_NULLPTR nullptr
0179 #   else
0180 #    define YY_NULLPTR 0
0181 #   endif
0182 #  else
0183 #   define YY_NULLPTR ((void*)0)
0184 #  endif
0185 # endif
0186 
0187 /* Debug traces.  */
0188 #ifndef YYDEBUG
0189 # define YYDEBUG 0
0190 #endif
0191 
0192 namespace step {
0193 
0194 
0195 
0196 
0197   /// A Bison parser.
0198   class parser
0199   {
0200   public:
0201 #ifndef YYSTYPE
0202     /// Symbol semantic values.
0203     typedef int semantic_type;
0204 #else
0205     typedef YYSTYPE semantic_type;
0206 #endif
0207 
0208     /// Syntax errors thrown from user actions.
0209     struct syntax_error : std::runtime_error
0210     {
0211       syntax_error (const std::string& m)
0212         : std::runtime_error (m)
0213       {}
0214 
0215       syntax_error (const syntax_error& s)
0216         : std::runtime_error (s.what ())
0217       {}
0218 
0219       ~syntax_error () YY_NOEXCEPT YY_NOTHROW;
0220     };
0221 
0222     /// Token kinds.
0223     struct token
0224     {
0225       enum token_kind_type
0226       {
0227         YYEMPTY = -2,
0228     YYEOF = 0,                     // "end of file"
0229     YYerror = 256,                 // error
0230     YYUNDEF = 257,                 // "invalid token"
0231     STEP = 258,                    // STEP
0232     HEADER = 259,                  // HEADER
0233     ENDSEC = 260,                  // ENDSEC
0234     DATA = 261,                    // DATA
0235     ENDSTEP = 262,                 // ENDSTEP
0236     SCOPE = 263,                   // SCOPE
0237     ENDSCOPE = 264,                // ENDSCOPE
0238     ENTITY = 265,                  // ENTITY
0239     TYPE = 266,                    // TYPE
0240     INTEGER = 267,                 // INTEGER
0241     FLOAT = 268,                   // FLOAT
0242     IDENT = 269,                   // IDENT
0243     TEXT = 270,                    // TEXT
0244     NONDEF = 271,                  // NONDEF
0245     ENUM = 272,                    // ENUM
0246     HEXA = 273,                    // HEXA
0247     QUID = 274                     // QUID
0248       };
0249       /// Backward compatibility alias (Bison 3.6).
0250       typedef token_kind_type yytokentype;
0251     };
0252 
0253     /// Token kind, as returned by yylex.
0254     typedef token::yytokentype token_kind_type;
0255 
0256     /// Backward compatibility alias (Bison 3.6).
0257     typedef token_kind_type token_type;
0258 
0259     /// Symbol kinds.
0260     struct symbol_kind
0261     {
0262       enum symbol_kind_type
0263       {
0264         YYNTOKENS = 27, ///< Number of tokens.
0265         S_YYEMPTY = -2,
0266         S_YYEOF = 0,                             // "end of file"
0267         S_YYerror = 1,                           // error
0268         S_YYUNDEF = 2,                           // "invalid token"
0269         S_STEP = 3,                              // STEP
0270         S_HEADER = 4,                            // HEADER
0271         S_ENDSEC = 5,                            // ENDSEC
0272         S_DATA = 6,                              // DATA
0273         S_ENDSTEP = 7,                           // ENDSTEP
0274         S_SCOPE = 8,                             // SCOPE
0275         S_ENDSCOPE = 9,                          // ENDSCOPE
0276         S_ENTITY = 10,                           // ENTITY
0277         S_TYPE = 11,                             // TYPE
0278         S_INTEGER = 12,                          // INTEGER
0279         S_FLOAT = 13,                            // FLOAT
0280         S_IDENT = 14,                            // IDENT
0281         S_TEXT = 15,                             // TEXT
0282         S_NONDEF = 16,                           // NONDEF
0283         S_ENUM = 17,                             // ENUM
0284         S_HEXA = 18,                             // HEXA
0285         S_QUID = 19,                             // QUID
0286         S_20_ = 20,                              // ' '
0287         S_21_ = 21,                              // ';'
0288         S_22_ = 22,                              // '('
0289         S_23_ = 23,                              // ')'
0290         S_24_ = 24,                              // ','
0291         S_25_ = 25,                              // '='
0292         S_26_ = 26,                              // '/'
0293         S_YYACCEPT = 27,                         // $accept
0294         S_finvide = 28,                          // finvide
0295         S_finstep = 29,                          // finstep
0296         S_stepf1 = 30,                           // stepf1
0297         S_stepf2 = 31,                           // stepf2
0298         S_stepf3 = 32,                           // stepf3
0299         S_stepf = 33,                            // stepf
0300         S_headl = 34,                            // headl
0301         S_headent = 35,                          // headent
0302         S_endhead = 36,                          // endhead
0303         S_unarg = 37,                            // unarg
0304         S_listype = 38,                          // listype
0305         S_deblist = 39,                          // deblist
0306         S_finlist = 40,                          // finlist
0307         S_listarg = 41,                          // listarg
0308         S_arglist = 42,                          // arglist
0309         S_model = 43,                            // model
0310         S_bloc = 44,                             // bloc
0311         S_plex = 45,                             // plex
0312         S_unent = 46,                            // unent
0313         S_debscop = 47,                          // debscop
0314         S_unid = 48,                             // unid
0315         S_export = 49,                           // export
0316         S_debexp = 50,                           // debexp
0317         S_finscop = 51,                          // finscop
0318         S_entlab = 52,                           // entlab
0319         S_enttype = 53                           // enttype
0320       };
0321     };
0322 
0323     /// (Internal) symbol kind.
0324     typedef symbol_kind::symbol_kind_type symbol_kind_type;
0325 
0326     /// The number of tokens.
0327     static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS;
0328 
0329     /// A complete symbol.
0330     ///
0331     /// Expects its Base type to provide access to the symbol kind
0332     /// via kind ().
0333     ///
0334     /// Provide access to semantic value.
0335     template <typename Base>
0336     struct basic_symbol : Base
0337     {
0338       /// Alias to Base.
0339       typedef Base super_type;
0340 
0341       /// Default constructor.
0342       basic_symbol ()
0343         : value ()
0344       {}
0345 
0346 #if 201103L <= YY_CPLUSPLUS
0347       /// Move constructor.
0348       basic_symbol (basic_symbol&& that)
0349         : Base (std::move (that))
0350         , value (std::move (that.value))
0351       {}
0352 #endif
0353 
0354       /// Copy constructor.
0355       basic_symbol (const basic_symbol& that);
0356       /// Constructor for valueless symbols.
0357       basic_symbol (typename Base::kind_type t);
0358 
0359       /// Constructor for symbols with semantic value.
0360       basic_symbol (typename Base::kind_type t,
0361                     YY_RVREF (semantic_type) v);
0362 
0363       /// Destroy the symbol.
0364       ~basic_symbol ()
0365       {
0366         clear ();
0367       }
0368 
0369       /// Destroy contents, and record that is empty.
0370       void clear ()
0371       {
0372         Base::clear ();
0373       }
0374 
0375       /// The user-facing name of this symbol.
0376       std::string name () const YY_NOEXCEPT
0377       {
0378         return parser::symbol_name (this->kind ());
0379       }
0380 
0381       /// Backward compatibility (Bison 3.6).
0382       symbol_kind_type type_get () const YY_NOEXCEPT;
0383 
0384       /// Whether empty.
0385       bool empty () const YY_NOEXCEPT;
0386 
0387       /// Destructive move, \a s is emptied into this.
0388       void move (basic_symbol& s);
0389 
0390       /// The semantic value.
0391       semantic_type value;
0392 
0393     private:
0394 #if YY_CPLUSPLUS < 201103L
0395       /// Assignment operator.
0396       basic_symbol& operator= (const basic_symbol& that);
0397 #endif
0398     };
0399 
0400     /// Type access provider for token (enum) based symbols.
0401     struct by_kind
0402     {
0403       /// Default constructor.
0404       by_kind ();
0405 
0406 #if 201103L <= YY_CPLUSPLUS
0407       /// Move constructor.
0408       by_kind (by_kind&& that);
0409 #endif
0410 
0411       /// Copy constructor.
0412       by_kind (const by_kind& that);
0413 
0414       /// The symbol kind as needed by the constructor.
0415       typedef token_kind_type kind_type;
0416 
0417       /// Constructor from (external) token numbers.
0418       by_kind (kind_type t);
0419 
0420       /// Record that this symbol is empty.
0421       void clear ();
0422 
0423       /// Steal the symbol kind from \a that.
0424       void move (by_kind& that);
0425 
0426       /// The (internal) type number (corresponding to \a type).
0427       /// \a empty when empty.
0428       symbol_kind_type kind () const YY_NOEXCEPT;
0429 
0430       /// Backward compatibility (Bison 3.6).
0431       symbol_kind_type type_get () const YY_NOEXCEPT;
0432 
0433       /// The symbol kind.
0434       /// \a S_YYEMPTY when empty.
0435       symbol_kind_type kind_;
0436     };
0437 
0438     /// Backward compatibility for a private implementation detail (Bison 3.6).
0439     typedef by_kind by_type;
0440 
0441     /// "External" symbols: returned by the scanner.
0442     struct symbol_type : basic_symbol<by_kind>
0443     {};
0444 
0445     /// Build a parser object.
0446     parser (step::scanner* scanner_yyarg);
0447     virtual ~parser ();
0448 
0449 #if 201103L <= YY_CPLUSPLUS
0450     /// Non copyable.
0451     parser (const parser&) = delete;
0452     /// Non copyable.
0453     parser& operator= (const parser&) = delete;
0454 #endif
0455 
0456     /// Parse.  An alias for parse ().
0457     /// \returns  0 iff parsing succeeded.
0458     int operator() ();
0459 
0460     /// Parse.
0461     /// \returns  0 iff parsing succeeded.
0462     virtual int parse ();
0463 
0464 #if YYDEBUG
0465     /// The current debugging stream.
0466     std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
0467     /// Set the current debugging stream.
0468     void set_debug_stream (std::ostream &);
0469 
0470     /// Type for debugging levels.
0471     typedef int debug_level_type;
0472     /// The current debugging level.
0473     debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
0474     /// Set the current debugging level.
0475     void set_debug_level (debug_level_type l);
0476 #endif
0477 
0478     /// Report a syntax error.
0479     /// \param msg    a description of the syntax error.
0480     virtual void error (const std::string& msg);
0481 
0482     /// Report a syntax error.
0483     void error (const syntax_error& err);
0484 
0485     /// The user-facing name of the symbol whose (internal) number is
0486     /// YYSYMBOL.  No bounds checking.
0487     static std::string symbol_name (symbol_kind_type yysymbol);
0488 
0489 
0490 
0491     class context
0492     {
0493     public:
0494       context (const parser& yyparser, const symbol_type& yyla);
0495       const symbol_type& lookahead () const { return yyla_; }
0496       symbol_kind_type token () const { return yyla_.kind (); }
0497       /// Put in YYARG at most YYARGN of the expected tokens, and return the
0498       /// number of tokens stored in YYARG.  If YYARG is null, return the
0499       /// number of expected tokens (guaranteed to be less than YYNTOKENS).
0500       int expected_tokens (symbol_kind_type yyarg[], int yyargn) const;
0501 
0502     private:
0503       const parser& yyparser_;
0504       const symbol_type& yyla_;
0505     };
0506 
0507   private:
0508 #if YY_CPLUSPLUS < 201103L
0509     /// Non copyable.
0510     parser (const parser&);
0511     /// Non copyable.
0512     parser& operator= (const parser&);
0513 #endif
0514 
0515 
0516     /// Stored state numbers (used for stacks).
0517     typedef signed char state_type;
0518 
0519     /// The arguments of the error message.
0520     int yy_syntax_error_arguments_ (const context& yyctx,
0521                                     symbol_kind_type yyarg[], int yyargn) const;
0522 
0523     /// Generate an error message.
0524     /// \param yyctx     the context in which the error occurred.
0525     virtual std::string yysyntax_error_ (const context& yyctx) const;
0526     /// Compute post-reduction state.
0527     /// \param yystate   the current state
0528     /// \param yysym     the nonterminal to push on the stack
0529     static state_type yy_lr_goto_state_ (state_type yystate, int yysym);
0530 
0531     /// Whether the given \c yypact_ value indicates a defaulted state.
0532     /// \param yyvalue   the value to check
0533     static bool yy_pact_value_is_default_ (int yyvalue);
0534 
0535     /// Whether the given \c yytable_ value indicates a syntax error.
0536     /// \param yyvalue   the value to check
0537     static bool yy_table_value_is_error_ (int yyvalue);
0538 
0539     static const signed char yypact_ninf_;
0540     static const signed char yytable_ninf_;
0541 
0542     /// Convert a scanner token kind \a t to a symbol kind.
0543     /// In theory \a t should be a token_kind_type, but character literals
0544     /// are valid, yet not members of the token_type enum.
0545     static symbol_kind_type yytranslate_ (int t);
0546 
0547     /// Convert the symbol name \a n to a form suitable for a diagnostic.
0548     static std::string yytnamerr_ (const char *yystr);
0549 
0550     /// For a symbol, its name in clear.
0551     static const char* const yytname_[];
0552 
0553 
0554     // Tables.
0555     // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
0556     // STATE-NUM.
0557     static const signed char yypact_[];
0558 
0559     // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
0560     // Performed when YYTABLE does not specify something else to do.  Zero
0561     // means the default is an error.
0562     static const signed char yydefact_[];
0563 
0564     // YYPGOTO[NTERM-NUM].
0565     static const signed char yypgoto_[];
0566 
0567     // YYDEFGOTO[NTERM-NUM].
0568     static const signed char yydefgoto_[];
0569 
0570     // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
0571     // positive, shift that token.  If negative, reduce the rule whose
0572     // number is the opposite.  If YYTABLE_NINF, syntax error.
0573     static const signed char yytable_[];
0574 
0575     static const signed char yycheck_[];
0576 
0577     // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
0578     // symbol of state STATE-NUM.
0579     static const signed char yystos_[];
0580 
0581     // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
0582     static const signed char yyr1_[];
0583 
0584     // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
0585     static const signed char yyr2_[];
0586 
0587 
0588 #if YYDEBUG
0589     // YYRLINE[YYN] -- Source line where rule number YYN was defined.
0590     static const unsigned char yyrline_[];
0591     /// Report on the debug stream that the rule \a r is going to be reduced.
0592     virtual void yy_reduce_print_ (int r) const;
0593     /// Print the state stack on the debug stream.
0594     virtual void yy_stack_print_ () const;
0595 
0596     /// Debugging level.
0597     int yydebug_;
0598     /// Debug stream.
0599     std::ostream* yycdebug_;
0600 
0601     /// \brief Display a symbol kind, value and location.
0602     /// \param yyo    The output stream.
0603     /// \param yysym  The symbol.
0604     template <typename Base>
0605     void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
0606 #endif
0607 
0608     /// \brief Reclaim the memory associated to a symbol.
0609     /// \param yymsg     Why this token is reclaimed.
0610     ///                  If null, print nothing.
0611     /// \param yysym     The symbol.
0612     template <typename Base>
0613     void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
0614 
0615   private:
0616     /// Type access provider for state based symbols.
0617     struct by_state
0618     {
0619       /// Default constructor.
0620       by_state () YY_NOEXCEPT;
0621 
0622       /// The symbol kind as needed by the constructor.
0623       typedef state_type kind_type;
0624 
0625       /// Constructor.
0626       by_state (kind_type s) YY_NOEXCEPT;
0627 
0628       /// Copy constructor.
0629       by_state (const by_state& that) YY_NOEXCEPT;
0630 
0631       /// Record that this symbol is empty.
0632       void clear () YY_NOEXCEPT;
0633 
0634       /// Steal the symbol kind from \a that.
0635       void move (by_state& that);
0636 
0637       /// The symbol kind (corresponding to \a state).
0638       /// \a symbol_kind::S_YYEMPTY when empty.
0639       symbol_kind_type kind () const YY_NOEXCEPT;
0640 
0641       /// The state number used to denote an empty symbol.
0642       /// We use the initial state, as it does not have a value.
0643       enum { empty_state = 0 };
0644 
0645       /// The state.
0646       /// \a empty when empty.
0647       state_type state;
0648     };
0649 
0650     /// "Internal" symbol: element of the stack.
0651     struct stack_symbol_type : basic_symbol<by_state>
0652     {
0653       /// Superclass.
0654       typedef basic_symbol<by_state> super_type;
0655       /// Construct an empty symbol.
0656       stack_symbol_type ();
0657       /// Move or copy construction.
0658       stack_symbol_type (YY_RVREF (stack_symbol_type) that);
0659       /// Steal the contents from \a sym to build this.
0660       stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
0661 #if YY_CPLUSPLUS < 201103L
0662       /// Assignment, needed by push_back by some old implementations.
0663       /// Moves the contents of that.
0664       stack_symbol_type& operator= (stack_symbol_type& that);
0665 
0666       /// Assignment, needed by push_back by other implementations.
0667       /// Needed by some other old implementations.
0668       stack_symbol_type& operator= (const stack_symbol_type& that);
0669 #endif
0670     };
0671 
0672     /// A stack with random access from its top.
0673     template <typename T, typename S = std::vector<T> >
0674     class stack
0675     {
0676     public:
0677       // Hide our reversed order.
0678       typedef typename S::iterator iterator;
0679       typedef typename S::const_iterator const_iterator;
0680       typedef typename S::size_type size_type;
0681       typedef typename std::ptrdiff_t index_type;
0682 
0683       stack (size_type n = 200)
0684         : seq_ (n)
0685       {}
0686 
0687 #if 201103L <= YY_CPLUSPLUS
0688       /// Non copyable.
0689       stack (const stack&) = delete;
0690       /// Non copyable.
0691       stack& operator= (const stack&) = delete;
0692 #endif
0693 
0694       /// Random access.
0695       ///
0696       /// Index 0 returns the topmost element.
0697       const T&
0698       operator[] (index_type i) const
0699       {
0700         return seq_[size_type (size () - 1 - i)];
0701       }
0702 
0703       /// Random access.
0704       ///
0705       /// Index 0 returns the topmost element.
0706       T&
0707       operator[] (index_type i)
0708       {
0709         return seq_[size_type (size () - 1 - i)];
0710       }
0711 
0712       /// Steal the contents of \a t.
0713       ///
0714       /// Close to move-semantics.
0715       void
0716       push (YY_MOVE_REF (T) t)
0717       {
0718         seq_.push_back (T ());
0719         operator[] (0).move (t);
0720       }
0721 
0722       /// Pop elements from the stack.
0723       void
0724       pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
0725       {
0726         for (; 0 < n; --n)
0727           seq_.pop_back ();
0728       }
0729 
0730       /// Pop all elements from the stack.
0731       void
0732       clear () YY_NOEXCEPT
0733       {
0734         seq_.clear ();
0735       }
0736 
0737       /// Number of elements on the stack.
0738       index_type
0739       size () const YY_NOEXCEPT
0740       {
0741         return index_type (seq_.size ());
0742       }
0743 
0744       /// Iterator on top of the stack (going downwards).
0745       const_iterator
0746       begin () const YY_NOEXCEPT
0747       {
0748         return seq_.begin ();
0749       }
0750 
0751       /// Bottom of the stack.
0752       const_iterator
0753       end () const YY_NOEXCEPT
0754       {
0755         return seq_.end ();
0756       }
0757 
0758       /// Present a slice of the top of a stack.
0759       class slice
0760       {
0761       public:
0762         slice (const stack& stack, index_type range)
0763           : stack_ (stack)
0764           , range_ (range)
0765         {}
0766 
0767         const T&
0768         operator[] (index_type i) const
0769         {
0770           return stack_[range_ - i];
0771         }
0772 
0773       private:
0774         const stack& stack_;
0775         index_type range_;
0776       };
0777 
0778     private:
0779 #if YY_CPLUSPLUS < 201103L
0780       /// Non copyable.
0781       stack (const stack&);
0782       /// Non copyable.
0783       stack& operator= (const stack&);
0784 #endif
0785       /// The wrapped container.
0786       S seq_;
0787     };
0788 
0789 
0790     /// Stack type.
0791     typedef stack<stack_symbol_type> stack_type;
0792 
0793     /// The stack.
0794     stack_type yystack_;
0795 
0796     /// Push a new state on the stack.
0797     /// \param m    a debug message to display
0798     ///             if null, no trace is output.
0799     /// \param sym  the symbol
0800     /// \warning the contents of \a s.value is stolen.
0801     void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym);
0802 
0803     /// Push a new look ahead token on the state on the stack.
0804     /// \param m    a debug message to display
0805     ///             if null, no trace is output.
0806     /// \param s    the state
0807     /// \param sym  the symbol (for its value and location).
0808     /// \warning the contents of \a sym.value is stolen.
0809     void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym);
0810 
0811     /// Pop \a n symbols from the stack.
0812     void yypop_ (int n = 1);
0813 
0814     /// Constants.
0815     enum
0816     {
0817       yylast_ = 82,     ///< Last index in yytable_.
0818       yynnts_ = 27,  ///< Number of nonterminal symbols.
0819       yyfinal_ = 7 ///< Termination state number.
0820     };
0821 
0822 
0823     // User arguments.
0824     step::scanner* scanner;
0825 
0826   };
0827 
0828 
0829 } // step
0830 
0831 
0832 // "%code provides" blocks.
0833 
0834 // Define stepFlexLexer class by inclusion of FlexLexer.h,
0835 // but only if this has not been done yet, to avoid redefinition
0836 #if !defined(yyFlexLexer) && !defined(FlexLexerOnce)
0837 #define yyFlexLexer stepFlexLexer
0838 #include "FlexLexer.h"
0839 #endif
0840 
0841 namespace step {
0842 
0843     // To feed data back to bison, the yylex method needs yylval and
0844     // yylloc parameters. Since the stepFlexLexer class is defined in the
0845     // system header <FlexLexer.h> the signature of its yylex() method
0846     // can not be changed anymore. This makes it necessary to derive a
0847     // scanner class that provides a method with the desired signature:
0848 
0849     class scanner : public stepFlexLexer
0850     {
0851     public:
0852       explicit scanner(StepFile_ReadData* theDataModel, std::istream* in = 0, std::ostream* out = 0);
0853 
0854       int lex(step::parser::semantic_type* yylval);
0855 
0856       StepFile_ReadData* myDataModel;
0857     };
0858 
0859 };
0860 
0861 
0862 
0863 #endif // !YY_STEP_STEPFILE_STEP_TAB_HXX_INCLUDED