1 // A Bison parser, made by GNU Bison 3.7.4.
3 // Skeleton implementation for Bison LALR(1) parsers in C++
5 // Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 // As a special exception, you may create a larger work that contains
21 // part or all of the Bison parser skeleton and distribute that work
22 // under terms of your choice, so long as that work isn't itself a
23 // parser generator using the skeleton or a modified version thereof
24 // as a parser skeleton. Alternatively, if you modify or redistribute
25 // the parser skeleton itself, you may (at your option) remove this
26 // special exception, which will cause the skeleton and the resulting
27 // Bison output files to be licensed under the GNU General Public
28 // License without this special exception.
30 // This special exception was added by the Free Software Foundation in
31 // version 2.2 of Bison.
33 // DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
34 // especially those whose name start with YY_ or yy_. They are
35 // private implementation details that can be changed or removed.
37 // "%code top" blocks.
39 // This file is part of Open CASCADE Technology software library.
40 // This file is generated, do not modify it directly; edit source file step.yacc instead.
43 // Take the name prefix into account.
48 #include "step.tab.hxx"
51 // Unqualified %code blocks.
54 #define yylex scanner->lex
55 #define StepData scanner->myDataModel
57 // disable MSVC warnings in bison code
59 #pragma warning(disable:4065 4244 4131 4127 4702)
60 #define YYMALLOC malloc
63 void StepFile_Interrupt (Standard_CString theErrorMessage, const Standard_Boolean theIsFail);
68 # if defined YYENABLE_NLS && YYENABLE_NLS
70 # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
71 # define YY_(msgid) dgettext ("bison-runtime", msgid)
75 # define YY_(msgid) msgid
80 // Whether we are compiled with exception support.
82 # if defined __GNUC__ && !defined __EXCEPTIONS
83 # define YY_EXCEPTIONS 0
85 # define YY_EXCEPTIONS 1
91 // Enable debugging if requested.
94 // A pseudo ostream that takes yydebug_ into account.
95 # define YYCDEBUG if (yydebug_) (*yycdebug_)
97 # define YY_SYMBOL_PRINT(Title, Symbol) \
101 *yycdebug_ << Title << ' '; \
102 yy_print_ (*yycdebug_, Symbol); \
103 *yycdebug_ << '\n'; \
107 # define YY_REDUCE_PRINT(Rule) \
110 yy_reduce_print_ (Rule); \
113 # define YY_STACK_PRINT() \
116 yy_stack_print_ (); \
121 # define YYCDEBUG if (false) std::cerr
122 # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
123 # define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
124 # define YY_STACK_PRINT() static_cast<void> (0)
128 #define yyerrok (yyerrstatus_ = 0)
129 #define yyclearin (yyla.clear ())
131 #define YYACCEPT goto yyacceptlab
132 #define YYABORT goto yyabortlab
133 #define YYERROR goto yyerrorlab
134 #define YYRECOVERING() (!!yyerrstatus_)
138 /// Build a parser object.
139 parser::parser (step::scanner* scanner_yyarg)
142 yycdebug_ (&std::cerr),
146 scanner (scanner_yyarg)
152 parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
160 template <typename Base>
161 parser::basic_symbol<Base>::basic_symbol (const basic_symbol& that)
167 /// Constructor for valueless symbols.
168 template <typename Base>
169 parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t)
174 template <typename Base>
175 parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, YY_RVREF (semantic_type) v)
177 , value (YY_MOVE (v))
180 template <typename Base>
181 parser::symbol_kind_type
182 parser::basic_symbol<Base>::type_get () const YY_NOEXCEPT
184 return this->kind ();
187 template <typename Base>
189 parser::basic_symbol<Base>::empty () const YY_NOEXCEPT
191 return this->kind () == symbol_kind::S_YYEMPTY;
194 template <typename Base>
196 parser::basic_symbol<Base>::move (basic_symbol& s)
198 super_type::move (s);
199 value = YY_MOVE (s.value);
203 parser::by_kind::by_kind ()
204 : kind_ (symbol_kind::S_YYEMPTY)
207 #if 201103L <= YY_CPLUSPLUS
208 parser::by_kind::by_kind (by_kind&& that)
215 parser::by_kind::by_kind (const by_kind& that)
219 parser::by_kind::by_kind (token_kind_type t)
220 : kind_ (yytranslate_ (t))
224 parser::by_kind::clear ()
226 kind_ = symbol_kind::S_YYEMPTY;
230 parser::by_kind::move (by_kind& that)
236 parser::symbol_kind_type
237 parser::by_kind::kind () const YY_NOEXCEPT
242 parser::symbol_kind_type
243 parser::by_kind::type_get () const YY_NOEXCEPT
245 return this->kind ();
250 parser::by_state::by_state () YY_NOEXCEPT
251 : state (empty_state)
254 parser::by_state::by_state (const by_state& that) YY_NOEXCEPT
259 parser::by_state::clear () YY_NOEXCEPT
265 parser::by_state::move (by_state& that)
271 parser::by_state::by_state (state_type s) YY_NOEXCEPT
275 parser::symbol_kind_type
276 parser::by_state::kind () const YY_NOEXCEPT
278 if (state == empty_state)
279 return symbol_kind::S_YYEMPTY;
281 return YY_CAST (symbol_kind_type, yystos_[+state]);
284 parser::stack_symbol_type::stack_symbol_type ()
287 parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
288 : super_type (YY_MOVE (that.state), YY_MOVE (that.value))
290 #if 201103L <= YY_CPLUSPLUS
292 that.state = empty_state;
296 parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
297 : super_type (s, YY_MOVE (that.value))
300 that.kind_ = symbol_kind::S_YYEMPTY;
303 #if YY_CPLUSPLUS < 201103L
304 parser::stack_symbol_type&
305 parser::stack_symbol_type::operator= (const stack_symbol_type& that)
312 parser::stack_symbol_type&
313 parser::stack_symbol_type::operator= (stack_symbol_type& that)
318 that.state = empty_state;
323 template <typename Base>
325 parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
328 YY_SYMBOL_PRINT (yymsg, yysym);
331 YYUSE (yysym.kind ());
335 template <typename Base>
337 parser::yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const
339 std::ostream& yyoutput = yyo;
342 yyo << "empty symbol";
345 symbol_kind_type yykind = yysym.kind ();
346 yyo << (yykind < YYNTOKENS ? "token" : "nterm")
347 << ' ' << yysym.name () << " (";
355 parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
358 YY_SYMBOL_PRINT (m, sym);
359 yystack_.push (YY_MOVE (sym));
363 parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
365 #if 201103L <= YY_CPLUSPLUS
366 yypush_ (m, stack_symbol_type (s, std::move (sym)));
368 stack_symbol_type ss (s, sym);
374 parser::yypop_ (int n)
381 parser::debug_stream () const
387 parser::set_debug_stream (std::ostream& o)
393 parser::debug_level_type
394 parser::debug_level () const
400 parser::set_debug_level (debug_level_type l)
407 parser::yy_lr_goto_state_ (state_type yystate, int yysym)
409 int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
410 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
411 return yytable_[yyr];
413 return yydefgoto_[yysym - YYNTOKENS];
417 parser::yy_pact_value_is_default_ (int yyvalue)
419 return yyvalue == yypact_ninf_;
423 parser::yy_table_value_is_error_ (int yyvalue)
425 return yyvalue == yytable_ninf_;
429 parser::operator() ()
438 /// Length of the RHS of the rule being reduced.
443 int yyerrstatus_ = 0;
445 /// The lookahead symbol.
448 /// The return value of parse ().
453 #endif // YY_EXCEPTIONS
455 YYCDEBUG << "Starting parse\n";
458 /* Initialize the stack. The initial state will be set in
459 yynewstate, since the latter expects the semantical and the
460 location values to have been already stored, initialize these
461 stacks with a primary value. */
463 yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
465 /*-----------------------------------------------.
466 | yynewstate -- push a new symbol on the stack. |
467 `-----------------------------------------------*/
469 YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n';
473 if (yystack_[0].state == yyfinal_)
483 // Try to take a decision without lookahead.
484 yyn = yypact_[+yystack_[0].state];
485 if (yy_pact_value_is_default_ (yyn))
488 // Read a lookahead token.
491 YYCDEBUG << "Reading a token\n";
494 #endif // YY_EXCEPTIONS
496 yyla.kind_ = yytranslate_ (yylex (&yyla.value));
499 catch (const syntax_error& yyexc)
501 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
505 #endif // YY_EXCEPTIONS
507 YY_SYMBOL_PRINT ("Next token is", yyla);
509 if (yyla.kind () == symbol_kind::S_YYerror)
511 // The scanner already issued an error message, process directly
512 // to error recovery. But do not keep the error token as
513 // lookahead, it is too special and may lead us to an endless
514 // loop in error recovery. */
515 yyla.kind_ = symbol_kind::S_YYUNDEF;
519 /* If the proper action on seeing token YYLA.TYPE is to reduce or
520 to detect an error, take that action. */
522 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ())
531 if (yy_table_value_is_error_ (yyn))
537 // Count tokens shifted since error; after three, turn off error status.
541 // Shift the lookahead token.
542 yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla));
546 /*-----------------------------------------------------------.
547 | yydefault -- do the default action for the current state. |
548 `-----------------------------------------------------------*/
550 yyn = yydefact_[+yystack_[0].state];
556 /*-----------------------------.
557 | yyreduce -- do a reduction. |
558 `-----------------------------*/
562 stack_symbol_type yylhs;
563 yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
564 /* If YYLEN is nonzero, implement the default value of the
565 action: '$$ = $1'. Otherwise, use the top of the stack.
567 Otherwise, the following line sets YYLHS.VALUE to garbage.
568 This behavior is undocumented and Bison users should not rely
571 yylhs.value = yystack_[yylen - 1].value;
573 yylhs.value = yystack_[0].value;
576 // Perform the reduction.
577 YY_REDUCE_PRINT (yyn);
580 #endif // YY_EXCEPTIONS
584 case 11: // stepf: stepf3
585 { return(0); /* fini pour celui-la */ }
588 case 16: // endhead: DATA
589 { StepData->FinalOfHead(); }
592 case 17: // unarg: IDENT
593 { StepData->SetTypeArg(Interface_ParamIdent); StepData->CreateNewArg(); }
596 case 18: // unarg: QUID
597 { /* deja fait par lex*/ StepData->CreateNewArg(); }
600 case 19: // unarg: listarg
601 { StepData->CreateNewArg(); }
604 case 20: // unarg: listype listarg
605 { StepData->CreateNewArg(); }
608 case 21: // unarg: error
609 { StepData->CreateErrorArg(); }
612 case 22: // listype: TYPE
613 { StepData->RecordTypeText(); }
616 case 23: // deblist: '('
617 { StepData->RecordListStart(); }
620 case 24: // finlist: ')'
621 { if (StepData->GetModePrint() > 0)
622 { printf("Record no : %d -- ", StepData->GetNbRecord()+1); StepData->PrintCurrentRecord(); }
623 StepData->RecordNewEntity (); yyerrstatus_ = 0; }
626 case 39: // debscop: SCOPE
627 { StepData->AddNewScope(); }
630 case 40: // unid: IDENT
631 { StepData->SetTypeArg(Interface_ParamIdent); StepData->CreateNewArg(); }
634 case 43: // debexp: '/'
635 { StepData->RecordListStart(); }
638 case 44: // finscop: ENDSCOPE
639 { StepData->FinalOfScope(); }
642 case 45: // finscop: ENDSCOPE debexp export '/'
643 { printf("*** Warning : Export List not yet processed\n");
644 StepData->RecordNewEntity(); StepData->FinalOfScope() ; }
647 case 46: // entlab: ENTITY
648 { StepData->RecordIdent(); }
651 case 47: // enttype: TYPE
652 { StepData->RecordType (); }
662 catch (const syntax_error& yyexc)
664 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
668 #endif // YY_EXCEPTIONS
669 YY_SYMBOL_PRINT ("-> $$ =", yylhs);
673 // Shift the result of the reduction.
674 yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
679 /*--------------------------------------.
680 | yyerrlab -- here on detecting error. |
681 `--------------------------------------*/
683 // If not already recovering from an error, report this error.
687 context yyctx (*this, yyla);
688 std::string msg = yysyntax_error_ (yyctx);
689 error (YY_MOVE (msg));
693 if (yyerrstatus_ == 3)
695 /* If just tried and failed to reuse lookahead token after an
696 error, discard it. */
698 // Return failure if at end of input.
699 if (yyla.kind () == symbol_kind::S_YYEOF)
701 else if (!yyla.empty ())
703 yy_destroy_ ("Error: discarding", yyla);
708 // Else will try to reuse lookahead token after shifting the error token.
712 /*---------------------------------------------------.
713 | yyerrorlab -- error raised explicitly by YYERROR. |
714 `---------------------------------------------------*/
716 /* Pacify compilers when the user code never invokes YYERROR and
717 the label yyerrorlab therefore never appears in user code. */
721 /* Do not reclaim the symbols of the rule whose action triggered
729 /*-------------------------------------------------------------.
730 | yyerrlab1 -- common code for both syntax error and YYERROR. |
731 `-------------------------------------------------------------*/
733 yyerrstatus_ = 3; // Each real token shifted decrements this.
734 // Pop stack until we find a state that shifts the error token.
737 yyn = yypact_[+yystack_[0].state];
738 if (!yy_pact_value_is_default_ (yyn))
740 yyn += symbol_kind::S_YYerror;
741 if (0 <= yyn && yyn <= yylast_
742 && yycheck_[yyn] == symbol_kind::S_YYerror)
750 // Pop the current state because it cannot handle the error token.
751 if (yystack_.size () == 1)
754 yy_destroy_ ("Error: popping", yystack_[0]);
759 stack_symbol_type error_token;
762 // Shift the error token.
763 error_token.state = state_type (yyn);
764 yypush_ ("Shifting", YY_MOVE (error_token));
769 /*-------------------------------------.
770 | yyacceptlab -- YYACCEPT comes here. |
771 `-------------------------------------*/
777 /*-----------------------------------.
778 | yyabortlab -- YYABORT comes here. |
779 `-----------------------------------*/
785 /*-----------------------------------------------------.
786 | yyreturn -- parsing is finished, return the result. |
787 `-----------------------------------------------------*/
790 yy_destroy_ ("Cleanup: discarding lookahead", yyla);
792 /* Do not reclaim the symbols of the rule whose action triggered
793 this YYABORT or YYACCEPT. */
796 while (1 < yystack_.size ())
798 yy_destroy_ ("Cleanup: popping", yystack_[0]);
807 YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
808 // Do not try to display the values of the reclaimed symbols,
809 // as their printers might throw an exception.
811 yy_destroy_ (YY_NULLPTR, yyla);
813 while (1 < yystack_.size ())
815 yy_destroy_ (YY_NULLPTR, yystack_[0]);
820 #endif // YY_EXCEPTIONS
824 parser::error (const syntax_error& yyexc)
826 error (yyexc.what ());
829 /* Return YYSTR after stripping away unnecessary quotes and
830 backslashes, so that it's suitable for yyerror. The heuristic is
831 that double-quoting is unnecessary unless the string contains an
832 apostrophe, a comma, or backslash (other than backslash-backslash).
833 YYSTR is taken from yytname. */
835 parser::yytnamerr_ (const char *yystr)
840 char const *yyp = yystr;
847 goto do_not_strip_quotes;
851 goto do_not_strip_quotes;
863 do_not_strip_quotes: ;
870 parser::symbol_name (symbol_kind_type yysymbol)
872 return yytnamerr_ (yytname_[yysymbol]);
878 parser::context::context (const parser& yyparser, const symbol_type& yyla)
879 : yyparser_ (yyparser)
884 parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const
886 // Actual number of expected tokens
889 int yyn = yypact_[+yyparser_.yystack_[0].state];
890 if (!yy_pact_value_is_default_ (yyn))
892 /* Start YYX at -YYN if negative to avoid negative indexes in
893 YYCHECK. In other words, skip the first -YYN actions for
894 this state because they are default actions. */
895 int yyxbegin = yyn < 0 ? -yyn : 0;
896 // Stay within bounds of both yycheck and yytname.
897 int yychecklim = yylast_ - yyn + 1;
898 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
899 for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
900 if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror
901 && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
905 else if (yycount == yyargn)
908 yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx);
912 if (yyarg && yycount == 0 && 0 < yyargn)
913 yyarg[0] = symbol_kind::S_YYEMPTY;
920 parser::yy_syntax_error_arguments_ (const context& yyctx,
921 symbol_kind_type yyarg[], int yyargn) const
923 /* There are many possibilities here to consider:
924 - If this state is a consistent state with a default action, then
925 the only way this function was invoked is if the default action
926 is an error action. In that case, don't check for expected
927 tokens because there are none.
928 - The only way there can be no lookahead present (in yyla) is
929 if this state is a consistent state with a default action.
930 Thus, detecting the absence of a lookahead is sufficient to
931 determine that there is no unexpected or expected token to
932 report. In that case, just report a simple "syntax error".
933 - Don't assume there isn't a lookahead just because this state is
934 a consistent state with a default action. There might have
935 been a previous inconsistent state, consistent state with a
936 non-default action, or user semantic action that manipulated
937 yyla. (However, yyla is currently not documented for users.)
938 - Of course, the expected token list depends on states to have
939 correct lookahead information, and it depends on the parser not
940 to perform extra reductions after fetching a lookahead from the
941 scanner and before detecting a syntax error. Thus, state merging
942 (from LALR or IELR) and default reductions corrupt the expected
943 token list. However, the list is correct for canonical LR with
944 one exception: it will still contain any token that will not be
945 accepted due to an error action in a later state.
948 if (!yyctx.lookahead ().empty ())
951 yyarg[0] = yyctx.token ();
952 int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1);
958 // Generate an error message.
960 parser::yysyntax_error_ (const context& yyctx) const
963 enum { YYARGS_MAX = 5 };
964 // Arguments of yyformat.
965 symbol_kind_type yyarg[YYARGS_MAX];
966 int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX);
968 char const* yyformat = YY_NULLPTR;
971 #define YYCASE_(N, S) \
975 default: // Avoid compiler warnings.
976 YYCASE_ (0, YY_("syntax error"));
977 YYCASE_ (1, YY_("syntax error, unexpected %s"));
978 YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s"));
979 YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s"));
980 YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
981 YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
987 std::ptrdiff_t yyi = 0;
988 for (char const* yyp = yyformat; *yyp; ++yyp)
989 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
991 yyres += symbol_name (yyarg[yyi++]);
1000 const signed char parser::yypact_ninf_ = -24;
1002 const signed char parser::yytable_ninf_ = -9;
1007 26, 5, -24, -24, -24, 35, 29, -24, -24, 41,
1008 -24, 43, -24, 36, -24, 45, 41, -24, -24, 3,
1009 38, -24, -24, 40, -24, 32, 45, -24, -24, -24,
1010 -24, -24, -24, 36, -24, -24, 9, -24, 60, 56,
1011 -24, -3, 51, -24, 17, -24, -24, -24, 53, 44,
1012 6, 36, 59, -24, 0, 36, -24, 42, 6, 2,
1013 -24, 47, -24, -24, 36, -24, -24, 55, 2, 49,
1014 -24, 52, -24, -24, -24, -14, 50, -24, -24, 55,
1019 parser::yydefact_[] =
1021 0, 0, 9, 10, 11, 0, 0, 1, 15, 0,
1022 47, 0, 12, 0, 16, 0, 0, 13, 23, 0,
1023 0, 34, 46, 0, 29, 0, 0, 21, 22, 17,
1024 18, 24, 27, 0, 25, 19, 0, 14, 34, 0,
1025 30, 0, 0, 20, 0, 26, 7, 39, 0, 0,
1026 0, 0, 0, 28, 0, 0, 31, 44, 0, 0,
1027 37, 4, 6, 38, 0, 35, 43, 0, 0, 0,
1028 2, 5, 36, 40, 41, 0, 0, 33, 3, 0,
1033 parser::yypgoto_[] =
1035 -24, -24, -24, -24, -24, -24, -24, -24, 62, 58,
1036 31, -24, -24, 46, -13, -24, -23, -21, -24, -6,
1037 -24, -2, -24, -24, 18, -24, -5
1041 parser::yydefgoto_[] =
1043 -1, 71, 62, 2, 3, 4, 5, 11, 12, 15,
1044 32, 33, 19, 34, 35, 36, 23, 24, 54, 49,
1045 50, 74, 75, 67, 59, 25, 51
1049 parser::yytable_[] =
1051 20, 13, 40, 42, 27, 47, 13, 21, 10, 6,
1052 79, 10, 80, 10, 28, 57, 22, 29, 27, 48,
1053 43, 40, 30, 63, 48, 18, 31, 58, 28, 1,
1054 8, 29, 31, 44, 9, 7, 30, 40, 60, 18,
1055 10, 38, 65, 55, 8, 39, 21, 14, 16, 64,
1056 22, 72, 21, 69, 10, 22, 52, 41, 18, 37,
1057 -8, 22, 76, 46, 10, 56, 61, 70, 66, 73,
1058 77, 81, 78, 17, 26, 53, 68, 82, 0, 0,
1063 parser::yycheck_[] =
1065 13, 6, 23, 26, 1, 8, 11, 1, 11, 4,
1066 24, 11, 26, 11, 11, 9, 10, 14, 1, 22,
1067 33, 42, 19, 23, 22, 22, 23, 50, 11, 3,
1068 1, 14, 23, 24, 5, 0, 19, 58, 51, 22,
1069 11, 1, 55, 48, 1, 5, 1, 6, 5, 54,
1070 10, 64, 1, 59, 11, 10, 5, 25, 22, 21,
1071 0, 10, 68, 7, 11, 21, 7, 20, 26, 14,
1072 21, 21, 20, 11, 16, 44, 58, 79, -1, -1,
1079 0, 3, 30, 31, 32, 33, 4, 0, 1, 5,
1080 11, 34, 35, 53, 6, 36, 5, 35, 22, 39,
1081 41, 1, 10, 43, 44, 52, 36, 1, 11, 14,
1082 19, 23, 37, 38, 40, 41, 42, 21, 1, 5,
1083 44, 25, 43, 41, 24, 40, 7, 8, 22, 46,
1084 47, 53, 5, 37, 45, 53, 21, 9, 43, 51,
1085 41, 7, 29, 23, 53, 41, 26, 50, 51, 46,
1086 20, 28, 41, 14, 48, 49, 46, 21, 20, 24,
1093 0, 27, 28, 28, 29, 29, 30, 31, 32, 33,
1094 33, 33, 34, 34, 35, 35, 36, 37, 37, 37,
1095 37, 37, 38, 39, 40, 41, 41, 42, 42, 43,
1096 43, 44, 44, 44, 44, 45, 45, 46, 46, 47,
1097 48, 49, 49, 50, 51, 51, 52, 53
1103 0, 2, 1, 2, 1, 2, 8, 7, 6, 1,
1104 1, 1, 1, 2, 3, 1, 1, 1, 1, 1,
1105 2, 1, 1, 1, 1, 2, 3, 1, 3, 1,
1106 2, 4, 7, 6, 1, 2, 3, 2, 3, 1,
1107 1, 1, 3, 1, 1, 4, 1, 1
1112 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1113 // First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
1115 const parser::yytname_[] =
1117 "\"end of file\"", "error", "\"invalid token\"", "STEP", "HEADER",
1118 "ENDSEC", "DATA", "ENDSTEP", "SCOPE", "ENDSCOPE", "ENTITY", "TYPE",
1119 "INTEGER", "FLOAT", "IDENT", "TEXT", "NONDEF", "ENUM", "HEXA", "QUID",
1120 "' '", "';'", "'('", "')'", "','", "'='", "'/'", "$accept", "finvide",
1121 "finstep", "stepf1", "stepf2", "stepf3", "stepf", "headl", "headent",
1122 "endhead", "unarg", "listype", "deblist", "finlist", "listarg",
1123 "arglist", "model", "bloc", "plex", "unent", "debscop", "unid", "export",
1124 "debexp", "finscop", "entlab", "enttype", YY_NULLPTR
1131 parser::yyrline_[] =
1133 0, 98, 98, 99, 100, 101, 102, 103, 104, 105,
1134 105, 105, 108, 109, 111, 112, 114, 117, 118, 119,
1135 120, 121, 124, 127, 130, 135, 136, 138, 139, 141,
1136 142, 144, 145, 146, 147, 149, 150, 152, 153, 155,
1137 158, 161, 162, 164, 167, 169, 174, 177
1141 parser::yy_stack_print_ () const
1143 *yycdebug_ << "Stack now";
1144 for (stack_type::const_iterator
1145 i = yystack_.begin (),
1146 i_end = yystack_.end ();
1148 *yycdebug_ << ' ' << int (i->state);
1153 parser::yy_reduce_print_ (int yyrule) const
1155 int yylno = yyrline_[yyrule];
1156 int yynrhs = yyr2_[yyrule];
1157 // Print the symbols being reduced, and their result.
1158 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1159 << " (line " << yylno << "):\n";
1160 // The symbols being reduced.
1161 for (int yyi = 0; yyi < yynrhs; yyi++)
1162 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
1163 yystack_[(yynrhs) - (yyi + 1)]);
1167 parser::symbol_kind_type
1168 parser::yytranslate_ (int t)
1170 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
1171 // TOKEN-NUM as returned by yylex.
1176 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1177 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1178 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1179 2, 2, 20, 2, 2, 2, 2, 2, 2, 2,
1180 22, 23, 2, 2, 24, 2, 2, 26, 2, 2,
1181 2, 2, 2, 2, 2, 2, 2, 2, 2, 21,
1182 2, 25, 2, 2, 2, 2, 2, 2, 2, 2,
1183 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1184 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1185 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1186 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1187 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1188 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1189 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1190 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1191 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1192 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1193 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1194 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1195 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1196 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1197 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1198 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1199 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1200 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1201 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1202 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1205 // Last valid token kind.
1206 const int code_max = 274;
1209 return symbol_kind::S_YYEOF;
1210 else if (t <= code_max)
1211 return YY_CAST (symbol_kind_type, translate_table[t]);
1213 return symbol_kind::S_YYUNDEF;
1219 void step::parser::error(const std::string& m)
1222 Standard_Boolean isSyntax = (Standard_Boolean)strncmp(m.c_str(), "syntax error", 13);
1223 if (isSyntax && strlen(m.c_str()) > 13)
1224 sprintf(newmess, "Undefined Parsing: Line %d: %s: %s", scanner->lineno() + 1, "Incorrect syntax", m.c_str() + 14);
1226 sprintf(newmess, "Undefined Parsing: Line %d: Incorrect syntax", scanner->lineno() + 1);
1228 sprintf(newmess, "Undefined Parsing: Line %d: %s", scanner->lineno() + 1, m.c_str());
1230 StepFile_Interrupt(newmess, Standard_False);
1232 StepData->AddError(newmess);