diff options
| author | krasimir <krasimir@chalmers.se> | 2015-05-18 14:41:33 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2015-05-18 14:41:33 +0000 |
| commit | ce0546536588d5debe82770ef6bcf1efff6682f6 (patch) | |
| tree | c5158848e0a68d8cfadd208356e44ccfd38becfa /src/runtime/c/pgf | |
| parent | 773a33979b8504a93a77f6581b3a1b0a0ed6c5ab (diff) | |
the callbacks in C now take the concrete syntax as a parameter
Diffstat (limited to 'src/runtime/c/pgf')
| -rw-r--r-- | src/runtime/c/pgf/literals.c | 10 | ||||
| -rw-r--r-- | src/runtime/c/pgf/parser.c | 2 | ||||
| -rw-r--r-- | src/runtime/c/pgf/pgf.h | 4 |
3 files changed, 8 insertions, 8 deletions
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); |
