1/*
2** $Id: lpcode.h,v 1.8 2016/09/15 17:46:13 roberto Exp $
3*/
4
5#if !defined(lpcode_h)
6#define lpcode_h
7
8#include "lua.h"
9
10#include "lptypes.h"
11#include "lptree.h"
12#include "lpvm.h"
13
14int tocharset (TTree *tree, Charset *cs);
15int checkaux (TTree *tree, int pred);
16int fixedlen (TTree *tree);
17int hascaptures (TTree *tree);
18int lp_gc (lua_State *L);
19Instruction *compile (lua_State *L, Pattern *p);
20void realloccode (lua_State *L, Pattern *p, int nsize);
21int sizei (const Instruction *i);
22
23
24#define PEnullable 0
25#define PEnofail 1
26
27/*
28** nofail(t) implies that 't' cannot fail with any input
29*/
30#define nofail(t) checkaux(t, PEnofail)
31
32/*
33** (not nullable(t)) implies 't' cannot match without consuming
34** something
35*/
36#define nullable(t) checkaux(t, PEnullable)
37
38
39
40#endif
41