Skip to content

Commit

Permalink
restore epsilons while parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed Dec 14, 2023
1 parent ad57f73 commit f2d269f
Show file tree
Hide file tree
Showing 6 changed files with 382 additions and 102 deletions.
32 changes: 30 additions & 2 deletions src/runtime/c/pgf/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,38 @@ struct PGF_INTERNAL_DECL PgfLRShift {
size_t r;
};

struct PgfLRReduceArg;

struct PGF_INTERNAL_DECL PgfLRProduction {
ref<PgfConcrLin> lin;
ref<Vector<ref<PgfLRReduceArg>>> args;
};

struct PGF_INTERNAL_DECL PgfLRReducePop {
static const uint8_t tag = 1;

static inline object from_idx(size_t stk_idx) {
return ref<PgfLRReducePop>(stk_idx * (MALLOC_ALIGN_MASK+1)).tagged();
}

static inline size_t to_idx(object o) {
return o / (MALLOC_ALIGN_MASK+1);
}
};

struct PGF_INTERNAL_DECL PgfLRReduceArg {
static const uint8_t tag = 2;

size_t id;
size_t n_prods;
PgfLRProduction prods[];
};

struct PGF_INTERNAL_DECL PgfLRReduce {
object lin_obj;
size_t seq_idx;
ref<Vector<bool>> args;
size_t depth;
size_t r;
ref<Vector<object>> args;
};

struct PGF_INTERNAL_DECL PgfLRState {
Expand Down
Loading

0 comments on commit f2d269f

Please sign in to comment.