mudgangster

Tiny, scriptable MUD client
Log | Files | Refs | README

lpcode.h (783B)


      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