aboutsummaryrefslogtreecommitdiff
path: root/lparser.h
diff options
context:
space:
mode:
Diffstat (limited to 'lparser.h')
-rw-r--r--lparser.h47
1 files changed, 41 insertions, 6 deletions
diff --git a/lparser.h b/lparser.h
index 945a14a5..b433a02a 100644
--- a/lparser.h
+++ b/lparser.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.h,v 1.64 2010/07/02 20:42:40 roberto Exp roberto $ 2** $Id: lparser.h,v 1.65 2010/07/07 16:27:29 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*/
@@ -53,19 +53,53 @@ typedef struct expdesc {
53} expdesc; 53} expdesc;
54 54
55 55
56typedef struct vardesc { 56/* description of active local variable */
57 unsigned short idx; 57typedef struct Vardesc {
58} vardesc; 58 unsigned short idx; /* variable index in stack */
59} Vardesc;
59 60
60 61
61/* list of all active local variables */ 62/* list of all active local variables */
62typedef struct Varlist { 63typedef struct Varlist {
63 vardesc *actvar; 64 Vardesc *actvar;
64 int nactvar; 65 int nactvar;
65 int actvarsize; 66 int actvarsize;
66} Varlist; 67} Varlist;
67 68
68 69
70/* description of pending goto statement */
71typedef struct Gotodesc {
72 TString *name;
73 int pc; /* where it is coded */
74 int line; /* line where it appeared */
75 lu_byte currlevel; /* variable level where it appears in current block */
76} Gotodesc;
77
78
79/* list of pending gotos */
80typedef struct Gotolist {
81 Gotodesc *gt;
82 int ngt;
83 int gtsize;
84} Gotolist;
85
86
87/* description of active labels */
88typedef struct Labeldesc {
89 TString *name;
90 int pc; /* label position */
91 lu_byte nactvar; /* variable level where it appears in current block */
92} Labeldesc;
93
94
95/* list of active labels */
96typedef struct Labellist {
97 Labeldesc *label;
98 int nlabel;
99 int labelsize;
100} Labellist;
101
102
69struct BlockCnt; /* defined in lparser.c */ 103struct BlockCnt; /* defined in lparser.c */
70 104
71 105
@@ -91,7 +125,8 @@ typedef struct FuncState {
91 125
92 126
93LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, 127LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
94 Varlist *varl, const char *name); 128 Varlist *varl, Gotolist *gtl,
129 Labellist *labell, const char *name);
95 130
96 131
97#endif 132#endif