aboutsummaryrefslogtreecommitdiff
path: root/src/prc1/print.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/prc1/print.h')
-rw-r--r--src/prc1/print.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/prc1/print.h b/src/prc1/print.h
index 950e0bc..061ead4 100644
--- a/src/prc1/print.h
+++ b/src/prc1/print.h
@@ -3,24 +3,31 @@
#include "cgen.h"
#include "lex.h"
+#include "prv.h"
#include <stddef.h>
-struct prientry
+struct prisym
{
- const struct tk *tk;
- const struct lit *lit;
- const struct stentry *entry;
+ enum {PRS_LIT, PRS_NAM, PRS_STR, PRS_PTR, PRS_NUM} type;
+ const struct sym *s;
+
+ union
+ {
+ const struct lit *lit;
+ const struct stentry *e;
+ const char *name;
+ } u;
};
struct print
{
- struct prientry *entries;
- size_t nentries;
- int println;
+ struct prisym *syms;
+ size_t nsyms;
+ int skipln;
};
-int print(const struct lex *l, struct prv *p,
- int (*fn)(const struct lex *, const struct prv *, const struct print *));
+int print(const struct lex *l, struct prv *p);
+int print_cgen(const struct print *pr, struct cgen *c, const char *f);
void print_free(struct print *p);
#endif