From 0fc1b767826f214475025d8631227970de368de5 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Wed, 7 Nov 2018 23:23:12 +0700 Subject: [PATCH] [#66, !115] Reverted non-needed changes. --- src/bin/agent/agent_parser.cc | 477 ++++++++++++++++------------------ src/bin/agent/agent_parser.h | 44 ++-- src/bin/agent/location.hh | 33 +-- src/bin/agent/position.hh | 33 +-- src/bin/agent/stack.hh | 43 +-- 5 files changed, 311 insertions(+), 319 deletions(-) diff --git a/src/bin/agent/agent_parser.cc b/src/bin/agent/agent_parser.cc index 3523c1b440..4ce4ea98cf 100644 --- a/src/bin/agent/agent_parser.cc +++ b/src/bin/agent/agent_parser.cc @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.0.5. +// A Bison parser, made by GNU Bison 3.0.4. // Skeleton implementation for Bison LALR(1) parsers in C++ -// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. +// Copyright (C) 2002-2015 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 @@ -35,7 +35,7 @@ // First part of user declarations. -#line 39 "agent_parser.cc" // lalr1.cc:406 +#line 39 "agent_parser.cc" // lalr1.cc:404 # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -49,13 +49,13 @@ // User implementation prologue. -#line 53 "agent_parser.cc" // lalr1.cc:414 +#line 53 "agent_parser.cc" // lalr1.cc:412 // Unqualified %code blocks. -#line 33 "agent_parser.yy" // lalr1.cc:415 +#line 33 "agent_parser.yy" // lalr1.cc:413 #include -#line 59 "agent_parser.cc" // lalr1.cc:415 +#line 59 "agent_parser.cc" // lalr1.cc:413 #ifndef YY_ @@ -106,7 +106,7 @@ { \ *yycdebug_ << Title << ' '; \ yy_print_ (*yycdebug_, Symbol); \ - *yycdebug_ << '\n'; \ + *yycdebug_ << std::endl; \ } \ } while (false) @@ -125,9 +125,9 @@ #else // !AGENT_DEBUG # define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol) -# define YY_REDUCE_PRINT(Rule) static_cast (0) -# define YY_STACK_PRINT() static_cast (0) +# define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast(0) +# define YY_STACK_PRINT() static_cast(0) #endif // !AGENT_DEBUG @@ -139,9 +139,9 @@ #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) -#line 14 "agent_parser.yy" // lalr1.cc:481 +#line 14 "agent_parser.yy" // lalr1.cc:479 namespace isc { namespace agent { -#line 145 "agent_parser.cc" // lalr1.cc:481 +#line 145 "agent_parser.cc" // lalr1.cc:479 /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is @@ -202,20 +202,24 @@ namespace isc { namespace agent { // by_state. + inline AgentParser::by_state::by_state () : state (empty_state) {} + inline AgentParser::by_state::by_state (const by_state& other) : state (other.state) {} + inline void AgentParser::by_state::clear () { state = empty_state; } + inline void AgentParser::by_state::move (by_state& that) { @@ -223,10 +227,12 @@ namespace isc { namespace agent { that.clear (); } + inline AgentParser::by_state::by_state (state_type s) : state (s) {} + inline AgentParser::symbol_number_type AgentParser::by_state::type_get () const { @@ -236,46 +242,16 @@ namespace isc { namespace agent { return yystos_[state]; } + inline AgentParser::stack_symbol_type::stack_symbol_type () {} - AgentParser::stack_symbol_type::stack_symbol_type (const stack_symbol_type& that) - : super_type (that.state, that.location) - { - switch (that.type_get ()) - { - case 53: // value - case 56: // map_value - case 107: // socket_type_value - value.copy< ElementPtr > (that.value); - break; - - case 44: // "boolean" - value.copy< bool > (that.value); - break; - - case 43: // "floating point" - value.copy< double > (that.value); - break; - - case 42: // "integer" - value.copy< int64_t > (that.value); - break; - - case 41: // "constant string" - value.copy< std::string > (that.value); - break; - - default: - break; - } - - } + inline AgentParser::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that) : super_type (s, that.location) { - switch (that.type_get ()) + switch (that.type_get ()) { case 53: // value case 56: // map_value @@ -307,11 +283,12 @@ namespace isc { namespace agent { that.type = empty_symbol; } + inline AgentParser::stack_symbol_type& AgentParser::stack_symbol_type::operator= (const stack_symbol_type& that) { state = that.state; - switch (that.type_get ()) + switch (that.type_get ()) { case 53: // value case 56: // map_value @@ -345,6 +322,7 @@ namespace isc { namespace agent { template + inline void AgentParser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const { @@ -372,51 +350,51 @@ namespace isc { namespace agent { { case 41: // "constant string" -#line 103 "agent_parser.yy" // lalr1.cc:635 +#line 103 "agent_parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< std::string > (); } -#line 378 "agent_parser.cc" // lalr1.cc:635 +#line 356 "agent_parser.cc" // lalr1.cc:636 break; case 42: // "integer" -#line 103 "agent_parser.yy" // lalr1.cc:635 +#line 103 "agent_parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< int64_t > (); } -#line 385 "agent_parser.cc" // lalr1.cc:635 +#line 363 "agent_parser.cc" // lalr1.cc:636 break; case 43: // "floating point" -#line 103 "agent_parser.yy" // lalr1.cc:635 +#line 103 "agent_parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< double > (); } -#line 392 "agent_parser.cc" // lalr1.cc:635 +#line 370 "agent_parser.cc" // lalr1.cc:636 break; case 44: // "boolean" -#line 103 "agent_parser.yy" // lalr1.cc:635 +#line 103 "agent_parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< bool > (); } -#line 399 "agent_parser.cc" // lalr1.cc:635 +#line 377 "agent_parser.cc" // lalr1.cc:636 break; case 53: // value -#line 103 "agent_parser.yy" // lalr1.cc:635 +#line 103 "agent_parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< ElementPtr > (); } -#line 406 "agent_parser.cc" // lalr1.cc:635 +#line 384 "agent_parser.cc" // lalr1.cc:636 break; case 56: // map_value -#line 103 "agent_parser.yy" // lalr1.cc:635 +#line 103 "agent_parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< ElementPtr > (); } -#line 413 "agent_parser.cc" // lalr1.cc:635 +#line 391 "agent_parser.cc" // lalr1.cc:636 break; case 107: // socket_type_value -#line 103 "agent_parser.yy" // lalr1.cc:635 +#line 103 "agent_parser.yy" // lalr1.cc:636 { yyoutput << yysym.value.template as< ElementPtr > (); } -#line 420 "agent_parser.cc" // lalr1.cc:635 +#line 398 "agent_parser.cc" // lalr1.cc:636 break; @@ -427,6 +405,7 @@ namespace isc { namespace agent { } #endif + inline void AgentParser::yypush_ (const char* m, state_type s, symbol_type& sym) { @@ -434,6 +413,7 @@ namespace isc { namespace agent { yypush_ (m, t); } + inline void AgentParser::yypush_ (const char* m, stack_symbol_type& s) { @@ -442,8 +422,9 @@ namespace isc { namespace agent { yystack_.push (s); } + inline void - AgentParser::yypop_ (unsigned n) + AgentParser::yypop_ (unsigned int n) { yystack_.pop (n); } @@ -475,7 +456,7 @@ namespace isc { namespace agent { } #endif // AGENT_DEBUG - AgentParser::state_type + inline AgentParser::state_type AgentParser::yy_lr_goto_state_ (state_type yystate, int yysym) { int yyr = yypgoto_[yysym - yyntokens_] + yystate; @@ -485,13 +466,13 @@ namespace isc { namespace agent { return yydefgoto_[yysym - yyntokens_]; } - bool + inline bool AgentParser::yy_pact_value_is_default_ (int yyvalue) { return yyvalue == yypact_ninf_; } - bool + inline bool AgentParser::yy_table_value_is_error_ (int yyvalue) { return yyvalue == yytable_ninf_; @@ -522,7 +503,7 @@ namespace isc { namespace agent { // avoid gratuitous conflicts when merging into the master branch. try { - YYCDEBUG << "Starting parse\n"; + YYCDEBUG << "Starting parse" << std::endl; /* Initialize the stack. The initial state will be set in @@ -534,7 +515,7 @@ namespace isc { namespace agent { // A new symbol was pushed on the stack. yynewstate: - YYCDEBUG << "Entering state " << yystack_[0].state << '\n'; + YYCDEBUG << "Entering state " << yystack_[0].state << std::endl; // Accept? if (yystack_[0].state == yyfinal_) @@ -607,11 +588,11 @@ namespace isc { namespace agent { yylen = yyr2_[yyn]; { stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]); /* Variants are always initialized to an empty instance of the correct type. The default '$$ = $1' action is NOT applied when using variants. */ - switch (yyr1_[yyn]) + switch (yyr1_[yyn]) { case 53: // value case 56: // map_value @@ -640,11 +621,10 @@ namespace isc { namespace agent { } - // Default location. + // Compute the default @$. { slice slice (yystack_, yylen); YYLLOC_DEFAULT (yylhs.location, slice, yylen); - yyerror_range[1].location = yylhs.location; } // Perform the reduction. @@ -654,206 +634,206 @@ namespace isc { namespace agent { switch (yyn) { case 2: -#line 114 "agent_parser.yy" // lalr1.cc:856 +#line 114 "agent_parser.yy" // lalr1.cc:859 { ctx.ctx_ = ctx.NO_KEYWORDS; } -#line 660 "agent_parser.cc" // lalr1.cc:856 +#line 640 "agent_parser.cc" // lalr1.cc:859 break; case 4: -#line 115 "agent_parser.yy" // lalr1.cc:856 +#line 115 "agent_parser.yy" // lalr1.cc:859 { ctx.ctx_ = ctx.CONFIG; } -#line 666 "agent_parser.cc" // lalr1.cc:856 +#line 646 "agent_parser.cc" // lalr1.cc:859 break; case 6: -#line 116 "agent_parser.yy" // lalr1.cc:856 +#line 116 "agent_parser.yy" // lalr1.cc:859 { ctx.ctx_ = ctx.AGENT; } -#line 672 "agent_parser.cc" // lalr1.cc:856 +#line 652 "agent_parser.cc" // lalr1.cc:859 break; case 8: -#line 124 "agent_parser.yy" // lalr1.cc:856 +#line 124 "agent_parser.yy" // lalr1.cc:859 { // Parse the Control-agent map ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.push_back(m); } -#line 682 "agent_parser.cc" // lalr1.cc:856 +#line 662 "agent_parser.cc" // lalr1.cc:859 break; case 9: -#line 128 "agent_parser.yy" // lalr1.cc:856 +#line 128 "agent_parser.yy" // lalr1.cc:859 { // parsing completed } -#line 690 "agent_parser.cc" // lalr1.cc:856 +#line 670 "agent_parser.cc" // lalr1.cc:859 break; case 10: -#line 135 "agent_parser.yy" // lalr1.cc:856 +#line 135 "agent_parser.yy" // lalr1.cc:859 { // Push back the JSON value on the stack ctx.stack_.push_back(yystack_[0].value.as< ElementPtr > ()); } -#line 699 "agent_parser.cc" // lalr1.cc:856 +#line 679 "agent_parser.cc" // lalr1.cc:859 break; case 11: -#line 141 "agent_parser.yy" // lalr1.cc:856 +#line 141 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); } -#line 705 "agent_parser.cc" // lalr1.cc:856 +#line 685 "agent_parser.cc" // lalr1.cc:859 break; case 12: -#line 142 "agent_parser.yy" // lalr1.cc:856 +#line 142 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as< double > (), ctx.loc2pos(yystack_[0].location))); } -#line 711 "agent_parser.cc" // lalr1.cc:856 +#line 691 "agent_parser.cc" // lalr1.cc:859 break; case 13: -#line 143 "agent_parser.yy" // lalr1.cc:856 +#line 143 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); } -#line 717 "agent_parser.cc" // lalr1.cc:856 +#line 697 "agent_parser.cc" // lalr1.cc:859 break; case 14: -#line 144 "agent_parser.yy" // lalr1.cc:856 +#line 144 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); } -#line 723 "agent_parser.cc" // lalr1.cc:856 +#line 703 "agent_parser.cc" // lalr1.cc:859 break; case 15: -#line 145 "agent_parser.yy" // lalr1.cc:856 +#line 145 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); } -#line 729 "agent_parser.cc" // lalr1.cc:856 +#line 709 "agent_parser.cc" // lalr1.cc:859 break; case 16: -#line 146 "agent_parser.yy" // lalr1.cc:856 +#line 146 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } -#line 735 "agent_parser.cc" // lalr1.cc:856 +#line 715 "agent_parser.cc" // lalr1.cc:859 break; case 17: -#line 147 "agent_parser.yy" // lalr1.cc:856 +#line 147 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } -#line 741 "agent_parser.cc" // lalr1.cc:856 +#line 721 "agent_parser.cc" // lalr1.cc:859 break; case 18: -#line 151 "agent_parser.yy" // lalr1.cc:856 +#line 151 "agent_parser.yy" // lalr1.cc:859 { // This code is executed when we're about to start parsing // the content of the map ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.push_back(m); } -#line 752 "agent_parser.cc" // lalr1.cc:856 +#line 732 "agent_parser.cc" // lalr1.cc:859 break; case 19: -#line 156 "agent_parser.yy" // lalr1.cc:856 +#line 156 "agent_parser.yy" // lalr1.cc:859 { // map parsing completed. If we ever want to do any wrap up // (maybe some sanity checking), this would be the best place // for it. } -#line 762 "agent_parser.cc" // lalr1.cc:856 +#line 742 "agent_parser.cc" // lalr1.cc:859 break; case 20: -#line 162 "agent_parser.yy" // lalr1.cc:856 +#line 162 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } -#line 768 "agent_parser.cc" // lalr1.cc:856 +#line 748 "agent_parser.cc" // lalr1.cc:859 break; case 23: -#line 176 "agent_parser.yy" // lalr1.cc:856 +#line 176 "agent_parser.yy" // lalr1.cc:859 { // map containing a single entry ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ()); } -#line 777 "agent_parser.cc" // lalr1.cc:856 +#line 757 "agent_parser.cc" // lalr1.cc:859 break; case 24: -#line 180 "agent_parser.yy" // lalr1.cc:856 +#line 180 "agent_parser.yy" // lalr1.cc:859 { // map consisting of a shorter map followed by // comma and string:value ctx.stack_.back()->set(yystack_[2].value.as< std::string > (), yystack_[0].value.as< ElementPtr > ()); } -#line 787 "agent_parser.cc" // lalr1.cc:856 +#line 767 "agent_parser.cc" // lalr1.cc:859 break; case 25: -#line 187 "agent_parser.yy" // lalr1.cc:856 +#line 187 "agent_parser.yy" // lalr1.cc:859 { ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.push_back(l); } -#line 796 "agent_parser.cc" // lalr1.cc:856 +#line 776 "agent_parser.cc" // lalr1.cc:859 break; case 26: -#line 190 "agent_parser.yy" // lalr1.cc:856 +#line 190 "agent_parser.yy" // lalr1.cc:859 { } -#line 803 "agent_parser.cc" // lalr1.cc:856 +#line 783 "agent_parser.cc" // lalr1.cc:859 break; case 29: -#line 197 "agent_parser.yy" // lalr1.cc:856 +#line 197 "agent_parser.yy" // lalr1.cc:859 { // List consisting of a single element. ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ()); } -#line 812 "agent_parser.cc" // lalr1.cc:856 +#line 792 "agent_parser.cc" // lalr1.cc:859 break; case 30: -#line 201 "agent_parser.yy" // lalr1.cc:856 +#line 201 "agent_parser.yy" // lalr1.cc:859 { // List ending with , and a value. ctx.stack_.back()->add(yystack_[0].value.as< ElementPtr > ()); } -#line 821 "agent_parser.cc" // lalr1.cc:856 +#line 801 "agent_parser.cc" // lalr1.cc:859 break; case 31: -#line 214 "agent_parser.yy" // lalr1.cc:856 +#line 214 "agent_parser.yy" // lalr1.cc:859 { const std::string& where = ctx.contextName(); const std::string& keyword = yystack_[1].value.as< std::string > (); error(yystack_[1].location, "got unexpected keyword \"" + keyword + "\" in " + where + " map."); } -#line 832 "agent_parser.cc" // lalr1.cc:856 +#line 812 "agent_parser.cc" // lalr1.cc:859 break; case 32: -#line 223 "agent_parser.yy" // lalr1.cc:856 +#line 223 "agent_parser.yy" // lalr1.cc:859 { // This code is executed when we're about to start parsing // the content of the map ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.push_back(m); } -#line 843 "agent_parser.cc" // lalr1.cc:856 +#line 823 "agent_parser.cc" // lalr1.cc:859 break; case 33: -#line 228 "agent_parser.yy" // lalr1.cc:856 +#line 228 "agent_parser.yy" // lalr1.cc:859 { // map parsing completed. If we ever want to do any wrap up // (maybe some sanity checking), this would be the best place // for it. } -#line 853 "agent_parser.cc" // lalr1.cc:856 +#line 833 "agent_parser.cc" // lalr1.cc:859 break; case 42: -#line 249 "agent_parser.yy" // lalr1.cc:856 +#line 249 "agent_parser.yy" // lalr1.cc:859 { // Let's create a MapElement that will represent it, add it to the @@ -865,57 +845,57 @@ namespace isc { namespace agent { ctx.stack_.push_back(m); ctx.enter(ctx.AGENT); } -#line 869 "agent_parser.cc" // lalr1.cc:856 +#line 849 "agent_parser.cc" // lalr1.cc:859 break; case 43: -#line 259 "agent_parser.yy" // lalr1.cc:856 +#line 259 "agent_parser.yy" // lalr1.cc:859 { // Ok, we're done with parsing control-agent. Let's take the map // off the stack. ctx.stack_.pop_back(); ctx.leave(); } -#line 880 "agent_parser.cc" // lalr1.cc:856 +#line 860 "agent_parser.cc" // lalr1.cc:859 break; case 53: -#line 281 "agent_parser.yy" // lalr1.cc:856 +#line 281 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 888 "agent_parser.cc" // lalr1.cc:856 +#line 868 "agent_parser.cc" // lalr1.cc:859 break; case 54: -#line 283 "agent_parser.yy" // lalr1.cc:856 +#line 283 "agent_parser.yy" // lalr1.cc:859 { ElementPtr host(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("http-host", host); ctx.leave(); } -#line 898 "agent_parser.cc" // lalr1.cc:856 +#line 878 "agent_parser.cc" // lalr1.cc:859 break; case 55: -#line 289 "agent_parser.yy" // lalr1.cc:856 +#line 289 "agent_parser.yy" // lalr1.cc:859 { ElementPtr prf(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("http-port", prf); } -#line 907 "agent_parser.cc" // lalr1.cc:856 +#line 887 "agent_parser.cc" // lalr1.cc:859 break; case 56: -#line 294 "agent_parser.yy" // lalr1.cc:856 +#line 294 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 915 "agent_parser.cc" // lalr1.cc:856 +#line 895 "agent_parser.cc" // lalr1.cc:859 break; case 57: -#line 296 "agent_parser.yy" // lalr1.cc:856 +#line 296 "agent_parser.yy" // lalr1.cc:859 { ElementPtr parent = ctx.stack_.back(); ElementPtr user_context = yystack_[0].value.as< ElementPtr > (); @@ -938,19 +918,19 @@ namespace isc { namespace agent { parent->set("user-context", user_context); ctx.leave(); } -#line 942 "agent_parser.cc" // lalr1.cc:856 +#line 922 "agent_parser.cc" // lalr1.cc:859 break; case 58: -#line 319 "agent_parser.yy" // lalr1.cc:856 +#line 319 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 950 "agent_parser.cc" // lalr1.cc:856 +#line 930 "agent_parser.cc" // lalr1.cc:859 break; case 59: -#line 321 "agent_parser.yy" // lalr1.cc:856 +#line 321 "agent_parser.yy" // lalr1.cc:859 { ElementPtr parent = ctx.stack_.back(); ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location))); @@ -975,442 +955,442 @@ namespace isc { namespace agent { parent->set("user-context", user_context); ctx.leave(); } -#line 979 "agent_parser.cc" // lalr1.cc:856 +#line 959 "agent_parser.cc" // lalr1.cc:859 break; case 60: -#line 347 "agent_parser.yy" // lalr1.cc:856 +#line 347 "agent_parser.yy" // lalr1.cc:859 { ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("hooks-libraries", l); ctx.stack_.push_back(l); ctx.enter(ctx.HOOKS_LIBRARIES); } -#line 990 "agent_parser.cc" // lalr1.cc:856 +#line 970 "agent_parser.cc" // lalr1.cc:859 break; case 61: -#line 352 "agent_parser.yy" // lalr1.cc:856 +#line 352 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 999 "agent_parser.cc" // lalr1.cc:856 +#line 979 "agent_parser.cc" // lalr1.cc:859 break; case 66: -#line 365 "agent_parser.yy" // lalr1.cc:856 +#line 365 "agent_parser.yy" // lalr1.cc:859 { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->add(m); ctx.stack_.push_back(m); } -#line 1009 "agent_parser.cc" // lalr1.cc:856 +#line 989 "agent_parser.cc" // lalr1.cc:859 break; case 67: -#line 369 "agent_parser.yy" // lalr1.cc:856 +#line 369 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); } -#line 1017 "agent_parser.cc" // lalr1.cc:856 +#line 997 "agent_parser.cc" // lalr1.cc:859 break; case 73: -#line 382 "agent_parser.yy" // lalr1.cc:856 +#line 382 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1025 "agent_parser.cc" // lalr1.cc:856 +#line 1005 "agent_parser.cc" // lalr1.cc:859 break; case 74: -#line 384 "agent_parser.yy" // lalr1.cc:856 +#line 384 "agent_parser.yy" // lalr1.cc:859 { ElementPtr lib(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("library", lib); ctx.leave(); } -#line 1035 "agent_parser.cc" // lalr1.cc:856 +#line 1015 "agent_parser.cc" // lalr1.cc:859 break; case 75: -#line 390 "agent_parser.yy" // lalr1.cc:856 +#line 390 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1043 "agent_parser.cc" // lalr1.cc:856 +#line 1023 "agent_parser.cc" // lalr1.cc:859 break; case 76: -#line 392 "agent_parser.yy" // lalr1.cc:856 +#line 392 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.back()->set("parameters", yystack_[0].value.as< ElementPtr > ()); ctx.leave(); } -#line 1052 "agent_parser.cc" // lalr1.cc:856 +#line 1032 "agent_parser.cc" // lalr1.cc:859 break; case 77: -#line 400 "agent_parser.yy" // lalr1.cc:856 +#line 400 "agent_parser.yy" // lalr1.cc:859 { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location))); ctx.stack_.back()->set("control-sockets", m); ctx.stack_.push_back(m); ctx.enter(ctx.CONTROL_SOCKETS); } -#line 1063 "agent_parser.cc" // lalr1.cc:856 +#line 1043 "agent_parser.cc" // lalr1.cc:859 break; case 78: -#line 405 "agent_parser.yy" // lalr1.cc:856 +#line 405 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 1072 "agent_parser.cc" // lalr1.cc:856 +#line 1052 "agent_parser.cc" // lalr1.cc:859 break; case 85: -#line 426 "agent_parser.yy" // lalr1.cc:856 +#line 426 "agent_parser.yy" // lalr1.cc:859 { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("dhcp4", m); ctx.stack_.push_back(m); ctx.enter(ctx.SERVER); } -#line 1083 "agent_parser.cc" // lalr1.cc:856 +#line 1063 "agent_parser.cc" // lalr1.cc:859 break; case 86: -#line 431 "agent_parser.yy" // lalr1.cc:856 +#line 431 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 1092 "agent_parser.cc" // lalr1.cc:856 +#line 1072 "agent_parser.cc" // lalr1.cc:859 break; case 87: -#line 437 "agent_parser.yy" // lalr1.cc:856 +#line 437 "agent_parser.yy" // lalr1.cc:859 { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("dhcp6", m); ctx.stack_.push_back(m); ctx.enter(ctx.SERVER); } -#line 1103 "agent_parser.cc" // lalr1.cc:856 +#line 1083 "agent_parser.cc" // lalr1.cc:859 break; case 88: -#line 442 "agent_parser.yy" // lalr1.cc:856 +#line 442 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 1112 "agent_parser.cc" // lalr1.cc:856 +#line 1092 "agent_parser.cc" // lalr1.cc:859 break; case 89: -#line 448 "agent_parser.yy" // lalr1.cc:856 +#line 448 "agent_parser.yy" // lalr1.cc:859 { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("d2", m); ctx.stack_.push_back(m); ctx.enter(ctx.SERVER); } -#line 1123 "agent_parser.cc" // lalr1.cc:856 +#line 1103 "agent_parser.cc" // lalr1.cc:859 break; case 90: -#line 453 "agent_parser.yy" // lalr1.cc:856 +#line 453 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 1132 "agent_parser.cc" // lalr1.cc:856 +#line 1112 "agent_parser.cc" // lalr1.cc:859 break; case 98: -#line 472 "agent_parser.yy" // lalr1.cc:856 +#line 472 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1140 "agent_parser.cc" // lalr1.cc:856 +#line 1120 "agent_parser.cc" // lalr1.cc:859 break; case 99: -#line 474 "agent_parser.yy" // lalr1.cc:856 +#line 474 "agent_parser.yy" // lalr1.cc:859 { ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("socket-name", name); ctx.leave(); } -#line 1150 "agent_parser.cc" // lalr1.cc:856 +#line 1130 "agent_parser.cc" // lalr1.cc:859 break; case 100: -#line 481 "agent_parser.yy" // lalr1.cc:856 +#line 481 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.SOCKET_TYPE); } -#line 1158 "agent_parser.cc" // lalr1.cc:856 +#line 1138 "agent_parser.cc" // lalr1.cc:859 break; case 101: -#line 483 "agent_parser.yy" // lalr1.cc:856 +#line 483 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.back()->set("socket-type", yystack_[0].value.as< ElementPtr > ()); ctx.leave(); } -#line 1167 "agent_parser.cc" // lalr1.cc:856 +#line 1147 "agent_parser.cc" // lalr1.cc:859 break; case 102: -#line 489 "agent_parser.yy" // lalr1.cc:856 +#line 489 "agent_parser.yy" // lalr1.cc:859 { yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); } -#line 1173 "agent_parser.cc" // lalr1.cc:856 +#line 1153 "agent_parser.cc" // lalr1.cc:859 break; case 103: -#line 495 "agent_parser.yy" // lalr1.cc:856 +#line 495 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1181 "agent_parser.cc" // lalr1.cc:856 +#line 1161 "agent_parser.cc" // lalr1.cc:859 break; case 104: -#line 497 "agent_parser.yy" // lalr1.cc:856 +#line 497 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.back()->set("Dhcp4", yystack_[0].value.as< ElementPtr > ()); ctx.leave(); } -#line 1190 "agent_parser.cc" // lalr1.cc:856 +#line 1170 "agent_parser.cc" // lalr1.cc:859 break; case 105: -#line 502 "agent_parser.yy" // lalr1.cc:856 +#line 502 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1198 "agent_parser.cc" // lalr1.cc:856 +#line 1178 "agent_parser.cc" // lalr1.cc:859 break; case 106: -#line 504 "agent_parser.yy" // lalr1.cc:856 +#line 504 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.back()->set("Dhcp6", yystack_[0].value.as< ElementPtr > ()); ctx.leave(); } -#line 1207 "agent_parser.cc" // lalr1.cc:856 +#line 1187 "agent_parser.cc" // lalr1.cc:859 break; case 107: -#line 509 "agent_parser.yy" // lalr1.cc:856 +#line 509 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1215 "agent_parser.cc" // lalr1.cc:856 +#line 1195 "agent_parser.cc" // lalr1.cc:859 break; case 108: -#line 511 "agent_parser.yy" // lalr1.cc:856 +#line 511 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.back()->set("DhcpDdns", yystack_[0].value.as< ElementPtr > ()); ctx.leave(); } -#line 1224 "agent_parser.cc" // lalr1.cc:856 +#line 1204 "agent_parser.cc" // lalr1.cc:859 break; case 109: -#line 521 "agent_parser.yy" // lalr1.cc:856 +#line 521 "agent_parser.yy" // lalr1.cc:859 { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("Logging", m); ctx.stack_.push_back(m); ctx.enter(ctx.LOGGING); } -#line 1235 "agent_parser.cc" // lalr1.cc:856 +#line 1215 "agent_parser.cc" // lalr1.cc:859 break; case 110: -#line 526 "agent_parser.yy" // lalr1.cc:856 +#line 526 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 1244 "agent_parser.cc" // lalr1.cc:856 +#line 1224 "agent_parser.cc" // lalr1.cc:859 break; case 114: -#line 543 "agent_parser.yy" // lalr1.cc:856 +#line 543 "agent_parser.yy" // lalr1.cc:859 { ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("loggers", l); ctx.stack_.push_back(l); ctx.enter(ctx.LOGGERS); } -#line 1255 "agent_parser.cc" // lalr1.cc:856 +#line 1235 "agent_parser.cc" // lalr1.cc:859 break; case 115: -#line 548 "agent_parser.yy" // lalr1.cc:856 +#line 548 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 1264 "agent_parser.cc" // lalr1.cc:856 +#line 1244 "agent_parser.cc" // lalr1.cc:859 break; case 118: -#line 560 "agent_parser.yy" // lalr1.cc:856 +#line 560 "agent_parser.yy" // lalr1.cc:859 { ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->add(l); ctx.stack_.push_back(l); } -#line 1274 "agent_parser.cc" // lalr1.cc:856 +#line 1254 "agent_parser.cc" // lalr1.cc:859 break; case 119: -#line 564 "agent_parser.yy" // lalr1.cc:856 +#line 564 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); } -#line 1282 "agent_parser.cc" // lalr1.cc:856 +#line 1262 "agent_parser.cc" // lalr1.cc:859 break; case 129: -#line 581 "agent_parser.yy" // lalr1.cc:856 +#line 581 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1290 "agent_parser.cc" // lalr1.cc:856 +#line 1270 "agent_parser.cc" // lalr1.cc:859 break; case 130: -#line 583 "agent_parser.yy" // lalr1.cc:856 +#line 583 "agent_parser.yy" // lalr1.cc:859 { ElementPtr name(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("name", name); ctx.leave(); } -#line 1300 "agent_parser.cc" // lalr1.cc:856 +#line 1280 "agent_parser.cc" // lalr1.cc:859 break; case 131: -#line 589 "agent_parser.yy" // lalr1.cc:856 +#line 589 "agent_parser.yy" // lalr1.cc:859 { ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("debuglevel", dl); } -#line 1309 "agent_parser.cc" // lalr1.cc:856 +#line 1289 "agent_parser.cc" // lalr1.cc:859 break; case 132: -#line 594 "agent_parser.yy" // lalr1.cc:856 +#line 594 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1317 "agent_parser.cc" // lalr1.cc:856 +#line 1297 "agent_parser.cc" // lalr1.cc:859 break; case 133: -#line 596 "agent_parser.yy" // lalr1.cc:856 +#line 596 "agent_parser.yy" // lalr1.cc:859 { ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("severity", sev); ctx.leave(); } -#line 1327 "agent_parser.cc" // lalr1.cc:856 +#line 1307 "agent_parser.cc" // lalr1.cc:859 break; case 134: -#line 602 "agent_parser.yy" // lalr1.cc:856 +#line 602 "agent_parser.yy" // lalr1.cc:859 { ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("output_options", l); ctx.stack_.push_back(l); ctx.enter(ctx.OUTPUT_OPTIONS); } -#line 1338 "agent_parser.cc" // lalr1.cc:856 +#line 1318 "agent_parser.cc" // lalr1.cc:859 break; case 135: -#line 607 "agent_parser.yy" // lalr1.cc:856 +#line 607 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); ctx.leave(); } -#line 1347 "agent_parser.cc" // lalr1.cc:856 +#line 1327 "agent_parser.cc" // lalr1.cc:859 break; case 138: -#line 616 "agent_parser.yy" // lalr1.cc:856 +#line 616 "agent_parser.yy" // lalr1.cc:859 { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->add(m); ctx.stack_.push_back(m); } -#line 1357 "agent_parser.cc" // lalr1.cc:856 +#line 1337 "agent_parser.cc" // lalr1.cc:859 break; case 139: -#line 620 "agent_parser.yy" // lalr1.cc:856 +#line 620 "agent_parser.yy" // lalr1.cc:859 { ctx.stack_.pop_back(); } -#line 1365 "agent_parser.cc" // lalr1.cc:856 +#line 1345 "agent_parser.cc" // lalr1.cc:859 break; case 146: -#line 634 "agent_parser.yy" // lalr1.cc:856 +#line 634 "agent_parser.yy" // lalr1.cc:859 { ctx.enter(ctx.NO_KEYWORDS); } -#line 1373 "agent_parser.cc" // lalr1.cc:856 +#line 1353 "agent_parser.cc" // lalr1.cc:859 break; case 147: -#line 636 "agent_parser.yy" // lalr1.cc:856 +#line 636 "agent_parser.yy" // lalr1.cc:859 { ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("output", sev); ctx.leave(); } -#line 1383 "agent_parser.cc" // lalr1.cc:856 +#line 1363 "agent_parser.cc" // lalr1.cc:859 break; case 148: -#line 642 "agent_parser.yy" // lalr1.cc:856 +#line 642 "agent_parser.yy" // lalr1.cc:859 { ElementPtr flush(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("flush", flush); } -#line 1392 "agent_parser.cc" // lalr1.cc:856 +#line 1372 "agent_parser.cc" // lalr1.cc:859 break; case 149: -#line 647 "agent_parser.yy" // lalr1.cc:856 +#line 647 "agent_parser.yy" // lalr1.cc:859 { ElementPtr maxsize(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("maxsize", maxsize); } -#line 1401 "agent_parser.cc" // lalr1.cc:856 +#line 1381 "agent_parser.cc" // lalr1.cc:859 break; case 150: -#line 652 "agent_parser.yy" // lalr1.cc:856 +#line 652 "agent_parser.yy" // lalr1.cc:859 { ElementPtr maxver(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("maxver", maxver); } -#line 1410 "agent_parser.cc" // lalr1.cc:856 +#line 1390 "agent_parser.cc" // lalr1.cc:859 break; -#line 1414 "agent_parser.cc" // lalr1.cc:856 +#line 1394 "agent_parser.cc" // lalr1.cc:859 default: break; } @@ -1472,6 +1452,7 @@ namespace isc { namespace agent { code. */ if (false) goto yyerrorlab; + yyerror_range[1].location = yystack_[yylen - 1].location; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ yypop_ (yylen); @@ -1545,7 +1526,8 @@ namespace isc { namespace agent { } catch (...) { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + YYCDEBUG << "Exception caught: cleaning lookahead and stack" + << std::endl; // Do not try to display the values of the reclaimed symbols, // as their printer might throw an exception. if (!yyla.empty ()) @@ -1563,7 +1545,7 @@ namespace isc { namespace agent { void AgentParser::error (const syntax_error& yyexc) { - error (yyexc.location, yyexc.what ()); + error (yyexc.location, yyexc.what()); } // Generate an error message. @@ -1639,13 +1621,12 @@ namespace isc { namespace agent { case N: \ yyformat = S; \ break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ } @@ -1955,18 +1936,18 @@ namespace isc { namespace agent { i_end = yystack_.end (); i != i_end; ++i) *yycdebug_ << ' ' << i->state; - *yycdebug_ << '\n'; + *yycdebug_ << std::endl; } // Report on the debug stream that the rule \a yyrule is going to be reduced. void AgentParser::yy_reduce_print_ (int yyrule) { - unsigned yylno = yyrline_[yyrule]; + unsigned int yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; // Print the symbols being reduced, and their result. *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):\n"; + << " (line " << yylno << "):" << std::endl; // The symbols being reduced. for (int yyi = 0; yyi < yynrhs; yyi++) YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", @@ -1975,10 +1956,10 @@ namespace isc { namespace agent { #endif // AGENT_DEBUG -#line 14 "agent_parser.yy" // lalr1.cc:1163 +#line 14 "agent_parser.yy" // lalr1.cc:1167 } } // isc::agent -#line 1981 "agent_parser.cc" // lalr1.cc:1163 -#line 657 "agent_parser.yy" // lalr1.cc:1164 +#line 1962 "agent_parser.cc" // lalr1.cc:1167 +#line 657 "agent_parser.yy" // lalr1.cc:1168 void diff --git a/src/bin/agent/agent_parser.h b/src/bin/agent/agent_parser.h index 3349b3b157..921e5ea1a0 100644 --- a/src/bin/agent/agent_parser.h +++ b/src/bin/agent/agent_parser.h @@ -1,8 +1,8 @@ -// A Bison parser, made by GNU Bison 3.0.5. +// A Bison parser, made by GNU Bison 3.0.4. // Skeleton interface for Bison LALR(1) parsers in C++ -// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. +// Copyright (C) 2002-2015 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 @@ -40,7 +40,7 @@ #ifndef YY_AGENT_AGENT_PARSER_H_INCLUDED # define YY_AGENT_AGENT_PARSER_H_INCLUDED // // "%code requires" blocks. -#line 17 "agent_parser.yy" // lalr1.cc:379 +#line 17 "agent_parser.yy" // lalr1.cc:377 #include #include @@ -51,7 +51,7 @@ using namespace isc::agent; using namespace isc::data; using namespace std; -#line 55 "agent_parser.h" // lalr1.cc:379 +#line 55 "agent_parser.h" // lalr1.cc:377 # include # include // std::abort @@ -134,9 +134,9 @@ using namespace std; # endif /* ! defined YYDEBUG */ #endif /* ! defined AGENT_DEBUG */ -#line 14 "agent_parser.yy" // lalr1.cc:379 +#line 14 "agent_parser.yy" // lalr1.cc:377 namespace isc { namespace agent { -#line 140 "agent_parser.h" // lalr1.cc:379 +#line 140 "agent_parser.h" // lalr1.cc:377 @@ -841,8 +841,6 @@ namespace isc { namespace agent { typedef basic_symbol super_type; /// Construct an empty symbol. stack_symbol_type (); - /// Copy construct. - stack_symbol_type (const stack_symbol_type& that); /// Steal the contents from \a sym to build this. stack_symbol_type (state_type s, symbol_type& sym); /// Assignment, needed by push_back. @@ -871,7 +869,7 @@ namespace isc { namespace agent { void yypush_ (const char* m, state_type s, symbol_type& sym); /// Pop \a n symbols the three stacks. - void yypop_ (unsigned n = 1); + void yypop_ (unsigned int n = 1); /// Constants. enum @@ -930,12 +928,12 @@ namespace isc { namespace agent { 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 }; - const unsigned user_token_number_max_ = 299; + const unsigned int user_token_number_max_ = 299; const token_number_type undef_token_ = 2; - if (static_cast (t) <= yyeof_) + if (static_cast(t) <= yyeof_) return yyeof_; - else if (static_cast (t) <= user_token_number_max_) + else if (static_cast (t) <= user_token_number_max_) return translate_table[t]; else return undef_token_; @@ -949,17 +947,19 @@ namespace isc { namespace agent { // basic_symbol. template + inline AgentParser::basic_symbol::basic_symbol () : value () {} template + inline AgentParser::basic_symbol::basic_symbol (const basic_symbol& other) : Base (other) , value () , location (other.location) { - switch (other.type_get ()) + switch (other.type_get ()) { case 53: // value case 56: // map_value @@ -989,14 +989,16 @@ namespace isc { namespace agent { } + template + inline AgentParser::basic_symbol::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l) : Base (t) , value () , location (l) { (void) v; - switch (this->type_get ()) + switch (this->type_get ()) { case 53: // value case 56: // map_value @@ -1072,12 +1074,14 @@ namespace isc { namespace agent { template + inline AgentParser::basic_symbol::~basic_symbol () { clear (); } template + inline void AgentParser::basic_symbol::clear () { @@ -1092,7 +1096,7 @@ namespace isc { namespace agent { } // Type destructor. - switch (yytype) + switch (yytype) { case 53: // value case 56: // map_value @@ -1124,6 +1128,7 @@ namespace isc { namespace agent { } template + inline bool AgentParser::basic_symbol::empty () const { @@ -1131,11 +1136,12 @@ namespace isc { namespace agent { } template + inline void AgentParser::basic_symbol::move (basic_symbol& s) { - super_type::move (s); - switch (this->type_get ()) + super_type::move(s); + switch (this->type_get ()) { case 53: // value case 56: // map_value @@ -1482,9 +1488,9 @@ namespace isc { namespace agent { } -#line 14 "agent_parser.yy" // lalr1.cc:379 +#line 14 "agent_parser.yy" // lalr1.cc:377 } } // isc::agent -#line 1488 "agent_parser.h" // lalr1.cc:379 +#line 1494 "agent_parser.h" // lalr1.cc:377 diff --git a/src/bin/agent/location.hh b/src/bin/agent/location.hh index 36ce68021d..c978ea584a 100644 --- a/src/bin/agent/location.hh +++ b/src/bin/agent/location.hh @@ -1,9 +1,9 @@ -// Generated 201811071038 -// A Bison parser, made by GNU Bison 3.0.5. +// Generated 201804111444 +// A Bison parser, made by GNU Bison 3.0.4. // Locations for Bison parsers in C++ -// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. +// Copyright (C) 2002-2015 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 @@ -41,9 +41,9 @@ # include "position.hh" -#line 14 "agent_parser.yy" // location.cc:292 +#line 14 "agent_parser.yy" // location.cc:296 namespace isc { namespace agent { -#line 46 "location.hh" // location.cc:292 +#line 46 "location.hh" // location.cc:296 /// Abstract a location. class location { @@ -53,27 +53,30 @@ namespace isc { namespace agent { location (const position& b, const position& e) : begin (b) , end (e) - {} + { + } /// Construct a 0-width location in \a p. explicit location (const position& p = position ()) : begin (p) , end (p) - {} + { + } /// Construct a 0-width location in \a f, \a l, \a c. explicit location (std::string* f, - unsigned l = 1u, - unsigned c = 1u) + unsigned int l = 1u, + unsigned int c = 1u) : begin (f, l, c) , end (f, l, c) - {} + { + } /// Initialization. void initialize (std::string* f = YY_NULLPTR, - unsigned l = 1u, - unsigned c = 1u) + unsigned int l = 1u, + unsigned int c = 1u) { begin.initialize (f, l, c); end = begin; @@ -171,7 +174,7 @@ namespace isc { namespace agent { inline std::basic_ostream& operator<< (std::basic_ostream& ostr, const location& loc) { - unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; + unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; ostr << loc.begin; if (loc.end.filename && (!loc.begin.filename @@ -184,7 +187,7 @@ namespace isc { namespace agent { return ostr; } -#line 14 "agent_parser.yy" // location.cc:292 +#line 14 "agent_parser.yy" // location.cc:296 } } // isc::agent -#line 189 "location.hh" // location.cc:292 +#line 192 "location.hh" // location.cc:296 #endif // !YY_AGENT_LOCATION_HH_INCLUDED diff --git a/src/bin/agent/position.hh b/src/bin/agent/position.hh index 319845bd9e..4678102783 100644 --- a/src/bin/agent/position.hh +++ b/src/bin/agent/position.hh @@ -1,9 +1,9 @@ -// Generated 201811071038 -// A Bison parser, made by GNU Bison 3.0.5. +// Generated 201804111444 +// A Bison parser, made by GNU Bison 3.0.4. // Positions for Bison parsers in C++ -// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. +// Copyright (C) 2002-2015 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 @@ -51,27 +51,28 @@ # endif # endif -#line 14 "agent_parser.yy" // location.cc:292 +#line 14 "agent_parser.yy" // location.cc:296 namespace isc { namespace agent { -#line 56 "position.hh" // location.cc:292 +#line 56 "position.hh" // location.cc:296 /// Abstract a position. class position { public: /// Construct a position. explicit position (std::string* f = YY_NULLPTR, - unsigned l = 1u, - unsigned c = 1u) + unsigned int l = 1u, + unsigned int c = 1u) : filename (f) , line (l) , column (c) - {} + { + } /// Initialization. void initialize (std::string* fn = YY_NULLPTR, - unsigned l = 1u, - unsigned c = 1u) + unsigned int l = 1u, + unsigned int c = 1u) { filename = fn; line = l; @@ -100,15 +101,15 @@ namespace isc { namespace agent { /// File name to which this position refers. std::string* filename; /// Current line number. - unsigned line; + unsigned int line; /// Current column number. - unsigned column; + unsigned int column; private: /// Compute max(min, lhs+rhs) (provided min <= lhs). - static unsigned add_ (unsigned lhs, int rhs, unsigned min) + static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min) { - return (0 < rhs || -static_cast(rhs) < lhs + return (0 < rhs || -static_cast(rhs) < lhs ? rhs + lhs : min); } @@ -174,7 +175,7 @@ namespace isc { namespace agent { return ostr << pos.line << '.' << pos.column; } -#line 14 "agent_parser.yy" // location.cc:292 +#line 14 "agent_parser.yy" // location.cc:296 } } // isc::agent -#line 179 "position.hh" // location.cc:292 +#line 180 "position.hh" // location.cc:296 #endif // !YY_AGENT_POSITION_HH_INCLUDED diff --git a/src/bin/agent/stack.hh b/src/bin/agent/stack.hh index 30c4cf934b..efca5678c7 100644 --- a/src/bin/agent/stack.hh +++ b/src/bin/agent/stack.hh @@ -1,9 +1,9 @@ -// Generated 201811071038 -// A Bison parser, made by GNU Bison 3.0.5. +// Generated 201804111444 +// A Bison parser, made by GNU Bison 3.0.4. // Stack handling for Bison parsers in C++ -// Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc. +// Copyright (C) 2002-2015 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 @@ -41,10 +41,9 @@ # include -#line 14 "agent_parser.yy" // stack.hh:131 +#line 14 "agent_parser.yy" // stack.hh:132 namespace isc { namespace agent { -#line 46 "stack.hh" // stack.hh:131 - /// A stack with random access from its top. +#line 46 "stack.hh" // stack.hh:132 template > class stack { @@ -59,24 +58,20 @@ namespace isc { namespace agent { seq_.reserve (200); } - stack (unsigned n) + stack (unsigned int n) : seq_ (n) {} - /// Random access. - /// - /// Index 0 returns the topmost element. + inline T& - operator[] (unsigned i) + operator[] (unsigned int i) { return seq_[seq_.size () - 1 - i]; } - /// Random access. - /// - /// Index 0 returns the topmost element. + inline const T& - operator[] (unsigned i) const + operator[] (unsigned int i) const { return seq_[seq_.size () - 1 - i]; } @@ -84,6 +79,7 @@ namespace isc { namespace agent { /// Steal the contents of \a t. /// /// Close to move-semantics. + inline void push (T& t) { @@ -91,8 +87,9 @@ namespace isc { namespace agent { operator[](0).move (t); } + inline void - pop (unsigned n = 1) + pop (unsigned int n = 1) { for (; n; --n) seq_.pop_back (); @@ -104,18 +101,21 @@ namespace isc { namespace agent { seq_.clear (); } + inline typename S::size_type size () const { return seq_.size (); } + inline const_iterator begin () const { return seq_.rbegin (); } + inline const_iterator end () const { @@ -134,24 +134,25 @@ namespace isc { namespace agent { class slice { public: - slice (const S& stack, unsigned range) + slice (const S& stack, unsigned int range) : stack_ (stack) , range_ (range) {} + inline const T& - operator [] (unsigned i) const + operator [] (unsigned int i) const { return stack_[range_ - i]; } private: const S& stack_; - unsigned range_; + unsigned int range_; }; -#line 14 "agent_parser.yy" // stack.hh:131 +#line 14 "agent_parser.yy" // stack.hh:132 } } // isc::agent -#line 155 "stack.hh" // stack.hh:131 +#line 156 "stack.hh" // stack.hh:132 #endif // !YY_AGENT_STACK_HH_INCLUDED