Commit aa945299 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[5187] flush, maxsize and maxver parameters added to all parsers.

parent 64529396
......@@ -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:
......
......@@ -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
......
......@@ -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:
......
......@@ -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
......
......@@ -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:
......
......@@ -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
......
......@@ -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:
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment