diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-10-30 01:13:34 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-10-30 01:13:34 -0400 |
commit | d615d6795ee81e59795081b7fb2524978b6aa9cb (patch) | |
tree | 5ba19b6c55df2332ff71a795f11f590caf59c16d /dimension/parse.h | |
parent | f5f8d18d86e15e0bd14f955768edb616e1357a66 (diff) | |
download | dimension-d615d6795ee81e59795081b7fb2524978b6aa9cb.tar.xz |
(Sort of) parse boxes.
Diffstat (limited to 'dimension/parse.h')
-rw-r--r-- | dimension/parse.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/dimension/parse.h b/dimension/parse.h index d51144a..aa6ee58 100644 --- a/dimension/parse.h +++ b/dimension/parse.h @@ -19,8 +19,26 @@ #include "../libdimension/dimension.h" +typedef enum { + DMNSN_AST_FLOAT, + DMNSN_AST_VECTOR, + DMNSN_AST_BOX, +} dmnsn_astnode_type; + +typedef struct dmnsn_astnode dmnsn_astnode; + +struct dmnsn_astnode { + dmnsn_astnode_type type; + + /* Child nodes */ + dmnsn_array *children; + + /* Generic data pointer */ + void *ptr; +}; + /* The workhorse */ -dmnsn_array *dmnsn_parse(dmnsn_array *tokens); +dmnsn_array *dmnsn_parse(const dmnsn_array *tokens); /* Free an abstract syntax tree */ void dmnsn_delete_astree(dmnsn_array *astree); |