summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/pgf.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2012-12-12 11:25:58 +0000
committerkr.angelov <kr.angelov@gmail.com>2012-12-12 11:25:58 +0000
commitaa13090b66d7ee1ffc68ad242c6419a83cf364d9 (patch)
treed36bacbc5f4e0990aae925da31ddeaf2a465a003 /src/runtime/c/pgf/pgf.h
parent5e091d2e3dc428daa1d4b0d8df6e7b613adc22a9 (diff)
started an official API to the C runtime
Diffstat (limited to 'src/runtime/c/pgf/pgf.h')
-rw-r--r--src/runtime/c/pgf/pgf.h43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h
index 3913d9fd2..40b290617 100644
--- a/src/runtime/c/pgf/pgf.h
+++ b/src/runtime/c/pgf/pgf.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 University of Helsinki.
+ * Copyright 2010 University of Gothenburg.
*
* This file is part of libpgf.
*
@@ -27,7 +27,7 @@
#include <gu/exn.h>
#include <gu/mem.h>
-#include <gu/in.h>
+#include <gu/map.h>
#include <gu/string.h>
@@ -35,20 +35,25 @@ typedef GuString PgfCId;
extern GU_DECLARE_TYPE(PgfCId, typedef);
+extern GU_DECLARE_TYPE(PgfExn, abstract);
+
+
/// A single lexical token
-typedef GuString PgfToken;
+typedef GuString PgfToken;
/// @name PGF Grammar objects
/// @{
typedef struct PgfPGF PgfPGF;
+typedef struct PgfConcr PgfConcr;
/**< A representation of a PGF grammar.
*/
PgfPGF*
-pgf_read(GuIn* in, GuPool* pool, GuExn* err);
+pgf_read(const char* fpath,
+ GuPool* pool, GuExn* err);
/**< Read a grammar from a PGF file.
*
@@ -69,10 +74,34 @@ pgf_read(GuIn* in, GuPool* pool, GuExn* err);
*/
-bool
-pgf_load_meta_child_probs(PgfPGF*, const char* fpath, GuPool* pool);
+void
+pgf_load_meta_child_probs(PgfPGF*, const char* fpath,
+ GuPool* pool, GuExn* err);
+
+GuString
+pgf_abstract_name(PgfPGF*);
-typedef struct PgfConcr PgfConcr;
+void
+pgf_iter_languages(PgfPGF*, GuMapItor*, GuExn* err);
+
+PgfConcr*
+pgf_get_language(PgfPGF*, PgfCId lang);
+
+void
+pgf_iter_categories(PgfPGF* pgf, GuMapItor* fn, GuExn* err);
+
+PgfCId
+pgf_start_cat(PgfPGF* pgf, GuPool* pool);
+
+void
+pgf_iter_functions(PgfPGF* pgf, GuMapItor* fn, GuExn* err);
+
+void
+pgf_iter_functions_by_cat(PgfPGF* pgf, PgfCId catname,
+ GuMapItor* fn, GuExn* err);
+
+GuString
+pgf_print_name(PgfConcr*, PgfCId id);
#include <gu/type.h>
extern GU_DECLARE_TYPE(PgfPGF, struct);