summaryrefslogtreecommitdiff
path: root/parse/names.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-01-06 13:29:51 -0800
committerOri Bernstein <ori@eigenstate.org>2015-01-06 13:29:51 -0800
commitc96b770a0aa93c1e7b99e5874808af85ddacc6a7 (patch)
treed60d4652014bc44186663f7afaea3338281124ae /parse/names.c
parent468265b7b2719d783afc46ea5aa7c9ffa3142970 (diff)
downloadmc-c96b770a0aa93c1e7b99e5874808af85ddacc6a7.tar.gz
Improve error messages.
This involved lots of table changes.
Diffstat (limited to 'parse/names.c')
-rw-r--r--parse/names.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/parse/names.c b/parse/names.c
index dddd649..3a0009d 100644
--- a/parse/names.c
+++ b/parse/names.c
@@ -11,52 +11,45 @@
#include "parse.h"
-static char *optab[] = {
-#define O(op, pure) #op,
+char *opstr[] = {
+#define O(op, pure, class, pretty) #op,
#include "ops.def"
#undef O
};
-int ispureop[] = {
-#define O(op, pure) pure,
+char * oppretty[] = {
+#define O(op, pure, class, pretty) pretty,
#include "ops.def"
#undef O
};
-static char *nodetab[] = {
+
+int opispure[] = {
+#define O(op, pure, class, pretty) pure,
+#include "ops.def"
+#undef O
+};
+
+int opclass[] = {
+#define O(op, pure, class, pretty) class,
+#include "ops.def"
+#undef O
+};
+
+char *nodestr[] = {
#define N(nt) #nt,
#include "nodes.def"
#undef N
};
-static char *littab[] = {
+char *litstr[] = {
#define L(lt) #lt,
#include "lits.def"
#undef L
};
-static char *tidtab[] = {
+char *tidstr[] = {
#define Ty(t, n) n,
#include "types.def"
#undef Ty
};
-
-char *opstr(Op o)
-{
- return optab[o];
-}
-
-char *nodestr(Ntype nt)
-{
- return nodetab[nt];
-}
-
-char *litstr(Littype lt)
-{
- return littab[lt];
-}
-
-char *tidstr(Ty tid)
-{
- return tidtab[tid];
-}