summaryrefslogtreecommitdiffstats
path: root/src/bin/dhcp6/dhcp6_parser.yy
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2021-12-16 01:03:33 +0100
committerAndrei Pavel <andrei@isc.org>2021-12-17 16:21:22 +0100
commitbdda75a796cc4d0b905b8f1b1f50505beba9f187 (patch)
treeb8417474880dc481ee81984552c3e2ff7c21c776 /src/bin/dhcp6/dhcp6_parser.yy
parent[#2084] Addressed all concerns outside .yy files (diff)
downloadkea-bdda75a796cc4d0b905b8f1b1f50505beba9f187.tar.xz
kea-bdda75a796cc4d0b905b8f1b1f50505beba9f187.zip
[#2084] Checkpoint before regen
Diffstat (limited to 'src/bin/dhcp6/dhcp6_parser.yy')
-rw-r--r--src/bin/dhcp6/dhcp6_parser.yy174
1 files changed, 85 insertions, 89 deletions
diff --git a/src/bin/dhcp6/dhcp6_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy
index b176aa562c..9e9e74a78c 100644
--- a/src/bin/dhcp6/dhcp6_parser.yy
+++ b/src/bin/dhcp6/dhcp6_parser.yy
@@ -36,12 +36,6 @@ using namespace std;
}
%code
-{
-template <typename ctx_t, typename location_t>
-void warnAboutExtraCommas(ctx_t& ctx, location_t& location) {
- ctx.warning(location, "Extraneous comma. A piece of configuration may have been omitted.");
-} // warnAboutExtraCommas
-} // %code
%define api.token.prefix {TOKEN_}
// Tokens in an order which makes sense and related to the intended use.
@@ -370,8 +364,8 @@ not_empty_map: STRING COLON value {
ctx.stack_.back()->set($3, $5);
}
| not_empty_map COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
list_generic: LSQUARE_BRACKET {
@@ -394,8 +388,8 @@ not_empty_list: value {
ctx.stack_.back()->add($3);
}
| not_empty_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// This one is used in syntax parser and is restricted to strings.
@@ -419,8 +413,8 @@ not_empty_list_strings: STRING {
ctx.stack_.back()->add(s);
}
| not_empty_list_strings COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// ---- generic JSON parser ends here ----------------------------------
@@ -466,11 +460,13 @@ global_object: DHCP6 {
ctx.stack_.pop_back();
ctx.leave();
}
- | global_object COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ | global_object_comma
;
+global_object_comma: global_object COMMA {
+ ctx.warnAboutExtraCommas(@1);
+};
+
// subparser: similar to the corresponding rule but without parent
// so the stack is empty at the rule entry.
sub_dhcp6: LCURLY_BRACKET {
@@ -485,8 +481,8 @@ sub_dhcp6: LCURLY_BRACKET {
global_params: global_param
| global_params COMMA global_param
| global_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// These are the parameters that are allowed in the top-level for
@@ -805,8 +801,8 @@ sub_interfaces6: LCURLY_BRACKET {
interfaces_config_params: interfaces_config_param
| interfaces_config_params COMMA interfaces_config_param
| interfaces_config_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
interfaces_config_param: interfaces_list
@@ -877,8 +873,8 @@ database_list: %empty
not_empty_database_list: database
| not_empty_database_list COMMA database
| not_empty_database_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
database: LCURLY_BRACKET {
@@ -894,8 +890,8 @@ database: LCURLY_BRACKET {
database_map_params: database_map_param
| database_map_params COMMA database_map_param
| database_map_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
database_map_param: database_type
@@ -1101,8 +1097,8 @@ sanity_checks: SANITY_CHECKS {
sanity_checks_params: sanity_checks_param
| sanity_checks_params COMMA sanity_checks_param
| sanity_checks_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
sanity_checks_param: lease_checks;
@@ -1140,8 +1136,8 @@ mac_sources: MAC_SOURCES {
mac_sources_list: mac_sources_value
| mac_sources_list COMMA mac_sources_value
| mac_sources_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
mac_sources_value: duid_id
@@ -1172,8 +1168,8 @@ host_reservation_identifiers: HOST_RESERVATION_IDENTIFIERS {
host_reservation_identifiers_list: host_reservation_identifier
| host_reservation_identifiers_list COMMA host_reservation_identifier
| host_reservation_identifiers_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
host_reservation_identifier: duid_id
@@ -1222,8 +1218,8 @@ dhcp_multi_threading: DHCP_MULTI_THREADING {
multi_threading_params: multi_threading_param
| multi_threading_params COMMA multi_threading_param
| multi_threading_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
multi_threading_param: enable_multi_threading
@@ -1270,8 +1266,8 @@ hooks_libraries_list: %empty
not_empty_hooks_libraries_list: hooks_library
| not_empty_hooks_libraries_list COMMA hooks_library
| not_empty_hooks_libraries_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
hooks_library: LCURLY_BRACKET {
@@ -1297,8 +1293,8 @@ sub_hooks_library: LCURLY_BRACKET {
hooks_params: hooks_param
| hooks_params COMMA hooks_param
| hooks_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
| unknown_map_entry
;
@@ -1339,8 +1335,8 @@ expired_leases_processing: EXPIRED_LEASES_PROCESSING {
expired_leases_params: expired_leases_param
| expired_leases_params COMMA expired_leases_param
| expired_leases_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
expired_leases_param: reclaim_timer_wait_time
@@ -1411,8 +1407,8 @@ subnet6_list_content: %empty
not_empty_subnet6_list: subnet6
| not_empty_subnet6_list COMMA subnet6
| not_empty_subnet6_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// --- Subnet definitions -------------------------------
@@ -1459,8 +1455,8 @@ sub_subnet6: LCURLY_BRACKET {
subnet6_params: subnet6_param
| subnet6_params COMMA subnet6_param
| subnet6_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// This defines a list of allowed parameters for each subnet.
@@ -1622,8 +1618,8 @@ shared_networks_content: %empty
shared_networks_list: shared_network
| shared_networks_list COMMA shared_network
| shared_networks_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
shared_network: LCURLY_BRACKET {
@@ -1637,8 +1633,8 @@ shared_network: LCURLY_BRACKET {
shared_network_params: shared_network_param
| shared_network_params COMMA shared_network_param
| shared_network_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
shared_network_param: name
@@ -1717,8 +1713,8 @@ option_def_list_content: %empty
not_empty_option_def_list: option_def_entry
| not_empty_option_def_list COMMA option_def_entry
| not_empty_option_def_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// This defines the content of a single entry { ... } within
@@ -1759,8 +1755,8 @@ option_def_params: %empty
not_empty_option_def_params: option_def_param
| not_empty_option_def_params COMMA option_def_param
| not_empty_option_def_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
option_def_param: option_def_name
@@ -1855,8 +1851,8 @@ option_data_list_content: %empty
not_empty_option_data_list: option_data_entry
| not_empty_option_data_list COMMA option_data_entry
| not_empty_option_data_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// This defines th content of a single entry { ... } within
@@ -1894,8 +1890,8 @@ option_data_params: %empty
not_empty_option_data_params: option_data_param
| not_empty_option_data_params COMMA option_data_param
| not_empty_option_data_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// Each single option-data parameter can be one of the following
@@ -1961,8 +1957,8 @@ pools_list_content: %empty
not_empty_pools_list: pool_list_entry
| not_empty_pools_list COMMA pool_list_entry
| not_empty_pools_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
pool_list_entry: LCURLY_BRACKET {
@@ -1988,8 +1984,8 @@ sub_pool6: LCURLY_BRACKET {
pool_params: pool_param
| pool_params COMMA pool_param
| pool_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
pool_param: pool_entry
@@ -2085,8 +2081,8 @@ pd_pools_list_content: %empty
not_empty_pd_pools_list: pd_pool_entry
| not_empty_pd_pools_list COMMA pd_pool_entry
| not_empty_pd_pools_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
pd_pool_entry: LCURLY_BRACKET {
@@ -2116,8 +2112,8 @@ sub_pd_pool: LCURLY_BRACKET {
pd_pool_params: pd_pool_param
| pd_pool_params COMMA pd_pool_param
| pd_pool_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
pd_pool_param: pd_prefix
@@ -2190,8 +2186,8 @@ reservations_list: %empty
not_empty_reservations_list: reservation
| not_empty_reservations_list COMMA reservation
| not_empty_reservations_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
reservation: LCURLY_BRACKET {
@@ -2219,8 +2215,8 @@ reservation_params: %empty
not_empty_reservation_params: reservation_param
| not_empty_reservation_params COMMA reservation_param
| not_empty_reservation_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
/// @todo probably need to add mac-address as well here
@@ -2350,8 +2346,8 @@ client_classes: CLIENT_CLASSES {
client_classes_list: client_class_entry
| client_classes_list COMMA client_class_entry
| client_classes_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
client_class_entry: LCURLY_BRACKET {
@@ -2371,8 +2367,8 @@ client_class_params: %empty
not_empty_client_class_params: client_class_param
| not_empty_client_class_params COMMA client_class_param
| not_empty_client_class_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
client_class_param: client_class_name
@@ -2426,8 +2422,8 @@ server_id: SERVER_ID {
server_id_params: server_id_param
| server_id_params COMMA server_id_param
| server_id_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
server_id_param: server_id_type
@@ -2505,8 +2501,8 @@ control_socket: CONTROL_SOCKET {
control_socket_params: control_socket_param
| control_socket_params COMMA control_socket_param
| control_socket_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
control_socket_param: socket_type
@@ -2553,8 +2549,8 @@ dhcp_queue_control: DHCP_QUEUE_CONTROL {
queue_control_params: queue_control_param
| queue_control_params COMMA queue_control_param
| queue_control_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
queue_control_param: enable_queue
@@ -2622,8 +2618,8 @@ sub_dhcp_ddns: LCURLY_BRACKET {
dhcp_ddns_params: dhcp_ddns_param
| dhcp_ddns_params COMMA dhcp_ddns_param
| dhcp_ddns_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
dhcp_ddns_param: enable_updates
@@ -2801,8 +2797,8 @@ sub_config_control: LCURLY_BRACKET {
config_control_params: config_control_param
| config_control_params COMMA config_control_param
| config_control_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// This defines a list of allowed parameters for each subnet.
@@ -2845,8 +2841,8 @@ loggers: LOGGERS {
loggers_entries: logger_entry
| loggers_entries COMMA logger_entry
| loggers_entries COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
// This defines a single entry defined in loggers.
@@ -2861,8 +2857,8 @@ logger_entry: LCURLY_BRACKET {
logger_params: logger_param
| logger_params COMMA logger_param
| logger_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
logger_param: name
@@ -2903,8 +2899,8 @@ output_options_list: OUTPUT_OPTIONS {
output_options_list_content: output_entry
| output_options_list_content COMMA output_entry
| output_options_list_content COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
output_entry: LCURLY_BRACKET {
@@ -2918,8 +2914,8 @@ output_entry: LCURLY_BRACKET {
output_params_list: output_params
| output_params_list COMMA output_params
| output_params_list COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
output_params: output
@@ -2979,8 +2975,8 @@ compatibility: COMPATIBILITY {
compatibility_params: compatibility_param
| compatibility_params COMMA compatibility_param
| compatibility_params COMMA {
- warnAboutExtraCommas(ctx, @1);
-}
+ ctx.warnAboutExtraCommas(@1);
+ }
;
compatibility_param: lenient_option_parsing