aboutsummaryrefslogtreecommitdiff
path: root/lplcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'lplcode.h')
-rw-r--r--lplcode.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/lplcode.h b/lplcode.h
new file mode 100644
index 0000000..1b4ec78
--- /dev/null
+++ b/lplcode.h
@@ -0,0 +1,40 @@
1/*
2** $Id: lplcode.h $
3*/
4
5#if !defined(lplcode_h)
6#define lplcode_h
7
8#include "lua.h"
9
10#include "lpltypes.h"
11#include "lpltree.h"
12#include "lplvm.h"
13
14LUAI_FUNC int tocharset (TTree *tree, Charset *cs);
15LUAI_FUNC int checkaux (TTree *tree, int pred);
16LUAI_FUNC int fixedlen (TTree *tree);
17LUAI_FUNC int hascaptures (TTree *tree);
18LUAI_FUNC int lp_gc (lua_State *L);
19LUAI_FUNC Instruction *compile (lua_State *L, Pattern *p);
20LUAI_FUNC void realloccode (lua_State *L, Pattern *p, int nsize);
21LUAI_FUNC int 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