diff options
author | ubq323 <ubq323@ubq323.website> | 2024-08-06 22:20:53 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-08-06 22:20:53 +0100 |
commit | a4e8599e8d0fde881cd4e6e3031e5b52550e878e (patch) | |
tree | 41f455835a76442eb2442754f5d4fd15c915f721 /ast.h | |
parent | e4a7b6c397c430e3aa5f6fec63eeb91236069c27 (diff) |
remove ast and peg parser
Diffstat (limited to 'ast.h')
-rw-r--r-- | ast.h | 51 |
1 files changed, 0 insertions, 51 deletions
@@ -1,51 +0,0 @@ -#ifndef _ast_h -#define _ast_h - -#include <stdlib.h> -#include <stddef.h> - -typedef enum { - AST_LIST, - AST_NUM, - AST_IDENT, - AST_STRING, - AST_ARR, -} AstTy; - -struct _astnode; -typedef struct _astnode AstNode; - -typedef struct { - size_t len; - size_t cap; - AstNode *vals; -} AstVec; - -struct _astnode { - AstTy ty; - union { - int num; - AstVec list; - char *str; - } as; -}; - - -AstVec astvec_new(); -void astvec_append(AstVec *v, AstNode val); -void astnode_append(AstNode *l, AstNode val); - -AstNode astnode_new_num(int n); -AstNode astnode_new_list(); -AstNode astnode_new_arr(); -AstNode astnode_new_ident(const char *s); -AstNode astnode_new_string(const char *s); - -void astnode_disp(AstNode *a); -void astnode_free(AstNode *a); - -const char *ast_ty_to_str(AstTy ty); - - - -#endif |