From ce0546536588d5debe82770ef6bcf1efff6682f6 Mon Sep 17 00:00:00 2001 From: krasimir Date: Mon, 18 May 2015 14:41:33 +0000 Subject: the callbacks in C now take the concrete syntax as a parameter --- src/runtime/c/pgf/literals.c | 10 +++++----- src/runtime/c/pgf/parser.c | 2 +- src/runtime/c/pgf/pgf.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/runtime/c') diff --git a/src/runtime/c/pgf/literals.c b/src/runtime/c/pgf/literals.c index aea358be5..52ecc1e6e 100644 --- a/src/runtime/c/pgf/literals.c +++ b/src/runtime/c/pgf/literals.c @@ -5,7 +5,7 @@ static PgfExprProb* -pgf_match_string_lit(PgfLiteralCallback* self, +pgf_match_string_lit(PgfLiteralCallback* self, PgfConcr* concr, size_t lin_idx, GuString sentence, size_t* poffset, GuPool *out_pool) @@ -50,7 +50,7 @@ pgf_predict_empty_next(GuEnum* self, void* to, GuPool* pool) } static GuEnum* -pgf_predict_empty(PgfLiteralCallback* self, +pgf_predict_empty(PgfLiteralCallback* self, PgfConcr* concr, size_t lin_idx, GuString prefix, GuPool *out_pool) @@ -66,7 +66,7 @@ static PgfLiteralCallback pgf_string_literal_callback = static PgfExprProb* -pgf_match_int_lit(PgfLiteralCallback* self, +pgf_match_int_lit(PgfLiteralCallback* self, PgfConcr* concr, size_t lin_idx, GuString sentence, size_t* poffset, GuPool *out_pool) @@ -120,7 +120,7 @@ static PgfLiteralCallback pgf_int_literal_callback = static PgfExprProb* -pgf_match_float_lit(PgfLiteralCallback* self, +pgf_match_float_lit(PgfLiteralCallback* self, PgfConcr* concr, size_t lin_idx, GuString sentence, size_t* poffset, GuPool *out_pool) @@ -174,7 +174,7 @@ static PgfLiteralCallback pgf_float_literal_callback = static PgfExprProb* -pgf_match_name_lit(PgfLiteralCallback* self, +pgf_match_name_lit(PgfLiteralCallback* self, PgfConcr* concr, size_t lin_idx, GuString sentence, size_t* poffset, GuPool *out_pool) diff --git a/src/runtime/c/pgf/parser.c b/src/runtime/c/pgf/parser.c index f3479949a..3d494269b 100644 --- a/src/runtime/c/pgf/parser.c +++ b/src/runtime/c/pgf/parser.c @@ -1473,7 +1473,7 @@ pgf_parsing_symbol(PgfParsing* ps, PgfItem* item, PgfSymbol sym) size_t start = ps->before->end_offset; size_t offset = start; PgfExprProb *ep = - callback->match(callback, + callback->match(callback, ps->concr, slit->r, ps->sentence, &offset, ps->out_pool); diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index e2fc6f74d..3e2e88006 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -150,11 +150,11 @@ pgf_complete(PgfConcr* concr, PgfCId cat, GuString string, typedef struct PgfLiteralCallback PgfLiteralCallback; struct PgfLiteralCallback { - PgfExprProb* (*match)(PgfLiteralCallback* self, + PgfExprProb* (*match)(PgfLiteralCallback* self, PgfConcr* concr, size_t lin_idx, GuString sentence, size_t* poffset, GuPool *out_pool); - GuEnum* (*predict)(PgfLiteralCallback* self, + GuEnum* (*predict)(PgfLiteralCallback* self, PgfConcr* concr, size_t lin_idx, GuString prefix, GuPool *out_pool); -- cgit v1.2.3