mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
the callbacks in C now take the concrete syntax as a parameter
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef struct {
|
||||
} HSPgfLiteralCallback;
|
||||
|
||||
static PgfExprProb*
|
||||
hspgf_match_callback(PgfLiteralCallback* self,
|
||||
hspgf_match_callback(PgfLiteralCallback* self, PgfConcr* concr,
|
||||
size_t lin_idx,
|
||||
GuString sentence, size_t* poffset,
|
||||
GuPool *out_pool)
|
||||
|
||||
@@ -389,7 +389,7 @@ typedef struct {
|
||||
} JPgfTokenProbEnum;
|
||||
|
||||
static PgfExprProb*
|
||||
jpgf_literal_callback_match(PgfLiteralCallback* self,
|
||||
jpgf_literal_callback_match(PgfLiteralCallback* self, PgfConcr* concr,
|
||||
size_t lin_idx,
|
||||
GuString sentence, size_t* poffset,
|
||||
GuPool *out_pool)
|
||||
@@ -467,7 +467,7 @@ jpgf_token_prob_enum_fin(GuFinalizer* self)
|
||||
}
|
||||
|
||||
static GuEnum*
|
||||
jpgf_literal_callback_predict(PgfLiteralCallback* self,
|
||||
jpgf_literal_callback_predict(PgfLiteralCallback* self, PgfConcr* concr,
|
||||
size_t lin_idx,
|
||||
GuString prefix,
|
||||
GuPool *out_pool)
|
||||
|
||||
@@ -1202,7 +1202,7 @@ typedef struct {
|
||||
} PyPgfLiteralCallback;
|
||||
|
||||
static PgfExprProb*
|
||||
pypgf_literal_callback_match(PgfLiteralCallback* self,
|
||||
pypgf_literal_callback_match(PgfLiteralCallback* self, PgfConcr* concr,
|
||||
size_t lin_idx,
|
||||
GuString sentence, size_t* poffset,
|
||||
GuPool *out_pool)
|
||||
@@ -1264,7 +1264,7 @@ pypgf_literal_callback_match(PgfLiteralCallback* self,
|
||||
}
|
||||
|
||||
static GuEnum*
|
||||
pypgf_literal_callback_predict(PgfLiteralCallback* self,
|
||||
pypgf_literal_callback_predict(PgfLiteralCallback* self, PgfConcr* concr,
|
||||
size_t lin_idx,
|
||||
GuString prefix,
|
||||
GuPool *out_pool)
|
||||
|
||||
Reference in New Issue
Block a user