]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2084] add extraneous comma warning to parsers
authorAndrei Pavel <andrei@isc.org>
Fri, 26 Nov 2021 09:45:12 +0000 (11:45 +0200)
committerAndrei Pavel <andrei@isc.org>
Fri, 17 Dec 2021 15:20:51 +0000 (17:20 +0200)
src/bin/agent/agent_parser.yy
src/bin/d2/d2_parser.yy
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp6/dhcp6_parser.yy
src/bin/netconf/netconf_parser.yy

index 71e3ef5d316409f0af8df80e4e8d08502c7960fb..6253da9fdcbc955d8b69098b8813afeba8811228 100644 (file)
@@ -194,7 +194,9 @@ not_empty_map: STRING COLON value {
                   ctx.unique($3, ctx.loc2pos(@3));
                   ctx.stack_.back()->set($3, $5);
                   }
-             | not_empty_map COMMA
+             | not_empty_map COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 list_generic: LSQUARE_BRACKET {
@@ -215,7 +217,9 @@ not_empty_list: value {
                   // List ending with , and a value.
                   ctx.stack_.back()->add($3);
                   }
-              | not_empty_list COMMA
+              | not_empty_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 // --- generic JSON parser ends here -------------------------------------------
@@ -261,12 +265,16 @@ global_object: CONTROL_AGENT {
     ctx.stack_.pop_back();
     ctx.leave();
 }
-             | global_object COMMA
+             | global_object COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 global_params: global_param
              | global_params COMMA global_param
-             | global_params COMMA
+             | global_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 // These are the parameters that are allowed in the top-level for
@@ -404,7 +412,9 @@ 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
+    | not_empty_hooks_libraries_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 hooks_library: LCURLY_BRACKET {
@@ -417,7 +427,9 @@ hooks_library: LCURLY_BRACKET {
 
 hooks_params: hooks_param
             | hooks_params COMMA hooks_param
-            | hooks_params COMMA
+            | hooks_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
             | unknown_map_entry
             ;
 
@@ -461,7 +473,9 @@ control_sockets: CONTROL_SOCKETS COLON LCURLY_BRACKET {
 // is required.
 control_sockets_params: control_socket
                       | control_sockets_params COMMA control_socket
-                      | control_sockets_params COMMA
+                      | control_sockets_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 // We currently support three types of sockets: DHCPv4, DHCPv6 and D2
@@ -511,7 +525,9 @@ d2_server_socket: D2_SERVER {
 // Socket parameters consist of one or more parameters.
 control_socket_params: control_socket_param
                      | control_socket_params COMMA control_socket_param
-                     | control_socket_params COMMA
+                     | control_socket_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 // We currently support two socket parameters: type and name.
@@ -564,7 +580,9 @@ authentication: AUTHENTICATION {
 
 auth_params: auth_param
            | auth_params COMMA auth_param
-           | auth_params COMMA
+           | auth_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
            ;
 
 auth_param: auth_type
@@ -612,7 +630,9 @@ clients_list: %empty
 
 not_empty_clients_list: basic_auth
                       | not_empty_clients_list COMMA basic_auth
-                      | not_empty_clients_list COMMA
+                      | not_empty_clients_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 basic_auth: LCURLY_BRACKET {
@@ -625,7 +645,9 @@ basic_auth: LCURLY_BRACKET {
 
 clients_params: clients_param
               | clients_params COMMA clients_param
-              | clients_params COMMA
+              | clients_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 clients_param: user
@@ -672,7 +694,9 @@ loggers: LOGGERS {
 // entry or multiple entries separate by commas.
 loggers_entries: logger_entry
                | loggers_entries COMMA logger_entry
-               | loggers_entries COMMA
+               | loggers_entries COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 // This defines a single entry defined in loggers.
@@ -686,7 +710,9 @@ logger_entry: LCURLY_BRACKET {
 
 logger_params: logger_param
              | logger_params COMMA logger_param
-             | logger_params COMMA
+             | logger_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 logger_param: name
@@ -735,7 +761,9 @@ output_options_list: OUTPUT_OPTIONS {
 
 output_options_list_content: output_entry
                            | output_options_list_content COMMA output_entry
-                           | output_options_list_content COMMA
+                           | output_options_list_content COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 output_entry: LCURLY_BRACKET {
@@ -748,7 +776,9 @@ output_entry: LCURLY_BRACKET {
 
 output_params_list: output_params
              | output_params_list COMMA output_params
-             | output_params_list COMMA
+             | output_params_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 output_params: output
index 6d8a23fb56cb2683208b011b668ee7839b8e620e..6828c78563dae5b2ee251f0fbb7b488108561751 100644 (file)
@@ -182,7 +182,9 @@ not_empty_map: STRING COLON value {
                   ctx.unique($3, ctx.loc2pos(@3));
                   ctx.stack_.back()->set($3, $5);
                   }
-             | not_empty_map COMMA
+             | not_empty_map COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 list_generic: LSQUARE_BRACKET {
@@ -204,7 +206,9 @@ not_empty_list: value {
                   // List ending with , and a value.
                   ctx.stack_.back()->add($3);
                   }
-              | not_empty_list COMMA
+              | not_empty_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 // ---- generic JSON parser ends here ----------------------------------
@@ -244,7 +248,9 @@ global_object: DHCPDDNS {
     ctx.stack_.pop_back();
     ctx.leave();
 }
-             | global_object COMMA
+             | global_object COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 sub_dhcpddns: LCURLY_BRACKET {
@@ -257,7 +263,9 @@ sub_dhcpddns: LCURLY_BRACKET {
 
 dhcpddns_params: dhcpddns_param
                | dhcpddns_params COMMA dhcpddns_param
-               | dhcpddns_params COMMA
+               | dhcpddns_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 // These are the top-level parameters allowed for DhcpDdns
@@ -407,7 +415,9 @@ ddns_mgr_params: %empty
 
 not_empty_ddns_mgr_params: ddns_mgr_param
                          | ddns_mgr_params COMMA ddns_mgr_param
-                         | ddns_mgr_params COMMA
+                         | ddns_mgr_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                          ;
 
 ddns_mgr_param: ddns_domains
@@ -440,7 +450,9 @@ ddns_domain_list: %empty
 
 not_empty_ddns_domain_list: ddns_domain
                         | not_empty_ddns_domain_list COMMA ddns_domain
-                        | not_empty_ddns_domain_list COMMA
+                        | not_empty_ddns_domain_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                         ;
 
 ddns_domain: LCURLY_BRACKET {
@@ -460,7 +472,9 @@ sub_ddns_domain: LCURLY_BRACKET {
 
 ddns_domain_params: ddns_domain_param
                   | ddns_domain_params COMMA ddns_domain_param
-                  | ddns_domain_params COMMA
+                  | ddns_domain_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                   ;
 
 ddns_domain_param: ddns_domain_name
@@ -518,7 +532,9 @@ sub_dns_servers: LSQUARE_BRACKET {
 
 dns_server_list: dns_server
                | dns_server_list COMMA dns_server
-               | dns_server_list COMMA
+               | dns_server_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 dns_server: LCURLY_BRACKET {
@@ -538,7 +554,9 @@ sub_dns_server: LCURLY_BRACKET {
 
 dns_server_params: dns_server_param
                | dns_server_params COMMA dns_server_param
-               | dns_server_params COMMA
+               | dns_server_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 dns_server_param: dns_server_hostname
@@ -611,7 +629,9 @@ tsig_keys_list: %empty
 
 not_empty_tsig_keys_list: tsig_key
                         | not_empty_tsig_keys_list COMMA tsig_key
-                        | not_empty_tsig_keys_list COMMA
+                        | not_empty_tsig_keys_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                         ;
 
 tsig_key: LCURLY_BRACKET {
@@ -633,7 +653,9 @@ sub_tsig_key: LCURLY_BRACKET {
 
 tsig_key_params: tsig_key_param
                | tsig_key_params COMMA tsig_key_param
-               | tsig_key_params COMMA
+               | tsig_key_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 tsig_key_param: tsig_key_name
@@ -709,7 +731,9 @@ control_socket: CONTROL_SOCKET {
 
 control_socket_params: control_socket_param
                      | control_socket_params COMMA control_socket_param
-                     | control_socket_params COMMA
+                     | control_socket_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 control_socket_param: control_socket_type
@@ -756,7 +780,9 @@ 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
+    | not_empty_hooks_libraries_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 hooks_library: LCURLY_BRACKET {
@@ -781,7 +807,9 @@ sub_hooks_library: LCURLY_BRACKET {
 
 hooks_params: hooks_param
             | hooks_params COMMA hooks_param
-            | hooks_params COMMA
+            | hooks_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
             | unknown_map_entry
             ;
 
@@ -823,7 +851,9 @@ loggers: LOGGERS {
 // entry or multiple entries separate by commas.
 loggers_entries: logger_entry
                | loggers_entries COMMA logger_entry
-               | loggers_entries COMMA
+               | loggers_entries COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 // This defines a single entry defined in loggers.
@@ -837,7 +867,9 @@ logger_entry: LCURLY_BRACKET {
 
 logger_params: logger_param
              | logger_params COMMA logger_param
-             | logger_params COMMA
+             | logger_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 logger_param: name
@@ -886,7 +918,9 @@ output_options_list: OUTPUT_OPTIONS {
 
 output_options_list_content: output_entry
                            | output_options_list_content COMMA output_entry
-                           | output_options_list_content COMMA
+                           | output_options_list_content COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 output_entry: LCURLY_BRACKET {
@@ -899,7 +933,9 @@ output_entry: LCURLY_BRACKET {
 
 output_params_list: output_params
              | output_params_list COMMA output_params
-             | output_params_list COMMA
+             | output_params_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 output_params: output
index 674de16106e783d44e63cb9fd5dc210552b6b833..dc81e1c9c8a09b60274e5a30f9798888d13c263b 100644 (file)
@@ -354,7 +354,9 @@ not_empty_map: STRING COLON value {
                   ctx.unique($3, ctx.loc2pos(@3));
                   ctx.stack_.back()->set($3, $5);
                   }
-             | not_empty_map COMMA
+             | not_empty_map COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 list_generic: LSQUARE_BRACKET {
@@ -376,7 +378,9 @@ not_empty_list: value {
                   // List ending with , and a value.
                   ctx.stack_.back()->add($3);
                   }
-              | not_empty_list COMMA
+              | not_empty_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 // This one is used in syntax parser and is restricted to strings.
@@ -399,7 +403,9 @@ not_empty_list_strings: STRING {
                           ElementPtr s(new StringElement($3, ctx.loc2pos(@3)));
                           ctx.stack_.back()->add(s);
                           }
-                      | not_empty_list_strings COMMA
+                      | not_empty_list_strings COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 // ---- generic JSON parser ends here ----------------------------------
@@ -445,7 +451,9 @@ global_object: DHCP4 {
     ctx.stack_.pop_back();
     ctx.leave();
 }
-             | global_object COMMA
+             | global_object COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 // subparser: similar to the corresponding rule but without parent
@@ -461,7 +469,9 @@ sub_dhcp4: LCURLY_BRACKET {
 
 global_params: global_param
              | global_params COMMA global_param
-             | global_params COMMA
+             | global_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 // These are the parameters that are allowed in the top-level for
@@ -760,7 +770,9 @@ interfaces_config: INTERFACES_CONFIG {
 
 interfaces_config_params: interfaces_config_param
                         | interfaces_config_params COMMA interfaces_config_param
-                        | interfaces_config_params COMMA
+                        | interfaces_config_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                         ;
 
 interfaces_config_param: interfaces_list
@@ -851,7 +863,9 @@ sanity_checks: SANITY_CHECKS {
 
 sanity_checks_params: sanity_checks_param
                     | sanity_checks_params COMMA sanity_checks_param
-                    | sanity_checks_params COMMA
+                    | sanity_checks_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 sanity_checks_param: lease_checks;
@@ -905,7 +919,9 @@ database_list: %empty
 
 not_empty_database_list: database
                        | not_empty_database_list COMMA database
-                       | not_empty_database_list COMMA
+                       | not_empty_database_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                        ;
 
 database: LCURLY_BRACKET {
@@ -920,7 +936,9 @@ database: LCURLY_BRACKET {
 
 database_map_params: database_map_param
                    | database_map_params COMMA database_map_param
-                   | database_map_params COMMA
+                   | database_map_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                    ;
 
 database_map_param: database_type
@@ -1126,7 +1144,9 @@ 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
+    | host_reservation_identifiers_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 host_reservation_identifier: duid_id
@@ -1178,7 +1198,9 @@ dhcp_multi_threading: DHCP_MULTI_THREADING {
 
 multi_threading_params: multi_threading_param
                       | multi_threading_params COMMA multi_threading_param
-                      | multi_threading_params COMMA
+                      | multi_threading_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 multi_threading_param: enable_multi_threading
@@ -1224,7 +1246,9 @@ 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
+    | not_empty_hooks_libraries_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 hooks_library: LCURLY_BRACKET {
@@ -1249,7 +1273,9 @@ sub_hooks_library: LCURLY_BRACKET {
 
 hooks_params: hooks_param
             | hooks_params COMMA hooks_param
-            | hooks_params COMMA
+            | hooks_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
             | unknown_map_entry
             ;
 
@@ -1289,7 +1315,9 @@ expired_leases_processing: EXPIRED_LEASES_PROCESSING {
 
 expired_leases_params: expired_leases_param
                      | expired_leases_params COMMA expired_leases_param
-                     | expired_leases_params COMMA
+                     | expired_leases_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 expired_leases_param: reclaim_timer_wait_time
@@ -1359,7 +1387,9 @@ subnet4_list_content: %empty
 
 not_empty_subnet4_list: subnet4
                       | not_empty_subnet4_list COMMA subnet4
-                      | not_empty_subnet4_list COMMA
+                      | not_empty_subnet4_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 // --- Subnet definitions -------------------------------
@@ -1405,7 +1435,9 @@ sub_subnet4: LCURLY_BRACKET {
 // This defines that subnet can have one or more parameters.
 subnet4_params: subnet4_param
               | subnet4_params COMMA subnet4_param
-              | subnet4_params COMMA
+              | subnet4_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 // This defines a list of allowed parameters for each subnet.
@@ -1580,7 +1612,9 @@ shared_networks_content: %empty
 // This allows 1 or more shared network definitions.
 shared_networks_list: shared_network
                     | shared_networks_list COMMA shared_network
-                    | shared_networks_list COMMA
+                    | shared_networks_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 shared_network: LCURLY_BRACKET {
@@ -1593,7 +1627,9 @@ shared_network: LCURLY_BRACKET {
 
 shared_network_params: shared_network_param
                      | shared_network_params COMMA shared_network_param
-                     | shared_network_params COMMA
+                     | shared_network_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 shared_network_param: name
@@ -1671,7 +1707,9 @@ 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
+                         | not_empty_option_def_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                          ;
 
 // This defines the content of a single entry { ... } within
@@ -1711,7 +1749,9 @@ 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
+                           | not_empty_option_def_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 option_def_param: option_def_name
@@ -1805,7 +1845,9 @@ option_data_list_content: %empty
 // be a single value or multiple entries separated by comma.
 not_empty_option_data_list: option_data_entry
                           | not_empty_option_data_list COMMA option_data_entry
-                          | not_empty_option_data_list COMMA
+                          | not_empty_option_data_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                           ;
 
 // This defines th content of a single entry { ... } within
@@ -1842,7 +1884,9 @@ option_data_params: %empty
 // a list of parameters separated by comma.
 not_empty_option_data_params: option_data_param
     | not_empty_option_data_params COMMA option_data_param
-    | not_empty_option_data_params COMMA
+    | not_empty_option_data_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 // Each single option-data parameter can be one of the following
@@ -1907,7 +1951,9 @@ pools_list_content: %empty
 
 not_empty_pools_list: pool_list_entry
                     | not_empty_pools_list COMMA pool_list_entry
-                    | not_empty_pools_list COMMA
+                    | not_empty_pools_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 pool_list_entry: LCURLY_BRACKET {
@@ -1932,7 +1978,9 @@ sub_pool4: LCURLY_BRACKET {
 
 pool_params: pool_param
            | pool_params COMMA pool_param
-           | pool_params COMMA
+           | pool_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
            ;
 
 pool_param: pool_entry
@@ -2025,7 +2073,9 @@ reservations_list: %empty
 
 not_empty_reservations_list: reservation
                            | not_empty_reservations_list COMMA reservation
-                           | not_empty_reservations_list COMMA
+                           | not_empty_reservations_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 reservation: LCURLY_BRACKET {
@@ -2052,7 +2102,9 @@ reservation_params: %empty
 
 not_empty_reservation_params: reservation_param
     | not_empty_reservation_params COMMA reservation_param
-    | not_empty_reservation_params COMMA
+    | not_empty_reservation_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 /// @todo probably need to add mac-address as well here
@@ -2219,7 +2271,9 @@ client_classes: CLIENT_CLASSES {
 
 client_classes_list: client_class_entry
                    | client_classes_list COMMA client_class_entry
-                   | client_classes_list COMMA
+                   | client_classes_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                    ;
 
 client_class_entry: LCURLY_BRACKET {
@@ -2238,7 +2292,9 @@ 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
+    | not_empty_client_class_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 client_class_param: client_class_name
@@ -2297,7 +2353,9 @@ control_socket: CONTROL_SOCKET {
 
 control_socket_params: control_socket_param
                      | control_socket_params COMMA control_socket_param
-                     | control_socket_params COMMA
+                     | control_socket_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 control_socket_param: control_socket_type
@@ -2343,7 +2401,9 @@ dhcp_queue_control: DHCP_QUEUE_CONTROL {
 
 queue_control_params: queue_control_param
                     | queue_control_params COMMA queue_control_param
-                    | queue_control_params COMMA
+                    | queue_control_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 queue_control_param: enable_queue
@@ -2410,7 +2470,9 @@ sub_dhcp_ddns: LCURLY_BRACKET {
 
 dhcp_ddns_params: dhcp_ddns_param
                 | dhcp_ddns_params COMMA dhcp_ddns_param
-                | dhcp_ddns_params COMMA
+                | dhcp_ddns_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                 ;
 
 dhcp_ddns_param: enable_updates
@@ -2587,7 +2649,9 @@ sub_config_control: LCURLY_BRACKET {
 // This defines that subnet can have one or more parameters.
 config_control_params: config_control_param
                      | config_control_params COMMA config_control_param
-                     | config_control_params COMMA
+                     | config_control_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 // This defines a list of allowed parameters for each subnet.
@@ -2629,7 +2693,9 @@ loggers: LOGGERS {
 // entry or multiple entries separate by commas.
 loggers_entries: logger_entry
                | loggers_entries COMMA logger_entry
-               | loggers_entries COMMA
+               | loggers_entries COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 // This defines a single entry defined in loggers.
@@ -2643,7 +2709,9 @@ logger_entry: LCURLY_BRACKET {
 
 logger_params: logger_param
              | logger_params COMMA logger_param
-             | logger_params COMMA
+             | logger_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 logger_param: name
@@ -2683,7 +2751,9 @@ output_options_list: OUTPUT_OPTIONS {
 
 output_options_list_content: output_entry
                            | output_options_list_content COMMA output_entry
-                           | output_options_list_content COMMA
+                           | output_options_list_content COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 output_entry: LCURLY_BRACKET {
@@ -2696,7 +2766,9 @@ output_entry: LCURLY_BRACKET {
 
 output_params_list: output_params
                   | output_params_list COMMA output_params
-                  | output_params_list COMMA
+                  | output_params_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                   ;
 
 output_params: output
@@ -2755,7 +2827,9 @@ compatibility: COMPATIBILITY {
 
 compatibility_params: compatibility_param
                     | compatibility_params COMMA compatibility_param
-                    | compatibility_params COMMA
+                    | compatibility_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 compatibility_param: lenient_option_parsing
index 86e3780b83f03de2c29b4ca9f0d5021949d2cda7..4026def40e560ed4f97b044b17153b153aa66aaf 100644 (file)
@@ -362,7 +362,9 @@ not_empty_map: STRING COLON value {
                   ctx.unique($3, ctx.loc2pos(@3));
                   ctx.stack_.back()->set($3, $5);
                   }
-             | not_empty_map COMMA
+             | not_empty_map COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 list_generic: LSQUARE_BRACKET {
@@ -384,7 +386,9 @@ not_empty_list: value {
                   // List ending with , and a value.
                   ctx.stack_.back()->add($3);
                   }
-              | not_empty_list COMMA
+              | not_empty_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 // This one is used in syntax parser and is restricted to strings.
@@ -407,7 +411,9 @@ not_empty_list_strings: STRING {
                           ElementPtr s(new StringElement($3, ctx.loc2pos(@3)));
                           ctx.stack_.back()->add(s);
                           }
-                      | not_empty_list_strings COMMA
+                      | not_empty_list_strings COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 // ---- generic JSON parser ends here ----------------------------------
@@ -453,7 +459,9 @@ global_object: DHCP6 {
     ctx.stack_.pop_back();
     ctx.leave();
 }
-             | global_object COMMA
+             | global_object COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 // subparser: similar to the corresponding rule but without parent
@@ -469,7 +477,9 @@ sub_dhcp6: LCURLY_BRACKET {
 
 global_params: global_param
              | global_params COMMA global_param
-             | global_params COMMA
+             | global_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 // These are the parameters that are allowed in the top-level for
@@ -787,7 +797,9 @@ sub_interfaces6: LCURLY_BRACKET {
 
 interfaces_config_params: interfaces_config_param
                         | interfaces_config_params COMMA interfaces_config_param
-                        | interfaces_config_params COMMA
+                        | interfaces_config_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                         ;
 
 interfaces_config_param: interfaces_list
@@ -857,7 +869,9 @@ database_list: %empty
 
 not_empty_database_list: database
                        | not_empty_database_list COMMA database
-                       | not_empty_database_list COMMA
+                       | not_empty_database_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                        ;
 
 database: LCURLY_BRACKET {
@@ -872,7 +886,9 @@ database: LCURLY_BRACKET {
 
 database_map_params: database_map_param
                    | database_map_params COMMA database_map_param
-                   | database_map_params COMMA
+                   | database_map_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                    ;
 
 database_map_param: database_type
@@ -1077,7 +1093,9 @@ sanity_checks: SANITY_CHECKS {
 
 sanity_checks_params: sanity_checks_param
                     | sanity_checks_params COMMA sanity_checks_param
-                    | sanity_checks_params COMMA
+                    | sanity_checks_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 sanity_checks_param: lease_checks;
@@ -1114,7 +1132,9 @@ mac_sources: MAC_SOURCES {
 
 mac_sources_list: mac_sources_value
                 | mac_sources_list COMMA mac_sources_value
-                | mac_sources_list COMMA
+                | mac_sources_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                 ;
 
 mac_sources_value: duid_id
@@ -1144,7 +1164,9 @@ 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
+    | host_reservation_identifiers_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 host_reservation_identifier: duid_id
@@ -1192,7 +1214,9 @@ dhcp_multi_threading: DHCP_MULTI_THREADING {
 
 multi_threading_params: multi_threading_param
                       | multi_threading_params COMMA multi_threading_param
-                      | multi_threading_params COMMA
+                      | multi_threading_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 multi_threading_param: enable_multi_threading
@@ -1238,7 +1262,9 @@ 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
+    | not_empty_hooks_libraries_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 hooks_library: LCURLY_BRACKET {
@@ -1263,7 +1289,9 @@ sub_hooks_library: LCURLY_BRACKET {
 
 hooks_params: hooks_param
             | hooks_params COMMA hooks_param
-            | hooks_params COMMA
+            | hooks_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
             | unknown_map_entry
             ;
 
@@ -1303,7 +1331,9 @@ expired_leases_processing: EXPIRED_LEASES_PROCESSING {
 
 expired_leases_params: expired_leases_param
                      | expired_leases_params COMMA expired_leases_param
-                     | expired_leases_params COMMA
+                     | expired_leases_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 expired_leases_param: reclaim_timer_wait_time
@@ -1373,7 +1403,9 @@ subnet6_list_content: %empty
 
 not_empty_subnet6_list: subnet6
                       | not_empty_subnet6_list COMMA subnet6
-                      | not_empty_subnet6_list COMMA
+                      | not_empty_subnet6_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                       ;
 
 // --- Subnet definitions -------------------------------
@@ -1419,7 +1451,9 @@ sub_subnet6: LCURLY_BRACKET {
 // This defines that subnet can have one or more parameters.
 subnet6_params: subnet6_param
               | subnet6_params COMMA subnet6_param
-              | subnet6_params COMMA
+              | subnet6_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 // This defines a list of allowed parameters for each subnet.
@@ -1580,7 +1614,9 @@ shared_networks_content: %empty
 // This allows 1 or more shared network definitions.
 shared_networks_list: shared_network
                     | shared_networks_list COMMA shared_network
-                    | shared_networks_list COMMA
+                    | shared_networks_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 shared_network: LCURLY_BRACKET {
@@ -1593,7 +1629,9 @@ shared_network: LCURLY_BRACKET {
 
 shared_network_params: shared_network_param
                      | shared_network_params COMMA shared_network_param
-                     | shared_network_params COMMA
+                     | shared_network_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 shared_network_param: name
@@ -1671,7 +1709,9 @@ 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
+                         | not_empty_option_def_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                          ;
 
 // This defines the content of a single entry { ... } within
@@ -1711,7 +1751,9 @@ 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
+                           | not_empty_option_def_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 option_def_param: option_def_name
@@ -1805,7 +1847,9 @@ option_data_list_content: %empty
 // be a single value or multiple entries separated by comma.
 not_empty_option_data_list: option_data_entry
                           | not_empty_option_data_list COMMA option_data_entry
-                          | not_empty_option_data_list COMMA
+                          | not_empty_option_data_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                           ;
 
 // This defines th content of a single entry { ... } within
@@ -1842,7 +1886,9 @@ option_data_params: %empty
 // a list of parameters separated by comma.
 not_empty_option_data_params: option_data_param
     | not_empty_option_data_params COMMA option_data_param
-    | not_empty_option_data_params COMMA
+    | not_empty_option_data_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 // Each single option-data parameter can be one of the following
@@ -1907,7 +1953,9 @@ pools_list_content: %empty
 
 not_empty_pools_list: pool_list_entry
                     | not_empty_pools_list COMMA pool_list_entry
-                    | not_empty_pools_list COMMA
+                    | not_empty_pools_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 pool_list_entry: LCURLY_BRACKET {
@@ -1932,7 +1980,9 @@ sub_pool6: LCURLY_BRACKET {
 
 pool_params: pool_param
            | pool_params COMMA pool_param
-           | pool_params COMMA
+           | pool_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
            ;
 
 pool_param: pool_entry
@@ -2027,7 +2077,9 @@ 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
+                       | not_empty_pd_pools_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                        ;
 
 pd_pool_entry: LCURLY_BRACKET {
@@ -2056,7 +2108,9 @@ sub_pd_pool: LCURLY_BRACKET {
 
 pd_pool_params: pd_pool_param
               | pd_pool_params COMMA pd_pool_param
-              | pd_pool_params COMMA
+              | pd_pool_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 pd_pool_param: pd_prefix
@@ -2128,7 +2182,9 @@ reservations_list: %empty
 
 not_empty_reservations_list: reservation
                            | not_empty_reservations_list COMMA reservation
-                           | not_empty_reservations_list COMMA
+                           | not_empty_reservations_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 reservation: LCURLY_BRACKET {
@@ -2155,7 +2211,9 @@ reservation_params: %empty
 
 not_empty_reservation_params: reservation_param
     | not_empty_reservation_params COMMA reservation_param
-    | not_empty_reservation_params COMMA
+    | not_empty_reservation_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 /// @todo probably need to add mac-address as well here
@@ -2284,7 +2342,9 @@ client_classes: CLIENT_CLASSES {
 
 client_classes_list: client_class_entry
                    | client_classes_list COMMA client_class_entry
-                   | client_classes_list COMMA
+                   | client_classes_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                    ;
 
 client_class_entry: LCURLY_BRACKET {
@@ -2303,7 +2363,9 @@ 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
+    | not_empty_client_class_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 client_class_param: client_class_name
@@ -2356,7 +2418,9 @@ server_id: SERVER_ID {
 
 server_id_params: server_id_param
                 | server_id_params COMMA server_id_param
-                | server_id_params COMMA
+                | server_id_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                 ;
 
 server_id_param: server_id_type
@@ -2433,7 +2497,9 @@ control_socket: CONTROL_SOCKET {
 
 control_socket_params: control_socket_param
                      | control_socket_params COMMA control_socket_param
-                     | control_socket_params COMMA
+                     | control_socket_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 control_socket_param: socket_type
@@ -2479,7 +2545,9 @@ dhcp_queue_control: DHCP_QUEUE_CONTROL {
 
 queue_control_params: queue_control_param
                     | queue_control_params COMMA queue_control_param
-                    | queue_control_params COMMA
+                    | queue_control_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 queue_control_param: enable_queue
@@ -2546,7 +2614,9 @@ sub_dhcp_ddns: LCURLY_BRACKET {
 
 dhcp_ddns_params: dhcp_ddns_param
                 | dhcp_ddns_params COMMA dhcp_ddns_param
-                | dhcp_ddns_params COMMA
+                | dhcp_ddns_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                 ;
 
 dhcp_ddns_param: enable_updates
@@ -2723,7 +2793,9 @@ sub_config_control: LCURLY_BRACKET {
 // This defines that subnet can have one or more parameters.
 config_control_params: config_control_param
                      | config_control_params COMMA config_control_param
-                     | config_control_params COMMA
+                     | config_control_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 // This defines a list of allowed parameters for each subnet.
@@ -2765,7 +2837,9 @@ loggers: LOGGERS {
 // entry or multiple entries separate by commas.
 loggers_entries: logger_entry
                | loggers_entries COMMA logger_entry
-               | loggers_entries COMMA
+               | loggers_entries COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 // This defines a single entry defined in loggers.
@@ -2779,7 +2853,9 @@ logger_entry: LCURLY_BRACKET {
 
 logger_params: logger_param
              | logger_params COMMA logger_param
-             | logger_params COMMA
+             | logger_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 logger_param: name
@@ -2819,7 +2895,9 @@ output_options_list: OUTPUT_OPTIONS {
 
 output_options_list_content: output_entry
                            | output_options_list_content COMMA output_entry
-                           | output_options_list_content COMMA
+                           | output_options_list_content COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 output_entry: LCURLY_BRACKET {
@@ -2832,7 +2910,9 @@ output_entry: LCURLY_BRACKET {
 
 output_params_list: output_params
                   | output_params_list COMMA output_params
-                  | output_params_list COMMA
+                  | output_params_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                   ;
 
 output_params: output
@@ -2891,7 +2971,9 @@ compatibility: COMPATIBILITY {
 
 compatibility_params: compatibility_param
                     | compatibility_params COMMA compatibility_param
-                    | compatibility_params COMMA
+                    | compatibility_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                     ;
 
 compatibility_param: lenient_option_parsing
index be7b72deed686193c39a4ce36c0ef233d64f9710..ac1deee5a137ee4032782a6899c1386faabb6a86 100644 (file)
@@ -188,7 +188,9 @@ not_empty_map: STRING COLON value {
                   ctx.unique($3, ctx.loc2pos(@3));
                   ctx.stack_.back()->set($3, $5);
                   }
-             | not_empty_map COMMA
+             | not_empty_map COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 list_generic: LSQUARE_BRACKET {
@@ -209,7 +211,9 @@ not_empty_list: value {
                   // List ending with , and a value.
                   ctx.stack_.back()->add($3);
                   }
-              | not_empty_list COMMA
+              | not_empty_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
               ;
 
 // --- generic JSON parser ends here -------------------------------------------
@@ -257,7 +261,9 @@ global_object: NETCONF {
     ctx.stack_.pop_back();
     ctx.leave();
 }
-             | global_object COMMA
+             | global_object COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 global_params: %empty
@@ -266,7 +272,9 @@ global_params: %empty
 
 not_empty_global_params: global_param
                        | not_empty_global_params COMMA global_param
-                       | not_empty_global_params COMMA
+                       | not_empty_global_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                        ;
 
 // These are the parameters that are allowed in the top-level for
@@ -370,7 +378,9 @@ 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
+    | not_empty_hooks_libraries_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
     ;
 
 hooks_library: LCURLY_BRACKET {
@@ -383,7 +393,9 @@ hooks_library: LCURLY_BRACKET {
 
 hooks_params: hooks_param
             | hooks_params COMMA hooks_param
-            | hooks_params COMMA
+            | hooks_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
             | unknown_map_entry
             ;
 
@@ -428,7 +440,9 @@ servers_entries: %empty
 
 not_empty_servers_entries: server_entry
                          | not_empty_servers_entries COMMA server_entry
-                         | not_empty_servers_entries COMMA
+                         | not_empty_servers_entries COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                          ;
 
 
@@ -492,7 +506,9 @@ ca_server: CA_SERVER {
 // Server parameters consist of one or more parameters.
 managed_server_params: managed_server_param
                      | managed_server_params COMMA managed_server_param
-                     | managed_server_params COMMA
+                     | managed_server_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 // We currently support two server parameters: model and control-socket.
@@ -531,7 +547,9 @@ control_socket: CONTROL_SOCKET {
 // control-socket parameters
 control_socket_params: control_socket_param
                      | control_socket_params COMMA control_socket_param
-                     | control_socket_params COMMA
+                     | control_socket_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                      ;
 
 control_socket_param: socket_type
@@ -594,7 +612,9 @@ loggers: LOGGERS {
 // entry or multiple entries separate by commas.
 loggers_entries: logger_entry
                | loggers_entries COMMA logger_entry
-               | loggers_entries COMMA
+               | loggers_entries COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                ;
 
 // This defines a single entry defined in loggers.
@@ -608,7 +628,9 @@ logger_entry: LCURLY_BRACKET {
 
 logger_params: logger_param
              | logger_params COMMA logger_param
-             | logger_params COMMA
+             | logger_params COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 logger_param: name
@@ -657,7 +679,9 @@ output_options_list: OUTPUT_OPTIONS {
 
 output_options_list_content: output_entry
                            | output_options_list_content COMMA output_entry
-                           | output_options_list_content COMMA
+                           | output_options_list_content COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
                            ;
 
 output_entry: LCURLY_BRACKET {
@@ -670,7 +694,9 @@ output_entry: LCURLY_BRACKET {
 
 output_params_list: output_params
              | output_params_list COMMA output_params
-             | output_params_list COMMA
+             | output_params_list COMMA {
+    ctx.warning(@1, "Extraneous comma. A piece of configuration may have been omitted.");
+}
              ;
 
 output_params: output