diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2012-12-13 14:44:33 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2012-12-13 14:44:33 +0000 |
| commit | 14e721dda9a38762695ac5435c24818265629b02 (patch) | |
| tree | 9dc11a3db929482f9b4f6cb8bf59978c9288d818 /src/runtime/c/pgf/pgf.h | |
| parent | 68249a11d2daf6a7d639110e218418af84fa75d2 (diff) | |
a top-level API for parsing in the C runtime
Diffstat (limited to 'src/runtime/c/pgf/pgf.h')
| -rw-r--r-- | src/runtime/c/pgf/pgf.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index 40b290617..9963534b5 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -28,6 +28,7 @@ #include <gu/exn.h> #include <gu/mem.h> #include <gu/map.h> +#include <gu/enum.h> #include <gu/string.h> @@ -37,19 +38,21 @@ extern GU_DECLARE_TYPE(PgfCId, typedef); extern GU_DECLARE_TYPE(PgfExn, abstract); - -/// A single lexical token -typedef GuString PgfToken; - /// @name PGF Grammar objects /// @{ typedef struct PgfPGF PgfPGF; +extern GU_DECLARE_TYPE(PgfPGF, struct); + typedef struct PgfConcr PgfConcr; +extern GU_DECLARE_TYPE(PgfConcr, struct); + /**< A representation of a PGF grammar. */ +#include <pgf/expr.h> +#include <pgf/lexer.h> PgfPGF* pgf_read(const char* fpath, @@ -103,8 +106,16 @@ pgf_iter_functions_by_cat(PgfPGF* pgf, PgfCId catname, GuString pgf_print_name(PgfConcr*, PgfCId id); -#include <gu/type.h> -extern GU_DECLARE_TYPE(PgfPGF, struct); +void +pgf_linearize(PgfConcr* concr, PgfExpr expr, GuWriter* wtr, GuExn* err); + +GuEnum* +pgf_parse(PgfConcr* concr, PgfCId cat, PgfLexer *lexer, GuPool* pool); + +// an experimental function. Please don't use it +void +pgf_print_chunks(PgfConcr* concr, PgfCId cat, PgfLexer *lexer, GuPool* pool); + /// @} |
