Make CTF metadata parser reentrant
[babeltrace.git] / formats / ctf / metadata / ctf-ast.h
index b839b2c694991cec9d2347d33cc20fef7dd1aa04..34d00367fc396ab93af2775c1dd677c6a563ae59 100644 (file)
@@ -2,6 +2,18 @@
 #define _CTF_PARSER_H
 
 #include <helpers/list.h>
+#include <stdio.h>
+#include <glib.h>
+
+// the parameter name (of the reentrant 'yyparse' function)
+// data is a pointer to a 'SParserParam' structure
+//#define YYPARSE_PARAM        scanner
+
+// the argument for the 'yylex' function
+#define YYLEX_PARAM    ((struct ctf_scanner *) scanner)->scanner
+
+struct ctf_node;
+struct ctf_parser;
 
 enum node_type {
        NODE_UNKNOWN,
@@ -14,8 +26,6 @@ enum node_type {
        NR_NODE_TYPES,
 };
 
-struct ctf_node;
-
 struct ctf_node {
        enum node_type type;
        char *str;
@@ -27,6 +37,14 @@ struct ctf_node {
        struct cds_list_head gc;
 };
 
-int is_type(const char *id);
+struct scope;
+struct scope {
+       struct scope *parent;
+       GHashTable *types;
+};
+
+struct ctf_ast {
+       struct ctf_node root;
+};
 
 #endif /* _CTF_PARSER_H */
This page took 0.024872 seconds and 4 git commands to generate.