+
+/**
+ * Get completion items using the given grammar graph.
+ *
+ * The function pointer should not be called directly, the helpers
+ * @ec_complete(), ec_complete_strvec() or ec_complete_child() should be
+ * used instead.
+ *
+ * This function completes the last element of the string vector.
+ * For instance, node.type->complete(node, comp, ["ls"]) will
+ * list all commands that starts with "ls", while
+ * node.type->complete(node, comp, ["ls", ""]) will list all
+ * possible values for the next argument.
+ *
+ * The implementation of this function in the node is supposed
+ * to either:
+ * - call @ec_comp_add_item(node, comp, ...) for each completion item
+ * that should be added to the list. This is typically done in
+ * terminal nodes, for example in ec_node_str or ec_node_file.
+ * - call @ec_complete_child(child, comp, child_strvec) to let
+ * the children nodes add their own completion. This is the
+ * case of ec_node_or which trivially calls @ec_complete_child()
+ * on all its children, and of ec_node_seq, which has to
+ * do a more complex job (parsing strvec).
+ *
+ * A node that does not provide any method for the completion
+ * will fallback to ec_complete_unknown(): this helper returns
+ * a completion item of type EC_COMP_UNKNOWN, just to indicate
+ * that everything before the last element of the string vector
+ * has been parsed successfully, but we don't know how to
+ * complete the last element.
+ *
+ * @param node
+ * The root node of the grammar graph.
+ * @param comp
+ * The current list of completion items, to be filled by the
+ * node.type->complete() method.
+ * @param strvec
+ * The string vector to be completed.
+ * @return
+ * 0 on success, or a negative value on error (errno is set).
+ */
+typedef int (*ec_complete_t)(const struct ec_node *node,
+ struct ec_comp *comp,