New module for parser functions

Same principle as main->lib (previous commit).
This commit is contained in:
2023-09-02 16:14:49 +01:00
parent c9b6b04d19
commit e5cba43a0e
4 changed files with 178 additions and 157 deletions

32
parser.h Normal file
View File

@@ -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