diff options
Diffstat (limited to 'prv.h')
| -rw-r--r-- | prv.h | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -0,0 +1,45 @@ +#ifndef PRV_H +#define PRV_H + +#include "lex.h" +#include <stddef.h> + +struct step +{ + enum tktype type; + const char *id; + int chain; +}; + +struct pos +{ + const struct seq *seq, *stseq; + const struct step *step; +}; + +struct prv +{ + const struct tk *tk, *stk; + struct storage *st; + struct tdlevel *levels; + struct pos *pos; + struct ast *ast; + struct type *nest; + size_t n, i, block; +}; + +struct seq +{ + const struct step *steps; + int (*fn)(const struct lex *l, struct prv *p); + int (*end)(const struct lex *l, struct prv *p); + const char *chain; +}; + +int kw(const char *s); +int prev(const struct prv *p); +int push(const struct pos *pos, struct prv *p); +int pop(const struct lex *l, struct prv *p); +char *sdup(const char *s); + +#endif |
