gen_defines: add _CHILD_IDX macros for nodes with parents

These expose every node's index in its parent's list of children to C.
The root node has no parent, so no _CHILD_IDX macro is generated for
it.

Keep macros.bnf up to date with the new generated macros.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
diff --git a/scripts/dts/gen_defines.py b/scripts/dts/gen_defines.py
index 5c3b950..f8d72ed 100755
--- a/scripts/dts/gen_defines.py
+++ b/scripts/dts/gen_defines.py
@@ -132,6 +132,10 @@
                 out_dt_define(f"{node.z_path_id}_PARENT",
                               f"DT_{node.parent.z_path_id}")
 
+                out_comment(f"Node's index in its parent's list of children:")
+                out_dt_define(f"{node.z_path_id}_CHILD_IDX",
+                              node.parent.child_index(node))
+
             write_children(node)
             write_dep_info(node)
             write_idents_and_existence(node)