summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/parser.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2012-05-08 12:13:28 +0000
committerkr.angelov <kr.angelov@gmail.com>2012-05-08 12:13:28 +0000
commita6800fc0da1d90dad0362c806037f9a92ab3e813 (patch)
treead383d165e5d2fe36fe10729d83ff5aa201b0f6c /src/runtime/c/pgf/parser.h
parent931066f6fc004c7a193e5200d13ea651c7e02fd1 (diff)
a new unbiased statistical parser. it is still far from perfect use it on your own risk.
Diffstat (limited to 'src/runtime/c/pgf/parser.h')
-rw-r--r--src/runtime/c/pgf/parser.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/runtime/c/pgf/parser.h b/src/runtime/c/pgf/parser.h
index 4e42fbaa0..b1dc3f32b 100644
--- a/src/runtime/c/pgf/parser.h
+++ b/src/runtime/c/pgf/parser.h
@@ -15,7 +15,7 @@
* @todo HOAS, dependent types...
*/
-typedef struct PgfParse PgfParse;
+typedef struct PgfParseState PgfParseState;
/** @}
*
@@ -32,8 +32,9 @@ typedef struct PgfParse PgfParse;
*/
/// Begin parsing
-PgfParse*
-pgf_parser_parse(PgfConcr* concr, PgfCId cat, size_t lin_idx, GuPool* pool);
+PgfParseState*
+pgf_parser_init_state(PgfConcr* concr, PgfCId cat, size_t lin_idx,
+ GuPool* pool);
/**<
* @param parser The parser to use
*
@@ -48,8 +49,9 @@ pgf_parser_parse(PgfConcr* concr, PgfCId cat, size_t lin_idx, GuPool* pool);
/// Feed a token to the parser
-PgfParse*
-pgf_parse_token(PgfParse* parse, PgfToken tok, bool robust, GuPool* pool);
+PgfParseState*
+pgf_parser_next_state(PgfParseState* prev, PgfToken tok,
+ GuPool* pool);
/**<
* @param parse The current parse state
*
@@ -87,7 +89,7 @@ typedef GuEnum PgfExprEnum;
/// Retrieve the current parses from the parse state.
PgfExprEnum*
-pgf_parse_result(PgfParse* parse, GuPool* pool);
+pgf_parse_result(PgfParseState* state, GuPool* pool);
/**<
* @param parse A parse state
*
@@ -101,7 +103,7 @@ pgf_parse_result(PgfParse* parse, GuPool* pool);
*/
PgfExpr
-pgf_parse_best_result(PgfParse* parse, GuPool* pool);
+pgf_parse_best_result(PgfParseState* state, GuPool* pool);
int