From e08e5df853560de6482d84066a7accc6a18de545 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 20 Feb 2019 10:13:46 -0300 Subject: 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. --- lpcode.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lpcode.h (limited to 'lpcode.h') diff --git a/lpcode.h b/lpcode.h new file mode 100644 index 0000000..2a5861e --- /dev/null +++ b/lpcode.h @@ -0,0 +1,40 @@ +/* +** $Id: lpcode.h,v 1.8 2016/09/15 17:46:13 roberto Exp $ +*/ + +#if !defined(lpcode_h) +#define lpcode_h + +#include "lua.h" + +#include "lptypes.h" +#include "lptree.h" +#include "lpvm.h" + +int tocharset (TTree *tree, Charset *cs); +int checkaux (TTree *tree, int pred); +int fixedlen (TTree *tree); +int hascaptures (TTree *tree); +int lp_gc (lua_State *L); +Instruction *compile (lua_State *L, Pattern *p); +void realloccode (lua_State *L, Pattern *p, int nsize); +int sizei (const Instruction *i); + + +#define PEnullable 0 +#define PEnofail 1 + +/* +** nofail(t) implies that 't' cannot fail with any input +*/ +#define nofail(t) checkaux(t, PEnofail) + +/* +** (not nullable(t)) implies 't' cannot match without consuming +** something +*/ +#define nullable(t) checkaux(t, PEnullable) + + + +#endif -- cgit v1.2.3-55-g6feb