diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-14 14:52:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-14 14:52:22 -0300 |
commit | 1c328a191a8b86b7ad601cb9a935f1da5373fdf7 (patch) | |
tree | 4ea6d9b0fc271ae38579b9fc6767d1c64f6bdd21 /lparser.h | |
parent | 58bf77bc7f37d697c5bfc33be169c6b841dd8a1d (diff) | |
download | lua-1c328a191a8b86b7ad601cb9a935f1da5373fdf7.tar.gz lua-1c328a191a8b86b7ad601cb9a935f1da5373fdf7.tar.bz2 lua-1c328a191a8b86b7ad601cb9a935f1da5373fdf7.zip |
no more `global' declarations
Diffstat (limited to 'lparser.h')
-rw-r--r-- | lparser.h | 21 |
1 files changed, 5 insertions, 16 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.h,v 1.42 2002/05/09 18:00:38 roberto Exp roberto $ | 2 | ** $Id: lparser.h,v 1.43 2002/05/10 19:22:11 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -41,18 +41,9 @@ typedef struct expdesc { | |||
41 | } expdesc; | 41 | } expdesc; |
42 | 42 | ||
43 | 43 | ||
44 | /* describe declared variables */ | ||
45 | typedef struct vardesc { | ||
46 | int i; /* if local, its index in `locvars'; | ||
47 | if global, its name index in `k' */ | ||
48 | lu_byte k; | ||
49 | lu_byte level; /* if local, stack level; | ||
50 | if global, corresponding local (NO_REG for free globals) */ | ||
51 | } vardesc; | ||
52 | |||
53 | |||
54 | struct BlockCnt; /* defined in lparser.c */ | 44 | struct BlockCnt; /* defined in lparser.c */ |
55 | 45 | ||
46 | |||
56 | /* state needed to generate code for a given function */ | 47 | /* state needed to generate code for a given function */ |
57 | typedef struct FuncState { | 48 | typedef struct FuncState { |
58 | Proto *f; /* current function header */ | 49 | Proto *f; /* current function header */ |
@@ -63,16 +54,14 @@ typedef struct FuncState { | |||
63 | struct BlockCnt *bl; /* chain of current blocks */ | 54 | struct BlockCnt *bl; /* chain of current blocks */ |
64 | int pc; /* next position to code (equivalent to `ncode') */ | 55 | int pc; /* next position to code (equivalent to `ncode') */ |
65 | int lasttarget; /* `pc' of last `jump target' */ | 56 | int lasttarget; /* `pc' of last `jump target' */ |
66 | int jpc; /* list of jumps to `pc' */ | 57 | int jpc; /* list of pending jumps to `pc' */ |
67 | int freereg; /* first free register */ | 58 | int freereg; /* first free register */ |
68 | int defaultglob; /* where to look for non-declared globals */ | ||
69 | int nk; /* number of elements in `k' */ | 59 | int nk; /* number of elements in `k' */ |
70 | int np; /* number of elements in `p' */ | 60 | int np; /* number of elements in `p' */ |
71 | int nlocvars; /* number of elements in `locvars' */ | 61 | int nlocvars; /* number of elements in `locvars' */ |
72 | int nactloc; /* number of active local variables */ | 62 | int nactvar; /* number of active local variables */ |
73 | int nactvar; /* number of elements in array `actvar' */ | ||
74 | expdesc upvalues[MAXUPVALUES]; /* upvalues */ | 63 | expdesc upvalues[MAXUPVALUES]; /* upvalues */ |
75 | vardesc actvar[MAXVARS]; /* declared-variable stack */ | 64 | int actvar[MAXVARS]; /* declared-variable stack */ |
76 | } FuncState; | 65 | } FuncState; |
77 | 66 | ||
78 | 67 | ||