Use a separated tag for meta productions in the robust parser. This cleans up the code a lot

This commit is contained in:
kr.angelov
2012-06-13 05:49:30 +00:00
parent cc58e2d05f
commit 3ad5493758
5 changed files with 296 additions and 189 deletions

View File

@@ -42,7 +42,6 @@ typedef struct PgfAbstr PgfAbstr;
extern GU_DECLARE_TYPE(PgfAbstr, struct);
typedef struct PgfFunDecl PgfFunDecl;
typedef struct PgfConcr PgfConcr;
typedef int PgfLength;
typedef struct GuVariant PgfSymbol;
@@ -293,7 +292,8 @@ typedef struct PgfSymbolKP
typedef enum {
PGF_PRODUCTION_APPLY,
PGF_PRODUCTION_COERCE,
PGF_PRODUCTION_EXTERN
PGF_PRODUCTION_EXTERN,
PGF_PRODUCTION_META
} PgfProductionTag;
typedef struct PgfPArg PgfPArg;
@@ -323,11 +323,17 @@ typedef struct PgfProductionCoerce
} PgfProductionCoerce;
typedef struct {
PgfFunId fun;
PgfPArgs args;
PgfLiteralCallback *callback;
PgfExprProb *ep;
GuSeq lins;
} PgfProductionExtern;
typedef struct {
PgfExprProb *ep;
GuSeq lins;
PgfPArgs args;
} PgfProductionMeta;
extern GU_DECLARE_TYPE(PgfPatt, GuVariant);
extern GU_DECLARE_TYPE(PgfProduction, GuVariant);