summaryrefslogtreecommitdiff
path: root/src/runtime/c/utils
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-10-09 13:44:26 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-10-09 13:44:26 +0000
commit86e9acc7a7b714307e08ab25117ca03cecb00936 (patch)
tree38dd7904147567c4e97e1f62eca64739d3a516eb /src/runtime/c/utils
parent8e3ed825a8dde13894a44169ddc09cc2c2be60b2 (diff)
throw away the long obsolete runtime type information in the C runtime
Diffstat (limited to 'src/runtime/c/utils')
-rw-r--r--src/runtime/c/utils/pgf-parse.c4
-rw-r--r--src/runtime/c/utils/pgf-print.c4
-rw-r--r--src/runtime/c/utils/pgf-translate.c10
3 files changed, 8 insertions, 10 deletions
diff --git a/src/runtime/c/utils/pgf-parse.c b/src/runtime/c/utils/pgf-parse.c
index 1ecb936a1..991a16361 100644
--- a/src/runtime/c/utils/pgf-parse.c
+++ b/src/runtime/c/utils/pgf-parse.c
@@ -36,7 +36,7 @@ int main(int argc, char* argv[]) {
}
// Create an exception frame that catches all errors.
- GuExn* err = gu_new_exn(NULL, gu_kind(type), pool);
+ GuExn* err = gu_new_exn(pool);
clock_t start = clock();
@@ -109,7 +109,7 @@ int main(int argc, char* argv[]) {
clock_t start = clock();
- GuExn* parse_err = gu_new_exn(NULL, gu_kind(type), ppool);
+ GuExn* parse_err = gu_new_exn(ppool);
GuEnum* result = pgf_parse_with_heuristics(concr, cat, line, heuristics, parse_err, ppool, ppool);
PgfExprProb* ep = NULL;
diff --git a/src/runtime/c/utils/pgf-print.c b/src/runtime/c/utils/pgf-print.c
index b937ed46c..07b343a4d 100644
--- a/src/runtime/c/utils/pgf-print.c
+++ b/src/runtime/c/utils/pgf-print.c
@@ -7,8 +7,6 @@
#include <locale.h>
#include <stdlib.h>
-GU_DECLARE_TYPE(PgfAbstr, struct);
-
int main(int argc, char* argv[]) {
// Set the character locale, so we can produce proper output.
setlocale(LC_CTYPE, "");
@@ -20,7 +18,7 @@ int main(int argc, char* argv[]) {
char* filename = argv[1];
GuPool* pool = gu_new_pool();
- GuExn* err = gu_exn(NULL, type, pool);
+ GuExn* err = gu_exn(pool);
PgfPGF* pgf = pgf_read(filename, pool, err);
int status = 0;
if (!gu_ok(err)) {
diff --git a/src/runtime/c/utils/pgf-translate.c b/src/runtime/c/utils/pgf-translate.c
index fbc6e553e..6a3a24b16 100644
--- a/src/runtime/c/utils/pgf-translate.c
+++ b/src/runtime/c/utils/pgf-translate.c
@@ -36,7 +36,7 @@ print_result(PgfExprProb* ep, PgfConcr* to_concr,
// sequence of strings.
pgf_lzr_linearize_simple(to_concr, ctree, 0, out, err, ppool);
- if (gu_exn_caught(err) == gu_type(PgfLinNonExist)) {
+ if (gu_exn_caught(err, PgfLinNonExist)) {
// encountered nonExist. Unfortunately there
// might be some output printed already. The
// right solution should be to use GuStringBuf.
@@ -66,7 +66,7 @@ int main(int argc, char* argv[]) {
GuString to_lang = argv[4];
// Create an exception frame that catches all errors.
- GuExn* err = gu_new_exn(NULL, gu_kind(type), pool);
+ GuExn* err = gu_new_exn(pool);
// Read the PGF grammar.
PgfPGF* pgf = pgf_read(filename, pool, err);
@@ -152,15 +152,15 @@ int main(int argc, char* argv[]) {
clock_t start = clock();
- GuExn* parse_err = gu_new_exn(NULL, gu_kind(type), ppool);
+ GuExn* parse_err = gu_new_exn(ppool);
result =
pgf_parse(from_concr, cat, line, parse_err, ppool, ppool);
if (!gu_ok(parse_err)) {
- if (gu_exn_caught(parse_err) == gu_type(PgfExn)) {
+ if (gu_exn_caught(parse_err, PgfExn)) {
GuString msg = gu_exn_caught_data(parse_err);
gu_string_write(msg, out, err);
gu_putc('\n', out, err);
- } else if (gu_exn_caught(parse_err) == gu_type(PgfParseError)) {
+ } else if (gu_exn_caught(parse_err, PgfParseError)) {
gu_puts("Unexpected token: \"", out, err);
GuString tok = gu_exn_caught_data(parse_err);
gu_string_write(tok, out, err);