From 7aae14e9b83242c2778e57c069fb8f299b8172f3 Mon Sep 17 00:00:00 2001 From: Marius Nita Date: Mon, 14 Apr 2003 06:04:49 +0000 Subject: beginning of obcl. the parser works with semicolons after statements for now, there is much left to change and do. --- obcl/obcl.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 obcl/obcl.h (limited to 'obcl/obcl.h') diff --git a/obcl/obcl.h b/obcl/obcl.h new file mode 100644 index 00000000..a940e89d --- /dev/null +++ b/obcl/obcl.h @@ -0,0 +1,38 @@ +#ifndef __obcl_h +#define __obcl_h + +#include +#include +#include + +typedef enum CLNodeType { + CL_ID, + CL_NUM, + CL_STR, + CL_LIST, + CL_BLOCK, + CL_LISTBLOCK +} CLNodeType; + +typedef struct CLNode { + CLNodeType type; + union { + struct { + gchar *id; + GList *list; + GList *block; + } lb; + double num; + gchar *str; + } u; + +} CLNode; + +void free_cl_tree(GList *tree); +GList *cl_parse(gchar *file); +GList *cl_parse_fh(FILE *file); +void cl_print_tree(GList *tree, int depth); + +GList *parse_file(FILE *fh); + +#endif /* __obcl_h */ -- cgit v1.2.3