diff options
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/parser.h b/parser.h new file mode 100644 index 0000000..70ed4ff --- /dev/null +++ b/parser.h @@ -0,0 +1,32 @@ +#ifndef PARSER_H +#define PARSER_H + +#include "./lib.h" + +typedef struct AST +{ + size_t col, row; + enum + { + NEXT = 0, + PREV, + INC, + DEC, + OUT, + READ, + LIN, + LOUT + } type; + int loop_ref; +} node_t; + +struct PResult +{ + node_t *nodes; + size_t size; +}; + +char *ast_to_str(node_t *ast, size_t size); +struct PResult parse_buffer(buffer_t *buffer); + +#endif |