first working version of ec_node_cond (still in progress)
[protos/libecoli.git] / include / ecoli_node_cond.h
diff --git a/include/ecoli_node_cond.h b/include/ecoli_node_cond.h
new file mode 100644 (file)
index 0000000..37da1a4
--- /dev/null
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2019, Olivier MATZ <zer0@droids-corp.org>
+ */
+
+/**
+ * The condition node checks that an expression is true before
+ * parsing/completing the child node. If it is false, the node
+ * doesn't match anything.
+ */
+
+#ifndef ECOLI_NODE_COND_
+#define ECOLI_NODE_COND_
+
+struct ec_node;
+
+/**
+ * Create a condition node.
+ *
+ * @param id
+ *   The node identifier.
+ * @param cond_str
+ *   The condition string. This is an function-based expression.
+ * @param child
+ *   The ecoli child node.
+ * @return
+ *   The new ecoli cond node.
+ */
+struct ec_node *ec_node_cond(const char *id, const char *cond_str,
+       struct ec_node *child);
+
+#endif