Code

parser: Add support for analyzing conditional and arithmetic expressions.
[sysdb.git] / src / include / parser / parser.h
index 9235ef5820267789cdb77005a6db04dafd602334..92e49bbd39c5db674f5208c6259baffe5037e2d8 100644 (file)
@@ -72,6 +72,42 @@ sdb_parser_parse_conditional(const char *cond, int len, sdb_strbuf_t *errbuf);
 sdb_ast_node_t *
 sdb_parser_parse_arith(const char *expr, int len, sdb_strbuf_t *errbuf);
 
+/*
+ * sdb_parser_analyze:
+ * Semantical analysis of a parse-tree.
+ *
+ * Returns:
+ *  - 0 on success
+ *  - a negative value else; an error message will be written to the provided
+ *    error buffer
+ */
+int
+sdb_parser_analyze(sdb_ast_node_t *node, sdb_strbuf_t *errbuf);
+
+/*
+ * sdb_parser_analyze_conditional:
+ * Semantical analysis of a conditional node.
+ *
+ * Returns:
+ *  - 0 on success
+ *  - a negative value else; an error message will be written to the provided
+ *    error buffer
+ */
+int
+sdb_parser_analyze_conditional(sdb_ast_node_t *node, sdb_strbuf_t *errbuf);
+
+/*
+ * sdb_parser_analyze_arith:
+ * Semantical analysis of an arithmetic node.
+ *
+ * Returns:
+ *  - 0 on success
+ *  - a negative value else; an error message will be written to the provided
+ *    error buffer
+ */
+int
+sdb_parser_analyze_arith(sdb_ast_node_t *node, sdb_strbuf_t *errbuf);
+
 /*
  * Low-level interface.
  */