From: Francis Dupont Date: Sat, 5 Sep 2020 12:16:57 +0000 (+0200) Subject: [#1102] Simplified global X-Git-Tag: Kea-1.9.0~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41cdf1c7dcfb17d68c5dbd6a45a6dd4dad8d8299;p=thirdparty%2Fkea.git [#1102] Simplified global --- diff --git a/src/bin/agent/agent_parser.yy b/src/bin/agent/agent_parser.yy index c6294e2691..a17bd55611 100644 --- a/src/bin/agent/agent_parser.yy +++ b/src/bin/agent/agent_parser.yy @@ -229,22 +229,14 @@ agent_syntax_map: LCURLY_BRACKET { // the content of the map ElementPtr m(new MapElement(ctx.loc2pos(@1))); 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 // (maybe some sanity checking), this would be the best place // for it. }; -// This represents top-level entries: Control-agent. -global_objects: global_object - ; - -// 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 { +// This represents the single top level entry, e.g. Control-agent. +global_object: CONTROL_AGENT { // 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 diff --git a/src/bin/d2/d2_parser.yy b/src/bin/d2/d2_parser.yy index c53ee40c78..6f25eedd6f 100644 --- a/src/bin/d2/d2_parser.yy +++ b/src/bin/d2/d2_parser.yy @@ -216,23 +216,15 @@ syntax_map: LCURLY_BRACKET { // the content of the map ElementPtr m(new MapElement(ctx.loc2pos(@1))); 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 // (maybe some sanity checking), this would be the best place // 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 --------------------------------------------- - -dhcpddns_object: DHCPDDNS { +// This represents the single top level entry, e.g. DhcpDdns. +global_object: DHCPDDNS { ElementPtr m(new MapElement(ctx.loc2pos(@1))); ctx.stack_.back()->set("DhcpDdns", m); ctx.stack_.push_back(m); diff --git a/src/bin/dhcp4/dhcp4_parser.yy b/src/bin/dhcp4/dhcp4_parser.yy index 22d4025497..14376fd041 100644 --- a/src/bin/dhcp4/dhcp4_parser.yy +++ b/src/bin/dhcp4/dhcp4_parser.yy @@ -399,7 +399,7 @@ syntax_map: LCURLY_BRACKET { // the content of the map ElementPtr m(new MapElement(ctx.loc2pos(@1))); 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 // (maybe some sanity checking), this would be the best place // for it. @@ -408,16 +408,8 @@ syntax_map: LCURLY_BRACKET { ctx.require("Dhcp4", ctx.loc2pos(@1), ctx.loc2pos(@4)); }; -// This represents top-level entries: Dhcp4 -global_objects: global_object - | global_objects COMMA global_object - ; - -// This represents a single top level entry, e.g. Dhcp4. -global_object: dhcp4_object - ; - -dhcp4_object: DHCP4 { +// This represents the single top level entry, e.g. Dhcp4. +global_object: DHCP4 { // This code is executed when we're about to start parsing // the content of the map // Prevent against duplicate. diff --git a/src/bin/dhcp6/dhcp6_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy index a52ce8906f..44a02e8f2e 100644 --- a/src/bin/dhcp6/dhcp6_parser.yy +++ b/src/bin/dhcp6/dhcp6_parser.yy @@ -406,7 +406,7 @@ syntax_map: LCURLY_BRACKET { // the content of the map ElementPtr m(new MapElement(ctx.loc2pos(@1))); 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 // (maybe some sanity checking), this would be the best place // for it. @@ -415,16 +415,8 @@ syntax_map: LCURLY_BRACKET { ctx.require("Dhcp6", ctx.loc2pos(@1), ctx.loc2pos(@4)); }; -// This represents top-level entries: Dhcp6 -global_objects: global_object - | global_objects COMMA global_object - ; - -// This represents a single top level entry, e.g. Dhcp6. -global_object: dhcp6_object - ; - -dhcp6_object: DHCP6 { +// This represents the single top level entry, e.g. Dhcp6. +global_object: DHCP6 { // This code is executed when we're about to start parsing // the content of the map // Prevent against duplicate. diff --git a/src/bin/netconf/netconf_parser.yy b/src/bin/netconf/netconf_parser.yy index 6065daae76..002b145a90 100644 --- a/src/bin/netconf/netconf_parser.yy +++ b/src/bin/netconf/netconf_parser.yy @@ -228,23 +228,14 @@ netconf_syntax_map: LCURLY_BRACKET { // the content of the map ElementPtr m(new MapElement(ctx.loc2pos(@1))); 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 // (maybe some sanity checking), this would be the best place // for it. }; -// This represents top-level entries: Netconf. -global_objects: global_object - | 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 { +// This represents the single top level entry, e.g. Netconf. +global_object: NETCONF { // 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