diff options
| author | xXx-caillou-xXx | 2017-12-20 18:28:21 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-20 18:28:21 +0100 |
| commit | f2a87d34f6469af1715608412fc5454e177d0901 (patch) | |
| tree | 0b8abb1b33f00559642429a2c561b658443837f0 /src/sp_tree.h | |
| parent | e7f541396715ee2895abcf73044b91ae9b746201 (diff) | |
Refactor a bit the sp_tree implementation
Diffstat (limited to 'src/sp_tree.h')
| -rw-r--r-- | src/sp_tree.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sp_tree.h b/src/sp_tree.h new file mode 100644 index 0000000..c831736 --- /dev/null +++ b/src/sp_tree.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #ifndef SP_TREE_H | ||
| 2 | #define SP_TREE_H | ||
| 3 | #include "php_snuffleupagus.h" | ||
| 4 | |||
| 5 | typedef enum { | ||
| 6 | UNDEFINED = 0, | ||
| 7 | OBJECT, | ||
| 8 | ARRAY, | ||
| 9 | ARRAY_END, | ||
| 10 | STRING_DELIMITER, | ||
| 11 | CLASS, | ||
| 12 | VAR, | ||
| 13 | ESC_STRING_DELIMITER, | ||
| 14 | CONSTANT | ||
| 15 | } elem_type; | ||
| 16 | |||
| 17 | typedef struct parser_s { | ||
| 18 | elem_type type; | ||
| 19 | char *value; | ||
| 20 | struct parser_s *idx; | ||
| 21 | struct parser_s *next; | ||
| 22 | } sp_tree; | ||
| 23 | |||
| 24 | sp_tree *sp_tree_new(); | ||
| 25 | void sp_tree_free(sp_tree *); | ||
| 26 | |||
| 27 | #endif | ||
