summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2010-07-28 00:57:23 -0700
committerDavid Schleef <ds@schleef.org>2010-07-28 01:01:14 -0700
commit1ec9e071beefa0a35a7936507c52eb0bb60f9841 (patch)
tree51c5ff7f4559d40f796888f4ae5c48edbf08ed65 /tools
parent7f2bba8d1998ac44b66e68651550c4292c4d728b (diff)
Add logging to orc_parse
And (finally) some error reporting in orcc.
Diffstat (limited to 'tools')
-rw-r--r--tools/orcc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/orcc.c b/tools/orcc.c
index 4759f53..e855523 100644
--- a/tools/orcc.c
+++ b/tools/orcc.c
@@ -77,6 +77,7 @@ main (int argc, char *argv[])
char *include_file = NULL;
char *compat_version = VERSION;
FILE *output;
+ char *log = NULL;
orc_init ();
orc_test_init ();
@@ -171,12 +172,19 @@ main (int argc, char *argv[])
}
if (output_file == NULL) {
- if (mode == MODE_IMPL) {
- output_file = "out.c";
- } else if (mode == MODE_HEADER) {
- output_file = "out.h";
- } else if (mode == MODE_TEST) {
- output_file = "out_test.c";
+ switch (mode) {
+ case MODE_IMPL:
+ output_file = "out.c";
+ break;
+ case MODE_HEADER:
+ output_file = "out.h";
+ break;
+ case MODE_TEST:
+ output_file = "out_test.c";
+ break;
+ case MODE_ASSEMBLY:
+ output_file = "out.s";
+ break;
}
}
@@ -186,7 +194,8 @@ main (int argc, char *argv[])
exit(1);
}
- n = orc_parse (code, &programs);
+ n = orc_parse_full (code, &programs, &log);
+ printf("%s", log);
output = fopen (output_file, "w");
if (!output) {