Code

store: Add sdb_store_query_prepare_matcher().
[sysdb.git] / src / include / frontend / parser.h
index e763afc805a68081493baf295149b6b1c7221e22..766570157e426cfdab440db1b10be8ac958d8147 100644 (file)
@@ -39,9 +39,14 @@ extern "C" {
 
 /* parser modes */
 enum {
+       /* parser accepts any command statement */
        SDB_PARSE_DEFAULT = 0,
+
+       /* parser accepts any conditional statement */
        SDB_PARSE_COND    = 1 << 1,
-       SDB_PARSE_EXPR    = 1 << 2,
+
+       /* parser accepts any arithmetic expression */
+       SDB_PARSE_ARITH   = 1 << 2,
 };
 
 /* YY_EXTRA data */
@@ -76,14 +81,15 @@ sdb_fe_parse_expr(const char *expr, int len, sdb_strbuf_t *errbuf);
 
 /*
  * sdb_fe_analyze:
- * Analyze a parsed node, checking for semantical errors.
+ * Analyze a parsed node, checking for semantical errors. Error messages will
+ * be written to the string buffer, if provided.
  *
  * Returns:
  *  - 0 if the node is semantically correct
  *  - a negative value else
  */
 int
-sdb_fe_analyze(sdb_conn_node_t *node);
+sdb_fe_analyze(sdb_conn_node_t *node, sdb_strbuf_t *errbuf);
 
 #ifdef __cplusplus
 } /* extern "C" */