diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2003-04-14 06:04:49 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2003-04-14 06:04:49 +0000 |
| commit | 7aae14e9b83242c2778e57c069fb8f299b8172f3 (patch) | |
| tree | 80892567a99c251b0ae957c51309645b6d27dc98 /obcl/obcl.h | |
| parent | 69854023a4f36deb80c7c3dee891acc48f8ae6da (diff) | |
beginning of obcl. the parser works with semicolons after statements
for now, there is much left to change and do.
Diffstat (limited to 'obcl/obcl.h')
| -rw-r--r-- | obcl/obcl.h | 38 |
1 files changed, 38 insertions, 0 deletions
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 <stdio.h> +#include <stdlib.h> +#include <glib.h> + +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 */ |
