diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-09-05 17:14:53 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-09-26 03:41:55 +0200 |
| commit | 3c0819236e4f07c8f57aaf1ca46d0d68aa761558 (patch) | |
| tree | bd8b57cf5420cabc4ec29815052df545b55026f9 /parse.h | |
| parent | a3f56c76444fee090e62a59f257ed5f60b4e552b (diff) | |
| download | prc-3c0819236e4f07c8f57aaf1ca46d0d68aa761558.tar.gz | |
Move source to src/prc1
Diffstat (limited to 'parse.h')
| -rw-r--r-- | parse.h | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/parse.h b/parse.h deleted file mode 100644 index b85d618..0000000 --- a/parse.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef PARSE_H -#define PARSE_H - -#include "lex.h" -#include "storage.h" - -struct u -{ - struct storage *storage; -}; - -struct s -{ - struct storage *storage; -}; - -union c -{ - unsigned long long uv; - long long v; -}; - -struct p -{ - struct fn *fn; -}; - -struct t -{ - const struct type *alias; -}; - -struct ptr -{ - const struct type *t; -}; - -struct ary -{ - unsigned long long n; - int etc; -}; - -struct builtin -{ - const char *name; -}; - -struct type -{ - enum {U, S, C, P, T, PTR, ARY, BUILTIN} type; - const struct tk *tk; - size_t sz, align; - int sign; - struct type *child, *next; - - union - { - struct u u; - struct s s; - union c c; - struct p p; - struct t t; - struct ptr ptr; - struct ary ary; - struct builtin b; - } u; -}; - -struct param -{ - const struct tk *tk; - const struct stentry *entry; -}; - -struct pr -{ - const struct tk *tk; - struct param *params, *ret; - size_t nparams; - int variadic; -}; - -struct td -{ - const struct tk *tk; - struct type *types; - size_t ntypes; -}; - -struct tmp -{ - struct tk tk; - struct stentry e; - struct tmp *next; -}; - -struct fn -{ - const struct tk *tk, *im; - const struct fn *parent; - enum linkage {EXTERNAL, STATIC} linkage; - struct storage *lk, *ws, *gl; - struct stmt *stmts; - struct tmp *tmps; - struct im *imps; - struct pr *pr; - struct td *td; - size_t nstmts, nimps, nblocks, ntmps, *blocks; -}; - -struct lit -{ - char *name; - const struct tk *tk; - const struct fn *fn; - struct lit *next; -}; - -struct ast -{ - struct fn *fns; - struct lit *lits, *lastlit; - struct type *types; - size_t nfns, litcnt; -}; - -struct im -{ - struct lex l; - struct ast ast; -}; - -int parse(const struct lex *l, struct ast *ast); -int parse_im(const struct lex *l, struct ast *ast); -void ast_free(struct ast *ast); - -#endif |
