diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-10-09 12:08:51 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-10-09 12:08:51 +0000 |
| commit | 8cf03bc5b6895568eb08be1415985a64793bb81c (patch) | |
| tree | 814e95e1b0422362066fef389e8b03741e8478ad /src/runtime/c/pgf/data.h | |
| parent | 20e4970ec19949da10b86facd3c6a5a4abb03acb (diff) | |
a major redesign in the C runtime. The parser and the linearizer now fully support BIND. The following things are still broken: parseval, word completion, handling 'pre', the robust mode
Diffstat (limited to 'src/runtime/c/pgf/data.h')
| -rw-r--r-- | src/runtime/c/pgf/data.h | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/runtime/c/pgf/data.h b/src/runtime/c/pgf/data.h index 2562af651..0dae42491 100644 --- a/src/runtime/c/pgf/data.h +++ b/src/runtime/c/pgf/data.h @@ -128,14 +128,16 @@ typedef struct { extern GU_DECLARE_TYPE(PgfCncCat, abstract); +typedef GuString PgfToken; +typedef GuSeq PgfTokens; + bool pgf_tokens_equal(PgfTokens* t1, PgfTokens* t2); -typedef GuSeq PgfSequence; // -> PgfSymbol -typedef GuSeq PgfSequences; +typedef GuSeq PgfSymbols; typedef struct { - PgfSequence* form; + PgfSymbols* form; /**< The form of this variant as a list of tokens. */ GuStrings* prefixes; @@ -154,19 +156,8 @@ extern GU_DECLARE_TYPE(PgfCncFunOverloadMap, GuStringMap); typedef GuMap PgfCncOverloadMap; extern GU_DECLARE_TYPE(PgfCncOverloadMap, GuMap); -typedef GuMap PgfProductionIdx; -extern GU_DECLARE_TYPE(PgfProductionIdx, GuMap); - -typedef GuMap PgfLeftcornerTokIdx; -extern GU_DECLARE_TYPE(PgfLeftcornerTokIdx, GuMap); - typedef struct PgfItem PgfItem; -typedef struct { - bool (*match)(PgfConcr* concr, PgfItem* item, PgfToken tok, - PgfExprProb** out_ep, GuPool *pool); -} PgfLiteralCallback; - typedef GuMap PgfCallbacksMap; extern GU_DECLARE_TYPE(PgfCallbacksMap, GuMap); @@ -197,7 +188,7 @@ typedef struct PgfSymbolKP /** A prefix-dependent symbol. The form that this symbol takes * depends on the form of a prefix of the following symbol. */ { - PgfSequence* default_form; + PgfSymbols* default_form; /**< Default form that this symbol takes if none of of the * variant forms is triggered. */ @@ -214,6 +205,21 @@ typedef struct { } PgfSymbolBIND; typedef struct { + PgfExprProb* (*match)(PgfConcr* concr, PgfSymbol* psym, size_t lin_idx, + GuString sentence, size_t* poffset, + GuPool *pool, GuPool *out_pool); +} PgfLiteralCallback; + +typedef GuBuf PgfProductionIdx; + +typedef struct { + PgfSymbols* syms; // -> PgfSymbol + PgfProductionIdx* idx; +} PgfSequence; + +typedef GuSeq PgfSequences; + +typedef struct { PgfAbsFun* absfun; PgfExprProb *ep; int funid; @@ -230,8 +236,6 @@ struct PgfConcr { GuMap* ccats; PgfCncFunOverloadMap* fun_indices; PgfCncOverloadMap* coerce_idx; - PgfProductionIdx* epsilon_idx; - PgfLeftcornerTokIdx* leftcorner_tok_idx; PgfCncFuns* cncfuns; PgfSequences* sequences; PgfCIdMap* cnccats; @@ -274,7 +278,6 @@ typedef struct PgfProductionCoerce } PgfProductionCoerce; typedef struct { - PgfLiteralCallback *callback; PgfExprProb *ep; GuSeq* lins; } PgfProductionExtern; @@ -287,8 +290,11 @@ typedef struct { typedef GuSeq PgfProductionSeq; extern GU_DECLARE_TYPE(PgfProductionSeq, abstract); -typedef GuBuf PgfProductionBuf; -extern GU_DECLARE_TYPE(PgfProductionBuf, abstract); +typedef struct { + PgfCCat* ccat; + size_t lin_idx; + PgfProductionApply* papp; +} PgfProductionIdxEntry; struct PgfCCat { PgfCncCat* cnccat; |
