2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 15:35:17 +00:00

[#1102] Simplified global

This commit is contained in:
Francis Dupont
2020-09-05 14:16:57 +02:00
parent e1faf650c4
commit 41cdf1c7dc
5 changed files with 15 additions and 56 deletions

View File

@@ -229,22 +229,14 @@ agent_syntax_map: LCURLY_BRACKET {
// the content of the map // the content of the map
ElementPtr m(new MapElement(ctx.loc2pos(@1))); ElementPtr m(new MapElement(ctx.loc2pos(@1)));
ctx.stack_.push_back(m); ctx.stack_.push_back(m);
} global_objects RCURLY_BRACKET { } global_object RCURLY_BRACKET {
// map parsing completed. If we ever want to do any wrap up // map parsing completed. If we ever want to do any wrap up
// (maybe some sanity checking), this would be the best place // (maybe some sanity checking), this would be the best place
// for it. // for it.
}; };
// This represents top-level entries: Control-agent. // This represents the single top level entry, e.g. Control-agent.
global_objects: global_object global_object: CONTROL_AGENT {
;
// This represents a single top level entry, e.g. Control-agent.
global_object: agent_object
;
// This define the Control-agent object.
agent_object: CONTROL_AGENT {
// Let's create a MapElement that will represent it, add it to the // Let's create a MapElement that will represent it, add it to the
// top level map (that's already on the stack) and put the new map // top level map (that's already on the stack) and put the new map

View File

@@ -216,23 +216,15 @@ syntax_map: LCURLY_BRACKET {
// the content of the map // the content of the map
ElementPtr m(new MapElement(ctx.loc2pos(@1))); ElementPtr m(new MapElement(ctx.loc2pos(@1)));
ctx.stack_.push_back(m); ctx.stack_.push_back(m);
} global_objects RCURLY_BRACKET { } global_object RCURLY_BRACKET {
// map parsing completed. If we ever want to do any wrap up // map parsing completed. If we ever want to do any wrap up
// (maybe some sanity checking), this would be the best place // (maybe some sanity checking), this would be the best place
// for it. // for it.
}; };
// This represents top-level entries: DhcpDdns.
global_objects: global_object
;
// This represents a single top level entry, e.g. DhcpDdns.
global_object: dhcpddns_object
;
// --- dhcp ddns --------------------------------------------- // --- dhcp ddns ---------------------------------------------
// This represents the single top level entry, e.g. DhcpDdns.
dhcpddns_object: DHCPDDNS { global_object: DHCPDDNS {
ElementPtr m(new MapElement(ctx.loc2pos(@1))); ElementPtr m(new MapElement(ctx.loc2pos(@1)));
ctx.stack_.back()->set("DhcpDdns", m); ctx.stack_.back()->set("DhcpDdns", m);
ctx.stack_.push_back(m); ctx.stack_.push_back(m);

View File

@@ -399,7 +399,7 @@ syntax_map: LCURLY_BRACKET {
// the content of the map // the content of the map
ElementPtr m(new MapElement(ctx.loc2pos(@1))); ElementPtr m(new MapElement(ctx.loc2pos(@1)));
ctx.stack_.push_back(m); ctx.stack_.push_back(m);
} global_objects RCURLY_BRACKET { } global_object RCURLY_BRACKET {
// map parsing completed. If we ever want to do any wrap up // map parsing completed. If we ever want to do any wrap up
// (maybe some sanity checking), this would be the best place // (maybe some sanity checking), this would be the best place
// for it. // for it.
@@ -408,16 +408,8 @@ syntax_map: LCURLY_BRACKET {
ctx.require("Dhcp4", ctx.loc2pos(@1), ctx.loc2pos(@4)); ctx.require("Dhcp4", ctx.loc2pos(@1), ctx.loc2pos(@4));
}; };
// This represents top-level entries: Dhcp4 // This represents the single top level entry, e.g. Dhcp4.
global_objects: global_object global_object: DHCP4 {
| global_objects COMMA global_object
;
// This represents a single top level entry, e.g. Dhcp4.
global_object: dhcp4_object
;
dhcp4_object: DHCP4 {
// This code is executed when we're about to start parsing // This code is executed when we're about to start parsing
// the content of the map // the content of the map
// Prevent against duplicate. // Prevent against duplicate.

View File

@@ -406,7 +406,7 @@ syntax_map: LCURLY_BRACKET {
// the content of the map // the content of the map
ElementPtr m(new MapElement(ctx.loc2pos(@1))); ElementPtr m(new MapElement(ctx.loc2pos(@1)));
ctx.stack_.push_back(m); ctx.stack_.push_back(m);
} global_objects RCURLY_BRACKET { } global_object RCURLY_BRACKET {
// map parsing completed. If we ever want to do any wrap up // map parsing completed. If we ever want to do any wrap up
// (maybe some sanity checking), this would be the best place // (maybe some sanity checking), this would be the best place
// for it. // for it.
@@ -415,16 +415,8 @@ syntax_map: LCURLY_BRACKET {
ctx.require("Dhcp6", ctx.loc2pos(@1), ctx.loc2pos(@4)); ctx.require("Dhcp6", ctx.loc2pos(@1), ctx.loc2pos(@4));
}; };
// This represents top-level entries: Dhcp6 // This represents the single top level entry, e.g. Dhcp6.
global_objects: global_object global_object: DHCP6 {
| global_objects COMMA global_object
;
// This represents a single top level entry, e.g. Dhcp6.
global_object: dhcp6_object
;
dhcp6_object: DHCP6 {
// This code is executed when we're about to start parsing // This code is executed when we're about to start parsing
// the content of the map // the content of the map
// Prevent against duplicate. // Prevent against duplicate.

View File

@@ -228,23 +228,14 @@ netconf_syntax_map: LCURLY_BRACKET {
// the content of the map // the content of the map
ElementPtr m(new MapElement(ctx.loc2pos(@1))); ElementPtr m(new MapElement(ctx.loc2pos(@1)));
ctx.stack_.push_back(m); ctx.stack_.push_back(m);
} global_objects RCURLY_BRACKET { } global_object RCURLY_BRACKET {
// map parsing completed. If we ever want to do any wrap up // map parsing completed. If we ever want to do any wrap up
// (maybe some sanity checking), this would be the best place // (maybe some sanity checking), this would be the best place
// for it. // for it.
}; };
// This represents top-level entries: Netconf. // This represents the single top level entry, e.g. Netconf.
global_objects: global_object global_object: NETCONF {
| global_objects COMMA global_object
;
// This represents a single top level entry, e.g. Netconf.
global_object: netconf_object
;
// This define the Netconf object.
netconf_object: NETCONF {
// Let's create a MapElement that will represent it, add it to the // Let's create a MapElement that will represent it, add it to the
// top level map (that's already on the stack) and put the new map // top level map (that's already on the stack) and put the new map