152 {
153#line 166 "bison_parser.cpp"
154
156Parser::Parser(class Driver& driver_yyarg)
157#if SLAMPARSERDEBUG
158 : yydebug_(false),
159 yycdebug_(&std::cerr),
160#else
161 :
162#endif
163 driver(driver_yyarg) {
164}
165
166Parser::~Parser() {}
167
169
170
171
172
173
174
175template <typename Base>
176Parser::basic_symbol<Base>::basic_symbol(const basic_symbol& that)
177 : Base(that), value(that.value), location(that.location) {}
178
180template <typename Base>
181Parser::basic_symbol<Base>::basic_symbol(typename Base::kind_type t,
183 : Base(t), value(), location(l) {}
184
185template <typename Base>
186Parser::basic_symbol<Base>::basic_symbol(typename Base::kind_type t,
190
191template <typename Base>
192Parser::symbol_kind_type Parser::basic_symbol<Base>::type_get() const
194 return this->kind();
195}
196
197template <typename Base>
198bool Parser::basic_symbol<Base>::empty() const
YY_NOEXCEPT {
199 return this->kind() == symbol_kind::S_YYEMPTY;
200}
201
202template <typename Base>
203void Parser::basic_symbol<Base>::move(basic_symbol& s) {
204 super_type::move(s);
206 location =
YY_MOVE(s.location);
207}
208
209
210Parser::by_kind::by_kind()
YY_NOEXCEPT : kind_(symbol_kind::S_YYEMPTY) {}
211
212#if 201103L <= YY_CPLUSPLUS
213Parser::by_kind::by_kind(by_kind&& that)
YY_NOEXCEPT : kind_(that.kind_) {
214 that.clear();
215}
216#endif
217
218Parser::by_kind::by_kind(
const by_kind& that)
YY_NOEXCEPT : kind_(that.kind_) {}
219
220Parser::by_kind::by_kind(token_kind_type t)
YY_NOEXCEPT
221 : kind_(yytranslate_(t)) {}
222
223void Parser::by_kind::clear()
YY_NOEXCEPT { kind_ = symbol_kind::S_YYEMPTY; }
224
225void Parser::by_kind::move(by_kind& that) {
226 kind_ = that.kind_;
227 that.clear();
228}
229
230Parser::symbol_kind_type Parser::by_kind::kind() const
YY_NOEXCEPT {
231 return kind_;
232}
233
234Parser::symbol_kind_type Parser::by_kind::type_get() const
YY_NOEXCEPT {
235 return this->kind();
236}
237
238
239Parser::by_state::by_state()
YY_NOEXCEPT : state(empty_state) {}
240
241Parser::by_state::by_state(
const by_state& that)
YY_NOEXCEPT
242 : state(that.state) {}
243
244void Parser::by_state::clear()
YY_NOEXCEPT { state = empty_state; }
245
246void Parser::by_state::move(by_state& that) {
247 state = that.state;
248 that.clear();
249}
250
251Parser::by_state::by_state(state_type s)
YY_NOEXCEPT : state(s) {}
252
253Parser::symbol_kind_type Parser::by_state::kind() const
YY_NOEXCEPT {
254 if (state == empty_state)
255 return symbol_kind::S_YYEMPTY;
256 else
257 return YY_CAST(symbol_kind_type, yystos_[+state]);
258}
259
260Parser::stack_symbol_type::stack_symbol_type() {}
261
262Parser::stack_symbol_type::stack_symbol_type(
YY_RVREF(stack_symbol_type) that)
265#if 201103L <= YY_CPLUSPLUS
266
267 that.state = empty_state;
268#endif
269}
270
271Parser::stack_symbol_type::stack_symbol_type(state_type s,
274
275 that.kind_ = symbol_kind::S_YYEMPTY;
276}
277
278#if YY_CPLUSPLUS < 201103L
279Parser::stack_symbol_type& Parser::stack_symbol_type::operator=(
280 const stack_symbol_type& that) {
281 state = that.state;
282 value = that.value;
283 location = that.location;
284 return *this;
285}
286
287Parser::stack_symbol_type& Parser::stack_symbol_type::operator=(
288 stack_symbol_type& that) {
289 state = that.state;
290 value = that.value;
291 location = that.location;
292
293 that.state = empty_state;
294 return *this;
295}
296#endif
297
298template <typename Base>
299void Parser::yy_destroy_(const char* yymsg, basic_symbol<Base>& yysym) const {
301
302
303 switch (yysym.kind()) {
304 case symbol_kind::S_STRING:
305#line 79 "parser.yy"
306 {
307 delete (yysym.value.stringVal);
308 }
309#line 378 "bison_parser.cpp"
310 break;
311
312 case symbol_kind::S_add_se2:
313#line 80 "parser.yy"
314 {
315 delete (yysym.value.commandNode);
316 }
317#line 384 "bison_parser.cpp"
318 break;
319
320 case symbol_kind::S_add_se3:
321#line 80 "parser.yy"
322 {
323 delete (yysym.value.commandNode);
324 }
325#line 390 "bison_parser.cpp"
326 break;
327
328 case symbol_kind::S_fix_node:
329#line 80 "parser.yy"
330 {
331 delete (yysym.value.commandNode);
332 }
333#line 396 "bison_parser.cpp"
334 break;
335
336 case symbol_kind::S_solve_state:
337#line 80 "parser.yy"
338 {
339 delete (yysym.value.commandNode);
340 }
341#line 402 "bison_parser.cpp"
342 break;
343
344 case symbol_kind::S_query_state:
345#line 80 "parser.yy"
346 {
347 delete (yysym.value.commandNode);
348 }
349#line 408 "bison_parser.cpp"
350 break;
351
352 case symbol_kind::S_command:
353#line 80 "parser.yy"
354 {
355 delete (yysym.value.commandNode);
356 }
357#line 414 "bison_parser.cpp"
358 break;
359
360 default:
361 break;
362 }
363}
364
365#if SLAMPARSERDEBUG
366template <typename Base>
367void Parser::yy_print_(std::ostream& yyo,
368 const basic_symbol<Base>& yysym) const {
369 std::ostream& yyoutput = yyo;
371 if (yysym.empty())
372 yyo << "empty symbol";
373 else {
374 symbol_kind_type yykind = yysym.kind();
375 yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << yysym.name()
376 << " (" << yysym.location << ": ";
378 yyo << ')';
379 }
380}
381#endif
382
383void Parser::yypush_(
const char* m,
YY_MOVE_REF(stack_symbol_type) sym) {
386}
387
388void Parser::yypush_(const char* m, state_type s,
390#if 201103L <= YY_CPLUSPLUS
391 yypush_(m, stack_symbol_type(s, std::move(sym)));
392#else
393 stack_symbol_type ss(s, sym);
394 yypush_(m, ss);
395#endif
396}
397
398void Parser::yypop_(
int n)
YY_NOEXCEPT { yystack_.pop(n); }
399
400#if SLAMPARSERDEBUG
401std::ostream& Parser::debug_stream() const { return *yycdebug_; }
402
403void Parser::set_debug_stream(std::ostream& o) { yycdebug_ = &o; }
404
405Parser::debug_level_type Parser::debug_level() const { return yydebug_; }
406
407void Parser::set_debug_level(debug_level_type l) { yydebug_ = l; }
408#endif
409
410Parser::state_type Parser::yy_lr_goto_state_(state_type yystate, int yysym) {
411 int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
412 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
413 return yytable_[yyr];
414 else
415 return yydefgoto_[yysym - YYNTOKENS];
416}
417
418bool Parser::yy_pact_value_is_default_(
int yyvalue)
YY_NOEXCEPT {
419 return yyvalue == yypact_ninf_;
420}
421
422bool Parser::yy_table_value_is_error_(
int yyvalue)
YY_NOEXCEPT {
423 return yyvalue == yytable_ninf_;
424}
425
426int Parser::operator()() { return parse(); }
427
428int Parser::parse() {
429 int yyn;
431 int yylen = 0;
432
433
434 int yyerrstatus_ = 0;
435
437 symbol_type yyla;
438
440 stack_symbol_type yyerror_range[3];
441
443 int yyresult;
444
445#if YY_EXCEPTIONS
446 try
447#endif
448 {
450
451
452#line 38 "parser.yy"
453 {
454
455 yyla.location.begin.filename = yyla.location.end.filename =
456 &driver.streamname;
457 }
458
459#line 557 "bison_parser.cpp"
460
461
462
463
464
465 yystack_.clear();
467
468
469
470
471 yynewstate:
472 YYCDEBUG <<
"Entering state " << int(yystack_[0].state) <<
'\n';
474
475
476 if (yystack_[0].state == yyfinal_)
YYACCEPT;
477
478 goto yybackup;
479
480
481
482
483 yybackup:
484
485 yyn = yypact_[+yystack_[0].state];
486 if (yy_pact_value_is_default_(yyn)) goto yydefault;
487
488
489 if (yyla.empty()) {
491#if YY_EXCEPTIONS
492 try
493#endif
494 {
495 yyla.kind_ = yytranslate_(
yylex(&yyla.value, &yyla.location));
496 }
497#if YY_EXCEPTIONS
498 catch (const syntax_error& yyexc) {
499 YYCDEBUG <<
"Caught exception: " << yyexc.what() <<
'\n';
500 error(yyexc);
501 goto yyerrlab1;
502 }
503#endif
504 }
506
507 if (yyla.kind() == symbol_kind::S_YYerror) {
508
509
510
511
512 yyla.kind_ = symbol_kind::S_YYUNDEF;
513 goto yyerrlab1;
514 }
515
516
517
518 yyn += yyla.kind();
519 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind()) {
520 goto yydefault;
521 }
522
523
524 yyn = yytable_[yyn];
525 if (yyn <= 0) {
526 if (yy_table_value_is_error_(yyn)) goto yyerrlab;
527 yyn = -yyn;
528 goto yyreduce;
529 }
530
531
532 if (yyerrstatus_) --yyerrstatus_;
533
534
535 yypush_(
"Shifting", state_type(yyn),
YY_MOVE(yyla));
536 goto yynewstate;
537
538
539
540
541 yydefault:
542 yyn = yydefact_[+yystack_[0].state];
543 if (yyn == 0) goto yyerrlab;
544 goto yyreduce;
545
546
547
548
549 yyreduce:
550 yylen = yyr2_[yyn];
551 {
552 stack_symbol_type yylhs;
553 yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
554
555
556
557
558
559
560 if (yylen)
561 yylhs.value = yystack_[yylen - 1].value;
562 else
563 yylhs.value = yystack_[0].value;
564
565
566 {
567 stack_type::slice range(yystack_, yylen);
569 yyerror_range[1].location = yylhs.location;
570 }
571
572
574#if YY_EXCEPTIONS
575 try
576#endif
577 {
578 switch (yyn) {
579 case 2:
580#line 104 "parser.yy"
581 {
582 (yylhs.value.intList) = new std::vector<int>;
583 (yylhs.value.intList)->push_back((yystack_[0].value.integerVal));
584 }
585#line 698 "bison_parser.cpp"
586 break;
587
588 case 3:
589#line 109 "parser.yy"
590 {
591 (yystack_[1].value.intList)
592 ->push_back((yystack_[0].value.integerVal));
593 (yylhs.value.intList) = (yystack_[1].value.intList);
594 }
595#line 707 "bison_parser.cpp"
596 break;
597
598 case 4:
599#line 115 "parser.yy"
600 {
601 (yylhs.value.doubleVal) = (yystack_[0].value.integerVal);
602 }
603#line 715 "bison_parser.cpp"
604 break;
605
606 case 5:
607#line 119 "parser.yy"
608 {
609 (yylhs.value.doubleVal) = (yystack_[0].value.doubleVal);
610 }
611#line 723 "bison_parser.cpp"
612 break;
613
614 case 6:
615#line 124 "parser.yy"
616 {
617 (yylhs.value.commandNode) =
618 new AddNode(*(yystack_[1].value.stringVal),
619 (yystack_[0].value.integerVal), 3);
620 delete (yystack_[1].value.stringVal);
621 }
622#line 732 "bison_parser.cpp"
623 break;
624
625 case 7:
626#line 129 "parser.yy"
627 {
628 std::vector<double> values;
629 values.push_back((yystack_[2].value.doubleVal));
630 values.push_back((yystack_[1].value.doubleVal));
631 values.push_back((yystack_[0].value.doubleVal));
632 (yylhs.value.commandNode) =
633 new AddNode(*(yystack_[4].value.stringVal),
634 (yystack_[3].value.integerVal), 3, values);
635 delete (yystack_[4].value.stringVal);
636 }
637#line 745 "bison_parser.cpp"
638 break;
639
640 case 8:
641
642
643#line 138 "parser.yy"
644 {
645 std::vector<double> values;
646 values.push_back((yystack_[8].value.doubleVal));
647 values.push_back((yystack_[7].value.doubleVal));
648 values.push_back((yystack_[6].value.doubleVal));
649 std::vector<double> information;
650 information.push_back((yystack_[5].value.doubleVal));
651 information.push_back((yystack_[4].value.doubleVal));
652 information.push_back((yystack_[3].value.doubleVal));
653 information.push_back((yystack_[2].value.doubleVal));
654 information.push_back((yystack_[1].value.doubleVal));
655 information.push_back((yystack_[0].value.doubleVal));
656 (yylhs.value.commandNode) = new AddEdge(
657 *(yystack_[12].value.stringVal),
658 (yystack_[11].value.integerVal), values.size(),
659 (yystack_[10].value.integerVal), (yystack_[9].value.integerVal),
660 values, information);
661 delete (yystack_[12].value.stringVal);
662 }
663#line 765 "bison_parser.cpp"
664 break;
665
666 case 9:
667#line 155 "parser.yy"
668 {
669 (yylhs.value.commandNode) =
670 new AddNode(*(yystack_[1].value.stringVal),
671 (yystack_[0].value.integerVal), 6);
672 delete (yystack_[1].value.stringVal);
673 }
674#line 774 "bison_parser.cpp"
675 break;
676
677 case 10:
678
679#line 160 "parser.yy"
680 {
681 (yylhs.value.commandNode) =
682 new AddNode(*(yystack_[7].value.stringVal),
683 (yystack_[6].value.integerVal), 6);
684 delete (yystack_[7].value.stringVal);
685 }
686#line 783 "bison_parser.cpp"
687 break;
688
689 case 11:
690
691
692
693
694#line 165 "parser.yy"
695 {
696 std::vector<double> values;
697 values.push_back((yystack_[26].value.doubleVal));
698 values.push_back((yystack_[25].value.doubleVal));
699 values.push_back((yystack_[24].value.doubleVal));
700 values.push_back((yystack_[23].value.doubleVal));
701 values.push_back((yystack_[22].value.doubleVal));
702 values.push_back((yystack_[21].value.doubleVal));
703 std::vector<double> information;
704 information.push_back((yystack_[20].value.doubleVal));
705 information.push_back((yystack_[19].value.doubleVal));
706 information.push_back((yystack_[18].value.doubleVal));
707 information.push_back((yystack_[17].value.doubleVal));
708 information.push_back((yystack_[16].value.doubleVal));
709 information.push_back((yystack_[15].value.doubleVal));
710 information.push_back((yystack_[14].value.doubleVal));
711 information.push_back((yystack_[13].value.doubleVal));
712 information.push_back((yystack_[12].value.doubleVal));
713 information.push_back((yystack_[11].value.doubleVal));
714 information.push_back((yystack_[10].value.doubleVal));
715 information.push_back((yystack_[9].value.doubleVal));
716 information.push_back((yystack_[8].value.doubleVal));
717 information.push_back((yystack_[7].value.doubleVal));
718 information.push_back((yystack_[6].value.doubleVal));
719 information.push_back((yystack_[5].value.doubleVal));
720 information.push_back((yystack_[4].value.doubleVal));
721 information.push_back((yystack_[3].value.doubleVal));
722 information.push_back((yystack_[2].value.doubleVal));
723 information.push_back((yystack_[1].value.doubleVal));
724 information.push_back((yystack_[0].value.doubleVal));
725 (yylhs.value.commandNode) = new AddEdge(
726 *(yystack_[30].value.stringVal),
727 (yystack_[29].value.integerVal), values.size(),
728 (yystack_[28].value.integerVal),
729 (yystack_[27].value.integerVal), values, information);
730 delete (yystack_[30].value.stringVal);
731 }
732#line 821 "bison_parser.cpp"
733 break;
734
735 case 12:
736#line 200 "parser.yy"
737 {
738 std::vector<int> values;
739 values.push_back((yystack_[0].value.integerVal));
740 (yylhs.value.commandNode) = new FixNode("FIX", values);
741 }
742#line 831 "bison_parser.cpp"
743 break;
744
745 case 13:
746#line 207 "parser.yy"
747 {
748 (yylhs.value.commandNode) = new SolveSate("SOLVE_STATE");
749 }
750#line 839 "bison_parser.cpp"
751 break;
752
753 case 14:
754#line 212 "parser.yy"
755 {
756 (yylhs.value.commandNode) = new QueryState("QUERY_STATE");
757 }
758#line 847 "bison_parser.cpp"
759 break;
760
761 case 15:
762#line 216 "parser.yy"
763 {
764 (yylhs.value.commandNode) =
765 new QueryState("QUERY_STATE", *(yystack_[0].value.intList));
766 delete (yystack_[0].value.intList);
767 }
768#line 856 "bison_parser.cpp"
769 break;
770
771 case 16:
772#line 222 "parser.yy"
773 {
774 (yylhs.value.commandNode) = (yystack_[0].value.commandNode);
775 }
776#line 864 "bison_parser.cpp"
777 break;
778
779 case 17:
780#line 226 "parser.yy"
781 {
782 (yylhs.value.commandNode) = (yystack_[0].value.commandNode);
783 }
784#line 872 "bison_parser.cpp"
785 break;
786
787 case 18:
788#line 230 "parser.yy"
789 {
790 (yylhs.value.commandNode) = (yystack_[0].value.commandNode);
791 }
792#line 880 "bison_parser.cpp"
793 break;
794
795 case 19:
796#line 234 "parser.yy"
797 {
798 (yylhs.value.commandNode) = (yystack_[0].value.commandNode);
799 }
800#line 888 "bison_parser.cpp"
801 break;
802
803 case 20:
804#line 238 "parser.yy"
805 {
806 (yylhs.value.commandNode) = (yystack_[0].value.commandNode);
807 }
808#line 896 "bison_parser.cpp"
809 break;
810
811 case 23:
812#line 245 "parser.yy"
813 {
814 driver.slamContext.process((yystack_[1].value.commandNode));
815 delete (yystack_[1].value.commandNode);
816 }
817#line 905 "bison_parser.cpp"
818 break;
819
820#line 909 "bison_parser.cpp"
821
822 default:
823 break;
824 }
825 }
826#if YY_EXCEPTIONS
827 catch (const syntax_error& yyexc) {
828 YYCDEBUG <<
"Caught exception: " << yyexc.what() <<
'\n';
829 error(yyexc);
831 }
832#endif
834 yypop_(yylen);
835 yylen = 0;
836
837
839 }
840 goto yynewstate;
841
842
843
844
845 yyerrlab:
846
847 if (!yyerrstatus_) {
848 context yyctx(*this, yyla);
849 std::string msg = yysyntax_error_(yyctx);
850 error(yyla.location,
YY_MOVE(msg));
851 }
852
853 yyerror_range[1].location = yyla.location;
854 if (yyerrstatus_ == 3) {
855
856
857
858
859 if (yyla.kind() == symbol_kind::S_YYEOF)
861 else if (!yyla.empty()) {
862 yy_destroy_("Error: discarding", yyla);
863 yyla.clear();
864 }
865 }
866
867
868 goto yyerrlab1;
869
870
871
872
873 yyerrorlab:
874
875
877
878
879
880 yypop_(yylen);
881 yylen = 0;
883 goto yyerrlab1;
884
885
886
887
888 yyerrlab1:
889 yyerrstatus_ = 3;
890
891 for (;;) {
892 yyn = yypact_[+yystack_[0].state];
893 if (!yy_pact_value_is_default_(yyn)) {
894 yyn += symbol_kind::S_YYerror;
895 if (0 <= yyn && yyn <= yylast_ &&
896 yycheck_[yyn] == symbol_kind::S_YYerror) {
897 yyn = yytable_[yyn];
898 if (0 < yyn) break;
899 }
900 }
901
902
903 if (yystack_.size() == 1)
YYABORT;
904
905 yyerror_range[1].location = yystack_[0].location;
906 yy_destroy_("Error: popping", yystack_[0]);
907 yypop_();
909 }
910 {
911 stack_symbol_type error_token;
912
913 yyerror_range[2].location = yyla.location;
915
916
917 error_token.state = state_type(yyn);
918 yypush_(
"Shifting",
YY_MOVE(error_token));
919 }
920 goto yynewstate;
921
922
923
924
925 yyacceptlab:
926 yyresult = 0;
927 goto yyreturn;
928
929
930
931
932 yyabortlab:
933 yyresult = 1;
934 goto yyreturn;
935
936
937
938
939 yyreturn:
940 if (!yyla.empty()) yy_destroy_("Cleanup: discarding lookahead", yyla);
941
942
943
944 yypop_(yylen);
946 while (1 < yystack_.size()) {
947 yy_destroy_("Cleanup: popping", yystack_[0]);
948 yypop_();
949 }
950
951 return yyresult;
952 }
953#if YY_EXCEPTIONS
954 catch (...) {
955 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack\n";
956
957
958 if (!yyla.empty()) yy_destroy_(
YY_NULLPTR, yyla);
959
960 while (1 < yystack_.size()) {
962 yypop_();
963 }
964 throw;
965 }
966#endif
967}
968
969void Parser::error(const syntax_error& yyexc) {
970 error(yyexc.location, yyexc.what());
971}
972
973
974
975
976
977
978std::string Parser::yytnamerr_(const char* yystr) {
979 if (*yystr == '"') {
980 std::string yyr;
981 char const* yyp = yystr;
982
983 for (;;) switch (*++yyp) {
984 case '\'':
985 case ',':
986 goto do_not_strip_quotes;
987
988 case '\\':
989 if (*++yyp != '\\')
990 goto do_not_strip_quotes;
991 else
992 goto append;
993
994 append:
995 default:
996 yyr += *yyp;
997 break;
998
999 case '"':
1000 return yyr;
1001 }
1002 do_not_strip_quotes:;
1003 }
1004
1005 return yystr;
1006}
1007
1008std::string Parser::symbol_name(symbol_kind_type yysymbol) {
1009 return yytnamerr_(yytname_[yysymbol]);
1010}
1011
1012
1013Parser::context::context(const Parser& yyparser, const symbol_type& yyla)
1014 : yyparser_(yyparser), yyla_(yyla) {}
1015
1016int Parser::context::expected_tokens(symbol_kind_type yyarg[],
1017 int yyargn) const {
1018
1019 int yycount = 0;
1020
1021 const int yyn = yypact_[+yyparser_.yystack_[0].state];
1022 if (!yy_pact_value_is_default_(yyn)) {
1023
1024
1025
1026 const int yyxbegin = yyn < 0 ? -yyn : 0;
1027
1028 const int yychecklim = yylast_ - yyn + 1;
1029 const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1030 for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
1031 if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror &&
1032 !yy_table_value_is_error_(yytable_[yyx + yyn])) {
1033 if (!yyarg)
1034 ++yycount;
1035 else if (yycount == yyargn)
1036 return 0;
1037 else
1038 yyarg[yycount++] =
YY_CAST(symbol_kind_type, yyx);
1039 }
1040 }
1041
1042 if (yyarg && yycount == 0 && 0 < yyargn) yyarg[0] = symbol_kind::S_YYEMPTY;
1043 return yycount;
1044}
1045
1046int Parser::yy_syntax_error_arguments_(const context& yyctx,
1047 symbol_kind_type yyarg[],
1048 int yyargn) const {
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074 if (!yyctx.lookahead().empty()) {
1075 if (yyarg) yyarg[0] = yyctx.token();
1076 int yyn = yyctx.expected_tokens(yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1077 return yyn + 1;
1078 }
1079 return 0;
1080}
1081
1082
1083std::string Parser::yysyntax_error_(const context& yyctx) const {
1084
1085 enum { YYARGS_MAX = 5 };
1086
1087 symbol_kind_type yyarg[YYARGS_MAX];
1088 int yycount = yy_syntax_error_arguments_(yyctx, yyarg, YYARGS_MAX);
1089
1091 switch (yycount) {
1092#define YYCASE_(N, S) \
1093 case N: \
1094 yyformat = S; \
1095 break
1096 default:
1098 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1099 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1100 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1101 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1103 5,
1104 YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1105#undef YYCASE_
1106 }
1107
1108 std::string yyres;
1109
1110 std::ptrdiff_t yyi = 0;
1111 for (char const* yyp = yyformat; *yyp; ++yyp)
1112 if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) {
1113 yyres += symbol_name(yyarg[yyi++]);
1114 ++yyp;
1115 } else
1116 yyres += *yyp;
1117 return yyres;
1118}
1119
1120const signed char Parser::yypact_ninf_ = -24;
1121
1122const signed char Parser::yytable_ninf_ = -1;
1123
1124const signed char Parser::yypact_[] = {
1125 -24, 54, -24, -24, -7, 1, -24, 10, -24, -24, -24, -24, -24, 9, 31, 51,
1126 52, 55, -24, -24, 56, -24, 4, 4, 58, 59, -24, -24, -24, 4, 4, 60,
1127 61, 4, 4, 4, 4, -24, 4, 4, 4, 4, 4, 4, 4, 4, 4, -24,
1128 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -24, 4, 4, 4, 4, 4,
1129 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -24};
1130
1131const signed char Parser::yydefact_[] = {
1132 21, 0, 1, 22, 0, 0, 13, 14, 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, 12, 2,
1133 15, 23, 6, 9, 0, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
1134 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,
1135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11};
1136
1137const signed char Parser::yypgoto_[] = {-24, -24, -23, -24, -24,
1138 -24, -24, -24, -24, -24};
1139
1140const signed char Parser::yydefgoto_[] = {0, 20, 29, 8, 9, 10, 11, 12, 13, 1};
1141
1142const signed char Parser::yytable_[] = {
1143 30, 14, 15, 16, 17, 18, 33, 34, 27, 28, 37, 38, 39, 40, 19, 41, 42, 43,
1144 44, 45, 46, 47, 48, 49, 21, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 22,
1145 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
1146 2, 23, 24, 3, 0, 25, 26, 4, 31, 32, 35, 36, 5, 6, 7};
1147
1148const signed char Parser::yycheck_[] = {
1149 23, 8, 9, 10, 11, 4, 29, 30, 4, 5, 33, 34, 35, 36, 4, 38, 39, 40,
1150 41, 42, 43, 44, 45, 46, 15, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 4,
1151 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1152 0, 4, 4, 3, -1, 4, 4, 7, 4, 4, 4, 4, 12, 13, 14};
1153
1154const signed char Parser::yystos_[] = {
1155 0, 25, 0, 3, 7, 12, 13, 14, 19, 20, 21, 22, 23, 24, 8, 9,
1156 10, 11, 4, 4, 17, 15, 4, 4, 4, 4, 4, 4, 5, 18, 18, 4,
1157 4, 18, 18, 4, 4, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1158 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
1159 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18};
1160
1161const signed char Parser::yyr1_[] = {0, 16, 17, 17, 18, 18, 19, 19,
1162 19, 20, 20, 20, 21, 22, 23, 23,
1163 24, 24, 24, 24, 24, 25, 25, 25};
1164
1165const signed char Parser::yyr2_[] = {0, 2, 1, 2, 1, 1, 3, 6, 14, 3, 9, 32,
1166 2, 1, 1, 2, 1, 1, 1, 1, 1, 0, 2, 3};
1167
1168#if SLAMPARSERDEBUG || 1
1169
1170
1171const char* const Parser::yytname_[] = {"\"end of file\"",
1172 "error",
1173 "\"invalid token\"",
1174 "\"end of line\"",
1175 "\"integer\"",
1176 "\"double\"",
1177 "\"string\"",
1178 "\"ADD\"",
1179 "\"Vertex SE2\"",
1180 "\"Vertex SE3\"",
1181 "\"Edge SE2\"",
1182 "\"Edge SE3\"",
1183 "\"Fix\"",
1184 "\"Solve State\"",
1185 "\"Query State\"",
1186 "';'",
1187 "$accept",
1188 "int_list",
1189 "NUMBER",
1190 "add_se2",
1191 "add_se3",
1192 "fix_node",
1193 "solve_state",
1194 "query_state",
1195 "command",
1196 "start",
1198#endif
1199
1200#if SLAMPARSERDEBUG
1201const unsigned char Parser::yyrline_[] = {
1202 0, 103, 103, 108, 114, 118, 123, 128, 137, 154, 159, 164,
1203 199, 206, 211, 215, 221, 225, 229, 233, 237, 242, 243, 244};
1204
1205void Parser::yy_stack_print_() const {
1206 *yycdebug_ << "Stack now";
1207 for (stack_type::const_iterator i = yystack_.begin(), i_end = yystack_.end();
1208 i != i_end; ++i)
1209 *yycdebug_ << ' ' << int(i->state);
1210 *yycdebug_ << '\n';
1211}
1212
1213void Parser::yy_reduce_print_(int yyrule) const {
1214 int yylno = yyrline_[yyrule];
1215 int yynrhs = yyr2_[yyrule];
1216
1217 *yycdebug_ << "Reducing stack by rule " << yyrule - 1 << " (line " << yylno
1218 << "):\n";
1219
1220 for (int yyi = 0; yyi < yynrhs; yyi++)
1221 YY_SYMBOL_PRINT(
" $" << yyi + 1 <<
" =", yystack_[(yynrhs) - (yyi + 1)]);
1222}
1223#endif
1224
1225Parser::symbol_kind_type Parser::yytranslate_(
int t)
YY_NOEXCEPT {
1226
1227
1228 static const signed char translate_table[] = {
1229 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1230 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1231 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1233 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1234 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1235 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1236 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1237 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1239 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1240 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
1241
1242 const int code_max = 269;
1243
1244 if (t <= 0)
1245 return symbol_kind::S_YYEOF;
1246 else if (t <= code_max)
1247 return static_cast<symbol_kind_type>(translate_table[t]);
1248 else
1249 return symbol_kind::S_YYUNDEF;
1250}
1251
1252}
1253#line 1458 "bison_parser.cpp"
1254
1255#line 252 "parser.yy"
1256
1257
1259 const std::string& m) {
1261}
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_REDUCE_PRINT(Rule)
#define YY_SYMBOL_PRINT(Title, Symbol)
#define YY_CAST(Type, Val)
#define YY_MOVE_REF(Type)
void error(const class location &l, const std::string &m)
virtual void error(const location_type &loc, const std::string &msg)