diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-02-20 10:13:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-02-20 10:13:46 -0300 |
commit | e08e5df853560de6482d84066a7accc6a18de545 (patch) | |
tree | ee19686bb35da90709a32ed24bf7855de1a3946a /lpcode.h | |
download | lpeg-e08e5df853560de6482d84066a7accc6a18de545.tar.gz lpeg-e08e5df853560de6482d84066a7accc6a18de545.tar.bz2 lpeg-e08e5df853560de6482d84066a7accc6a18de545.zip |
Fist version of LPeg on GIT
LPeg repository is being moved to git. Past versions won't be moved;
they are still available in RCS.
Diffstat (limited to 'lpcode.h')
-rw-r--r-- | lpcode.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lpcode.h b/lpcode.h new file mode 100644 index 0000000..2a5861e --- /dev/null +++ b/lpcode.h | |||
@@ -0,0 +1,40 @@ | |||
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 | |||
14 | int tocharset (TTree *tree, Charset *cs); | ||
15 | int checkaux (TTree *tree, int pred); | ||
16 | int fixedlen (TTree *tree); | ||
17 | int hascaptures (TTree *tree); | ||
18 | int lp_gc (lua_State *L); | ||
19 | Instruction *compile (lua_State *L, Pattern *p); | ||
20 | void realloccode (lua_State *L, Pattern *p, int nsize); | ||
21 | 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 | ||