From: Tomek Mrugalski Date: Tue, 18 Apr 2017 19:37:20 +0000 (+0200) Subject: [5187] flush, maxsize and maxver parameters added to all parsers. X-Git-Tag: trac5243x_base~15^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa9452997ce7850dfbaa18a2a96709ded3a18d40;p=thirdparty%2Fkea.git [5187] flush, maxsize and maxver parameters added to all parsers. --- diff --git a/src/bin/agent/agent_lexer.ll b/src/bin/agent/agent_lexer.ll index 113ebdffaf..8fa65374c2 100644 --- a/src/bin/agent/agent_lexer.ll +++ b/src/bin/agent/agent_lexer.ll @@ -329,6 +329,33 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence} } } +\"flush\" { + switch(driver.ctx_) { + case ParserContext::OUTPUT_OPTIONS: + return AgentParser::make_FLUSH(driver.loc_); + default: + return AgentParser::make_STRING("flush", driver.loc_); + } +} + +\"maxsize\" { + switch(driver.ctx_) { + case ParserContext::OUTPUT_OPTIONS: + return AgentParser::make_MAXSIZE(driver.loc_); + default: + return AgentParser::make_STRING("maxsize", driver.loc_); + } +} + +\"maxver\" { + switch(driver.ctx_) { + case ParserContext::OUTPUT_OPTIONS: + return AgentParser::make_MAXVER(driver.loc_); + default: + return AgentParser::make_STRING("maxver", driver.loc_); + } +} + \"debuglevel\" { switch(driver.ctx_) { case ParserContext::LOGGERS: diff --git a/src/bin/agent/agent_parser.yy b/src/bin/agent/agent_parser.yy index 9414ea7688..da309b7b55 100644 --- a/src/bin/agent/agent_parser.yy +++ b/src/bin/agent/agent_parser.yy @@ -71,6 +71,9 @@ using namespace std; OUTPUT "output" DEBUGLEVEL "debuglevel" SEVERITY "severity" + FLUSH "flush" + MAXSIZE "maxsize" + MAXVER "maxver" DHCP4 "Dhcp4" DHCP6 "Dhcp6" @@ -549,15 +552,21 @@ output_entry: LCURLY_BRACKET { ElementPtr m(new MapElement(ctx.loc2pos(@1))); ctx.stack_.back()->add(m); ctx.stack_.push_back(m); -} output_params RCURLY_BRACKET { +} output_params_list RCURLY_BRACKET { ctx.stack_.pop_back(); }; -output_params: output_param - | output_params COMMA output_param +output_params_list: output_params + | output_params_list COMMA output_params ; -output_param: OUTPUT { +output_params: output + | flush + | maxsize + | maxver + ; + +output: OUTPUT { ctx.enter(ctx.NO_KEYWORDS); } COLON STRING { ElementPtr sev(new StringElement($4, ctx.loc2pos(@4))); @@ -565,6 +574,21 @@ output_param: OUTPUT { ctx.leave(); }; +flush: FLUSH COLON BOOLEAN { + ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("flush", flush); +} + +maxsize: MAXSIZE COLON INTEGER { + ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxsize", maxsize); +} + +maxver: MAXVER COLON INTEGER { + ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxver", maxver); +} + %% void diff --git a/src/bin/d2/d2_lexer.ll b/src/bin/d2/d2_lexer.ll index c9f83df715..90a1caa45c 100644 --- a/src/bin/d2/d2_lexer.ll +++ b/src/bin/d2/d2_lexer.ll @@ -389,6 +389,33 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence} } } +\"flush\" { + switch(driver.ctx_) { + case isc::d2::D2ParserContext::OUTPUT_OPTIONS: + return isc::d2::D2Parser::make_FLUSH(driver.loc_); + default: + return isc::d2::D2Parser::make_STRING("flush", driver.loc_); + } +} + +\"maxsize\" { + switch(driver.ctx_) { + case isc::d2::D2ParserContext::OUTPUT_OPTIONS: + return isc::d2::D2Parser::make_MAXSIZE(driver.loc_); + default: + return isc::d2::D2Parser::make_STRING("maxsize", driver.loc_); + } +} + +\"maxver\" { + switch(driver.ctx_) { + case isc::d2::D2ParserContext::OUTPUT_OPTIONS: + return isc::d2::D2Parser::make_MAXVER(driver.loc_); + default: + return isc::d2::D2Parser::make_STRING("maxver", driver.loc_); + } +} + \"name\" { switch(driver.ctx_) { case isc::d2::D2ParserContext::LOGGERS: diff --git a/src/bin/d2/d2_parser.yy b/src/bin/d2/d2_parser.yy index 5c585d1e8a..46d4314628 100644 --- a/src/bin/d2/d2_parser.yy +++ b/src/bin/d2/d2_parser.yy @@ -79,6 +79,9 @@ using namespace std; OUTPUT "output" DEBUGLEVEL "debuglevel" SEVERITY "severity" + FLUSH "flush" + MAXSIZE "maxsize" + MAXVER "maxver" // Not real tokens, just a way to signal what the parser is expected to // parse. @@ -711,15 +714,21 @@ output_entry: LCURLY_BRACKET { ElementPtr m(new MapElement(ctx.loc2pos(@1))); ctx.stack_.back()->add(m); ctx.stack_.push_back(m); -} output_params RCURLY_BRACKET { +} output_params_list RCURLY_BRACKET { ctx.stack_.pop_back(); }; -output_params: output_param - | output_params COMMA output_param +output_params_list: output_params + | output_params_list COMMA output_params ; -output_param: OUTPUT { +output_params: output + | flush + | maxsize + | maxver + ; + +output: OUTPUT { ctx.enter(ctx.NO_KEYWORD); } COLON STRING { ElementPtr sev(new StringElement($4, ctx.loc2pos(@4))); @@ -727,6 +736,21 @@ output_param: OUTPUT { ctx.leave(); }; +flush: FLUSH COLON BOOLEAN { + ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("flush", flush); +} + +maxsize: MAXSIZE COLON INTEGER { + ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxsize", maxsize); +} + +maxver: MAXVER COLON INTEGER { + ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxver", maxver); +} + %% void diff --git a/src/bin/dhcp4/dhcp4_lexer.ll b/src/bin/dhcp4/dhcp4_lexer.ll index 07bb8f465e..93570f8002 100644 --- a/src/bin/dhcp4/dhcp4_lexer.ll +++ b/src/bin/dhcp4/dhcp4_lexer.ll @@ -630,6 +630,33 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence} } } +\"flush\" { + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: + return isc::dhcp::Dhcp4Parser::make_FLUSH(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("flush", driver.loc_); + } +} + +\"maxsize\" { + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: + return isc::dhcp::Dhcp4Parser::make_MAXSIZE(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("maxsize", driver.loc_); + } +} + +\"maxver\" { + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: + return isc::dhcp::Dhcp4Parser::make_MAXVER(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("maxver", driver.loc_); + } +} + \"severity\" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LOGGERS: diff --git a/src/bin/dhcp4/dhcp4_parser.yy b/src/bin/dhcp4/dhcp4_parser.yy index e1c0615b11..7a3f56bfa4 100644 --- a/src/bin/dhcp4/dhcp4_parser.yy +++ b/src/bin/dhcp4/dhcp4_parser.yy @@ -173,6 +173,9 @@ using namespace std; OUTPUT "output" DEBUGLEVEL "debuglevel" SEVERITY "severity" + FLUSH "flush" + MAXSIZE "maxsize" + MAXVER "maxver" DHCP6 "Dhcp6" DHCPDDNS "DhcpDdns" @@ -1731,15 +1734,21 @@ output_entry: LCURLY_BRACKET { ElementPtr m(new MapElement(ctx.loc2pos(@1))); ctx.stack_.back()->add(m); ctx.stack_.push_back(m); -} output_params RCURLY_BRACKET { +} output_params_list RCURLY_BRACKET { ctx.stack_.pop_back(); }; -output_params: output_param - | output_params COMMA output_param +output_params_list: output_params + | output_params_list COMMA output_params + ; + +output_params: output + | flush + | maxsize + | maxver ; -output_param: OUTPUT { +output: OUTPUT { ctx.enter(ctx.NO_KEYWORD); } COLON STRING { ElementPtr sev(new StringElement($4, ctx.loc2pos(@4))); @@ -1747,6 +1756,21 @@ output_param: OUTPUT { ctx.leave(); }; +flush: FLUSH COLON BOOLEAN { + ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("flush", flush); +} + +maxsize: MAXSIZE COLON INTEGER { + ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxsize", maxsize); +} + +maxver: MAXVER COLON INTEGER { + ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxver", maxver); +} + %% void diff --git a/src/bin/dhcp6/dhcp6_lexer.ll b/src/bin/dhcp6/dhcp6_lexer.ll index 239e8d0869..df5867b568 100644 --- a/src/bin/dhcp6/dhcp6_lexer.ll +++ b/src/bin/dhcp6/dhcp6_lexer.ll @@ -897,6 +897,34 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence} } } +\"flush\" { + switch(driver.ctx_) { + case isc::dhcp::Parser6Context::OUTPUT_OPTIONS: + return isc::dhcp::Dhcp6Parser::make_FLUSH(driver.loc_); + default: + return isc::dhcp::Dhcp6Parser::make_STRING("flush", driver.loc_); + } +} + +\"maxsize\" { + switch(driver.ctx_) { + case isc::dhcp::Parser6Context::OUTPUT_OPTIONS: + return isc::dhcp::Dhcp6Parser::make_MAXSIZE(driver.loc_); + default: + return isc::dhcp::Dhcp6Parser::make_STRING("maxsize", driver.loc_); + } +} + +\"maxver\" { + switch(driver.ctx_) { + case isc::dhcp::Parser6Context::OUTPUT_OPTIONS: + return isc::dhcp::Dhcp6Parser::make_MAXVER(driver.loc_); + default: + return isc::dhcp::Dhcp6Parser::make_STRING("maxver", driver.loc_); + } +} + + \"debuglevel\" { switch(driver.ctx_) { case isc::dhcp::Parser6Context::LOGGERS: diff --git a/src/bin/dhcp6/dhcp6_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy index f774a11f15..dd81e45f7e 100644 --- a/src/bin/dhcp6/dhcp6_parser.yy +++ b/src/bin/dhcp6/dhcp6_parser.yy @@ -180,6 +180,9 @@ using namespace std; OUTPUT "output" DEBUGLEVEL "debuglevel" SEVERITY "severity" + FLUSH "flush" + MAXSIZE "maxsize" + MAXVER "maxver" DHCP4 "Dhcp4" DHCPDDNS "DhcpDdns" @@ -1820,15 +1823,21 @@ output_entry: LCURLY_BRACKET { ElementPtr m(new MapElement(ctx.loc2pos(@1))); ctx.stack_.back()->add(m); ctx.stack_.push_back(m); -} output_params RCURLY_BRACKET { +} output_params_list RCURLY_BRACKET { ctx.stack_.pop_back(); }; -output_params: output_param - | output_params COMMA output_param +output_params_list: output_params + | output_params_list COMMA output_params + ; + +output_params: output + | flush + | maxsize + | maxver ; -output_param: OUTPUT { +output: OUTPUT { ctx.enter(ctx.NO_KEYWORD); } COLON STRING { ElementPtr sev(new StringElement($4, ctx.loc2pos(@4))); @@ -1836,6 +1845,21 @@ output_param: OUTPUT { ctx.leave(); }; +flush: FLUSH COLON BOOLEAN { + ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("flush", flush); +} + +maxsize: MAXSIZE COLON INTEGER { + ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxsize", maxsize); +} + +maxver: MAXVER COLON INTEGER { + ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("maxver", maxver); +} + %% void