From 20aaa4a9899ce454d3c20594a2b7d2d3d38dbc88 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 14 Dec 2012 15:32:49 +0000 Subject: The first prototype for exhaustive generation in the C runtime. The trees are always listed in decreasing probability order. There is also an API for generation from Python --- src/runtime/c/pgf/pgf.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/runtime/c/pgf/pgf.h') diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index 9963534b5..1f3947bff 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -54,6 +54,9 @@ extern GU_DECLARE_TYPE(PgfConcr, struct); #include #include +/// An enumeration of #PgfExpr elements. +typedef GuEnum PgfExprEnum; + PgfPGF* pgf_read(const char* fpath, GuPool* pool, GuExn* err); @@ -109,9 +112,12 @@ pgf_print_name(PgfConcr*, PgfCId id); void pgf_linearize(PgfConcr* concr, PgfExpr expr, GuWriter* wtr, GuExn* err); -GuEnum* +PgfExprEnum* pgf_parse(PgfConcr* concr, PgfCId cat, PgfLexer *lexer, GuPool* pool); +PgfExprEnum* +pgf_generate(PgfPGF* pgf, PgfCId cat, GuPool* pool); + // an experimental function. Please don't use it void pgf_print_chunks(PgfConcr* concr, PgfCId cat, PgfLexer *lexer, GuPool* pool); -- cgit v1.2.3