diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-04 17:18:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-04 17:18:15 -0300 |
commit | 563de491be90601f23a735aede89ea9a3ef86ee9 (patch) | |
tree | c92677f388289ead55c8a8778493b0af7e41f159 /lparser.h | |
parent | 29e01934253adf5fbf43faff81d87d7470cef8ce (diff) | |
download | lua-563de491be90601f23a735aede89ea9a3ef86ee9.tar.gz lua-563de491be90601f23a735aede89ea9a3ef86ee9.tar.bz2 lua-563de491be90601f23a735aede89ea9a3ef86ee9.zip |
a better way to control optimizations.
Diffstat (limited to 'lparser.h')
-rw-r--r-- | lparser.h | 19 |
1 files changed, 4 insertions, 15 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.h,v 1.8 2000/03/03 14:58:26 roberto Exp roberto $ | 2 | ** $Id: lparser.h,v 1.9 2000/03/03 18:53:17 roberto Exp roberto $ |
3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -46,13 +46,11 @@ | |||
46 | ** Expression descriptor | 46 | ** Expression descriptor |
47 | */ | 47 | */ |
48 | 48 | ||
49 | #define NOJUMPS 0 | ||
50 | |||
51 | typedef enum { | 49 | typedef enum { |
52 | VGLOBAL, /* info is constant index of global name */ | 50 | VGLOBAL, /* info is constant index of global name */ |
53 | VLOCAL, /* info is stack index */ | 51 | VLOCAL, /* info is stack index */ |
54 | VINDEXED, /* info is info of the index expression */ | 52 | VINDEXED, |
55 | VEXP /* info is NOJUMPS if exp has no internal jumps */ | 53 | VEXP /* info is jump target if exp has internal jumps */ |
56 | } expkind; | 54 | } expkind; |
57 | 55 | ||
58 | typedef struct expdesc { | 56 | typedef struct expdesc { |
@@ -61,22 +59,13 @@ typedef struct expdesc { | |||
61 | } expdesc; | 59 | } expdesc; |
62 | 60 | ||
63 | 61 | ||
64 | /* | ||
65 | ** Expression List descriptor: | ||
66 | ** tells number of expressions in the list, | ||
67 | ** and gives the `info' of last expression. | ||
68 | */ | ||
69 | typedef struct listdesc { | ||
70 | int n; | ||
71 | int info; /* 0 if last expression has no internal jumps */ | ||
72 | } listdesc; | ||
73 | |||
74 | 62 | ||
75 | /* state needed to generate code for a given function */ | 63 | /* state needed to generate code for a given function */ |
76 | typedef struct FuncState { | 64 | typedef struct FuncState { |
77 | TProtoFunc *f; /* current function header */ | 65 | TProtoFunc *f; /* current function header */ |
78 | struct FuncState *prev; /* enclosing function */ | 66 | struct FuncState *prev; /* enclosing function */ |
79 | int pc; /* next position to code */ | 67 | int pc; /* next position to code */ |
68 | int lasttarget; /* `pc' of last `jump target' */ | ||
80 | int stacksize; /* number of values on activation register */ | 69 | int stacksize; /* number of values on activation register */ |
81 | int nlocalvar; /* number of active local variables */ | 70 | int nlocalvar; /* number of active local variables */ |
82 | int nupvalues; /* number of upvalues */ | 71 | int nupvalues; /* number of upvalues */ |