History

Lua 2.4

Lua Team committed 30 years ago

Commit ff7c16d1 parent 0a2b61162 files · +6886 −4759Browse files

Unified · Split

62 files
  1. COPYRIGHT +1 −1
  2. HISTORY +21 −0
  3. INSTALL +26 −0
  4. Makefile +8 −0
  5. README +8 −34
  6. clients/lib/Makefile +3 −10
  7. clients/lib/iolib.c +119 −123
  8. clients/lib/mathlib.c +41 −23
  9. clients/lib/strlib.c +147 −63
  10. clients/lua/Makefile +5 −8
  11. clients/lua/lua.c +11 −3
  12. config +28 −0
  13. doc/Makefile +9 −2
  14. doc/luac.man +75 −0
  15. doc/luac.ps +246 −0
  16. doc/luac.txt +66 −0
  17. doc/manual.ps +0 −2859
  18. doc/refman.ps +3562 −0
  19. domake +0 −11
  20. include/Makefile +5 −3
  21. include/lua.h +24 −16
  22. include/luadebug.h +15 −4
  23. include/lualib.h +13 −2
  24. src/Makefile +47 −21
  25. src/fallback.c +53 −39
  26. src/fallback.h +6 −3
  27. src/func.c +80 −3
  28. src/func.h +22 −2
  29. src/hash.c +29 −41
  30. src/hash.h +8 −7
  31. src/inout.c +78 −52
  32. src/inout.h +8 −4
  33. src/lex.c +30 −61
  34. src/lex.h +19 −0
  35. src/lua.stx +47 −273
  36. src/luac/Makefile +24 −0
  37. src/luac/dump.c +247 −0
  38. src/luac/luac.c +104 −0
  39. src/luac/luac.h +24 −0
  40. src/luac/print.c +189 −0
  41. src/luac/print.h +76 −0
  42. src/mem.c +34 −11
  43. src/mem.h +18 −4
  44. src/opcode.c +202 −89
  45. src/opcode.h +6 −20
  46. src/parser.c +439 −663
  47. src/parser.h +3 −2
  48. src/table.c +94 −97
  49. src/table.h +17 −8
  50. src/tree.c +100 −78
  51. src/tree.h +4 −13
  52. src/types.h +1 −3
  53. src/ugly.h +0 −36
  54. src/undump.c +326 −0
  55. src/undump.h +23 −0
  56. test/bisect.lua +26 −0
  57. test/cf.lua +27 −0
  58. test/dump.lua +1 −1
  59. test/examples/ps/ps.lua +3 −7
  60. test/hello.lua +3 −0
  61. test/long.lua +0 −22
  62. test/sort.lua +35 −37
COPYRIGHT+1−1
@@ -1,4 +1,4 @@
1Copyright (c) 1994-1995 TeCGraf, PUC-Rio. Written by Waldemar Celes Filho,1Copyright (c) 1994-1996 TeCGraf, PUC-Rio. Written by Waldemar Celes Filho,
2Roberto Ierusalimschy, Luiz Henrique de Figueiredo. All rights reserved.2Roberto Ierusalimschy, Luiz Henrique de Figueiredo. All rights reserved.
3 3
4Permission is hereby granted, without written agreement and without license or4Permission is hereby granted, without written agreement and without license or
HISTORY+21−0
@@ -0,0 +1,21 @@
1Current version is 2.4 (version 2.3 was never publicly released)
2
3* Changes since version 2.2
4 + external compiler creates portable binary files that can be loaded faster
5 + interface for debugging and profiling
6 + new "getglobal" fallback
7 + new functions for handling references to Lua objects
8 + new functions in standard lib
9 + only one copy of each string is stored
10 + expanded documentation, with more examples
11
12* Changes since version 2.1
13 + functions now may be declared with any "lvalue" as a name
14 + garbage collection of functions
15 + support for pipes
16
17* Changes since version 1.1
18 + object-oriented support
19 + fallbacks
20 + simplified syntax for tables
21 + many internal improvements
INSTALL+26−0
@@ -0,0 +1,26 @@
1* Installation
2 Installing Lua should be very easy:
3
4 1. Edit "config" to suit your platform, if at all necessary
5 2. Then, type "make"
6
7* What you get
8 If make succeeds, you get:
9 * a compiler and an interpreter in ./bin/lua;
10 * libraries in ./lib;
11 * include files in ./include.
12
13 There is a reference manual in ./doc, and tests and examples in ./test.
14 You don't need these directories for development.
15
16* If you have problems (and solutions!)
17 If make fails, please let us know (lua@icad.puc-rio.br).
18 If you make changes to "config", please send them to us.
19
20* Shared libraries
21 If you are running SunOs 4.x, type the following after "make" succeeds:
22 ld -o lib/liblua.so.2.4 src/*.o
23 ld -o lib/liblualib.so.2.4 clients/lib/*.o
24
25 For AIX, the OpenGL clone Mesa includes a script for making shared libraries.
26 For other systems, please let us know how!
Makefile+8−0
@@ -0,0 +1,8 @@
1# makefile for lua hierarchy
2
3all co clean klean:
4 cd src; make $@
5 cd src/luac; make $@
6 cd include; make $@
7 cd clients/lib; make $@
8 cd clients/lua; make $@
README+8−34
@@ -15,46 +15,20 @@ · 14 unmodified lines
15 + portable, written in ANSI C (runs in Unix, DOS, Windows, Mac, Cray, ...)15 + portable, written in ANSI C (runs in Unix, DOS, Windows, Mac, Cray, ...)
16 16
17* Availability17* Availability
18 In Brazil: ftp://ftp.icad.puc-rio.br/pub/lua/lua-2.2.tar.gz18 The latest version of Lua is always available at the following locations:
19 In Canada: ftp://csg.uwaterloo.ca/pub/lhf/lua/lua-2.2.tar.gz19 In Brazil: ftp://ftp.icad.puc-rio.br/pub/lua/lua.tar.gz
20 In Canada: ftp://csg.uwaterloo.ca/pub/lhf/lua/lua.tar.gz
20 Home page: http://www.inf.puc-rio.br/~roberto/lua.html21 Home page: http://www.inf.puc-rio.br/~roberto/lua.html
22 The current version is 2.4.
21 23
22* Legal matters24* Legal matters
23 Lua is freely available for both academic and commercial purposes.25 Lua is freely available for both academic and commercial purposes.
24 Lua is not in the public domain; TeCGraf keeps its copyright.26 Lua is not in the public domain; TeCGraf keeps its copyright.
25 See COPYRIGHT.27 See COPYRIGHT.
26 28
27* Changes since version 2.1 (current version is 2.2)29* Installation
28 + functions now may be declared with any "lvalue" as a name30 See INSTALL.
29 + garbage collection of functions
30 + support for pipes
31
32* Changes since version 1.1
33 + object-oriented support
34 + fallbacks
35 + simplified syntax for tables
36 + many internal improvements
37
38* Installing
39 To make, simply type domake.
40 If make succeeds, you get an interpreter in ./bin/lua.
41 If make fails, please let me know.
42 The libraries are in ./lib. The include files are in ./include.
43 You don't need the other directories for development.
44 There is a reference manual in ./doc, and tests and examples in ./test.
45 This distribution is biased towards SunOS 4 with gcc but it is simple to
46 change the Makefiles for other systems, if necessary.
47 If you are running SunOs, type also "domake dynamic" to build shared
48 libraries in ./lib.
49 If your system does not have "popen", then change ./clients/lib/Makefile.
50 31
51* Contacting the authors32* Contacting the authors
52 Send your comments, bug reports and anything else to lhf@icad.puc-rio.br.33 Send your comments, bug reports and anything else to lua@icad.puc-rio.br.
53 Please send me email if you download Lua so that we can know how far it goes.34 Please send us email if you download Lua so that we can know how far it goes.
54
55--
56Luiz Henrique de Figueiredo email: lhf@icad.puc-rio.br
57TeCGraf-Grupo de Tecnologia em Computacao Grafica, Dep. Informatica, PUC-Rio
58Rua Marques de Sao Vicente 225 voice: +55 21 529-9424
5922453-900 Rio de Janeiro, RJ, Brasil fax: +55 21 511-5645
60--
clients/lib/Makefile+3−10
@@ -1,17 +1,10 @@
1# makefile for lualib1# makefile for lualib
2 2
3INC= $(LUA)/include3LUA= ../..
4LIB= $(LUA)/lib
5 4
6# in SunOs /usr/5include contains prototypes for standard lib5include $(LUA)/config
7INCS= -I/usr/5include -I$(INC)
8WARN= -Wall -Wmissing-prototypes -Wshadow -ansi
9 6
10# if your system does not have popen, remove -DPOPEN from the line below7EXTRA_DEFS= $(POPEN)
11DEFS= -DPOPEN
12
13CC= gcc
14CFLAGS= $(INCS) $(DEFS) $(WARN) -O2
15 8
16OBJS= iolib.o mathlib.o strlib.o9OBJS= iolib.o mathlib.o strlib.o
17SRCS= iolib.c mathlib.c mathlib.h strlib.c strlib.h10SRCS= iolib.c mathlib.c mathlib.h strlib.c strlib.h
clients/lib/iolib.c+119−123
@@ -3,15 +3,14 @@ · 2 unmodified lines
3** Input/output library to LUA3** Input/output library to LUA
4*/4*/
5 5
6char *rcs_iolib="$Id: iolib.c,v 1.29 1995/11/10 18:32:59 roberto Exp $";6char *rcs_iolib="$Id: iolib.c,v 1.44 1996/05/03 20:10:59 roberto Exp $";
7 7
8#include <stdio.h>8#include <stdio.h>
9#include <ctype.h>9#include <ctype.h>
10#include <sys/types.h>
11#include <sys/stat.h>
12#include <string.h>10#include <string.h>
13#include <time.h>11#include <time.h>
14#include <stdlib.h>12#include <stdlib.h>
13#include <errno.h>
15 14
16#include "lua.h"15#include "lua.h"
17#include "luadebug.h"16#include "luadebug.h"
@@ -29,6 +28,14 @@ int pclose(); · 11 unmodified lines
29#endif28#endif
30 29
31 30
31static void pushresult (int i)
32{
33 if (i)
34 lua_pushnumber (1);
35 else
36 lua_pushnil();
37}
38
32static void closeread (void)39static void closeread (void)
33{40{
34 if (in != stdin)41 if (in != stdin)
@@ -116,15 +123,12 @@ static void io_writeto (void) · 81 unmodified lines
116** LUA interface:123** LUA interface:
117** status = appendto (filename)124** status = appendto (filename)
118** where:125** where:
119** status = 2 -> success (already exist)126** status = 1 -> success
120** status = 1 -> success (new file)
121** status = nil -> error127** status = nil -> error
122*/128*/
123static void io_appendto (void)129static void io_appendto (void)
124{130{
125 char *s = lua_check_string(1, "appendto");131 char *s = lua_check_string(1, "appendto");
126 struct stat st;
127 int r = (stat(s, &st) == -1) ? 1 : 2;
128 FILE *fp = fopen (s, "a");132 FILE *fp = fopen (s, "a");
129 if (fp == NULL)133 if (fp == NULL)
130 lua_pushnil();134 lua_pushnil();
@@ -132,7 +136,7 @@ static void io_appendto (void) · 1 unmodified line
132 {136 {
133 if (out != stdout) fclose (out);137 if (out != stdout) fclose (out);
134 out = fp;138 out = fp;
135 lua_pushnumber (r);139 lua_pushnumber(1);
136 }140 }
137}141}
138 142
@@ -142,15 +146,14 @@ static char getformat (char *f, int *just, int *m, int *n) · 3 unmodified lines
142 int t;146 int t;
143 switch (*f++)147 switch (*f++)
144 {148 {
149 case 'q': case 'Q':
145 case 's': case 'S':150 case 's': case 'S':
146 t = 's';151 case 'i': case 'I':
152 t = tolower(*(f-1));
147 break;153 break;
148 case 'f': case 'F': case 'g': case 'G': case 'e': case 'E':154 case 'f': case 'F': case 'g': case 'G': case 'e': case 'E':
149 t = 'f';155 t = 'f';
150 break;156 break;
151 case 'i': case 'I':
152 t = 'i';
153 break;
154 default:157 default:
155 t = 0; /* to avoid compiler warnings */158 t = 0; /* to avoid compiler warnings */
156 lua_arg_error("read/write (format)");159 lua_arg_error("read/write (format)");
@@ -177,32 +180,6 @@ static char getformat (char *f, int *just, int *m, int *n) · 20 unmodified lines
177}180}
178 181
179 182
180static char *add_char (int c)
181{
182 static char *buff = NULL;
183 static int max = 0;
184 static int n = 0;
185 if (n >= max)
186 {
187 if (max == 0)
188 {
189 max = 100;
190 buff = (char *)malloc(max);
191 }
192 else
193 {
194 max *= 2;
195 buff = (char *)realloc(buff, max);
196 }
197 if (buff == NULL)
198 lua_error("memory overflow");
199 }
200 buff[n++] = c;
201 if (c == 0)
202 n = 0; /* prepare for next string */
203 return buff;
204}
205
206/*183/*
207** Read a variable. On error put nil on stack.184** Read a variable. On error put nil on stack.
208** LUA interface:185** LUA interface:
@@ -222,23 +199,23 @@ static int read_until_char (int del) · 13 unmodified lines
222{199{
223 int c;200 int c;
224 while((c = fgetc(in)) != EOF && c != del)201 while((c = fgetc(in)) != EOF && c != del)
225 add_char(c);202 luaI_addchar(c);
226 return c;203 return c;
227}204}
228 205
229static int read_until_blank (void)206static void read_until_blank (void)
230{207{
231 int c;208 int c;
232 while((c = fgetc(in)) != EOF && !isspace(c))209 while((c = fgetc(in)) != EOF && !isspace(c))
233 add_char(c);210 luaI_addchar(c);
234 return c;211 if (c != EOF) ungetc(c,in);
235}212}
236 213
237static void read_m (int m)214static void read_m (int m)
238{215{
239 int c;216 int c;
240 while (m-- && (c = fgetc(in)) != EOF)217 while (m-- && (c = fgetc(in)) != EOF)
241 add_char(c);218 luaI_addchar(c);
242}219}
243 220
244 221
@@ -256,21 +233,18 @@ static void read_free (void) · 11 unmodified lines
256 { /* string */233 { /* string */
257 c = read_until_char(c);234 c = read_until_char(c);
258 if (c == EOF)235 if (c == EOF)
259 {
260 add_char(0); /* to be ready for next time */
261 lua_pushnil();236 lua_pushnil();
262 }
263 else237 else
264 lua_pushstring(add_char(0));238 lua_pushstring(luaI_addchar(0));
265 }239 }
266 else240 else
267 {241 {
268 double d;242 double d;
269 char dummy;243 char dummy;
270 char *s;244 char *s;
271 add_char(c);245 luaI_addchar(c);
272 read_until_blank();246 read_until_blank();
273 s = add_char(0);247 s = luaI_addchar(0);
274 if (sscanf(s, "%lf %c", &d, &dummy) == 1)248 if (sscanf(s, "%lf %c", &d, &dummy) == 1)
275 lua_pushnumber(d);249 lua_pushnumber(d);
276 else250 else
@@ -281,6 +255,7 @@ static void read_free (void) · 4 unmodified lines
281static void io_read (void)255static void io_read (void)
282{256{
283 lua_Object o = lua_getparam (1);257 lua_Object o = lua_getparam (1);
258 luaI_addchar(0); /* initialize buffer */
284 if (o == LUA_NOOBJECT) /* free format */259 if (o == LUA_NOOBJECT) /* free format */
285 read_free();260 read_free();
286 else /* formatted */261 else /* formatted */
@@ -289,12 +264,19 @@ static void io_read (void) · 2 unmodified lines
289 switch (getformat(lua_check_string(1, "read"), &dummy1, &m, &dummy2))264 switch (getformat(lua_check_string(1, "read"), &dummy1, &m, &dummy2))
290 {265 {
291 case 's':266 case 's':
267 {
268 char *s;
292 if (m < 0)269 if (m < 0)
293 read_until_blank();270 read_until_blank();
294 else271 else
295 read_m(m);272 read_m(m);
296 lua_pushstring(add_char(0));273 s = luaI_addchar(0);
274 if ((m >= 0 && strlen(s) == m) || (m < 0 && strlen(s) > 0))
275 lua_pushstring(s);
276 else
277 lua_pushnil();
297 break;278 break;
279 }
298 280
299 case 'i': /* can read as float, since it makes no difference to Lua */281 case 'i': /* can read as float, since it makes no difference to Lua */
300 case 'f':282 case 'f':
@@ -306,7 +288,7 @@ static void io_read (void) · 5 unmodified lines
306 else288 else
307 {289 {
308 read_m(m);290 read_m(m);
309 result = sscanf(add_char(0), "%lf", &d);291 result = sscanf(luaI_addchar(0), "%lf", &d);
310 }292 }
311 if (result == 1)293 if (result == 1)
312 lua_pushnumber(d);294 lua_pushnumber(d);
@@ -314,6 +296,8 @@ static void io_read (void) · 1 unmodified line
314 lua_pushnil();296 lua_pushnil();
315 break;297 break;
316 }298 }
299 default:
300 lua_arg_error("read (format)");
317 }301 }
318 }302 }
319}303}
@@ -324,10 +308,16 @@ static void io_read (void) · 4 unmodified lines
324*/308*/
325static void io_readuntil (void)309static void io_readuntil (void)
326{310{
327 int del = *lua_check_string(1, "readuntil");311 int del, c;
328 int c = read_until_char(del);312 lua_Object p = lua_getparam(1);
313 luaI_addchar(0); /* initialize buffer */
314 if (p == LUA_NOOBJECT || lua_isnil(p))
315 del = EOF;
316 else
317 del = *lua_check_string(1, "readuntil");
318 c = read_until_char(del);
329 if (c != EOF) ungetc(c,in);319 if (c != EOF) ungetc(c,in);
330 lua_pushstring(add_char(0));320 lua_pushstring(luaI_addchar(0));
331}321}
332 322
333 323
@@ -384,6 +374,13 @@ static int write_string (char *s, int just, int m) · 50 unmodified lines
384 return status;374 return status;
385}375}
386 376
377static int write_quoted (int just, int m)
378{
379 luaI_addchar(0);
380 luaI_addquoted(lua_check_string(1, "write"));
381 return write_string(luaI_addchar(0), just, m);
382}
383
387static int write_float (int just, int m, int n)384static int write_float (int just, int m, int n)
388{385{
389 char buffer[100];386 char buffer[100];
@@ -420,15 +417,16 @@ static void io_write (void) · 30 unmodified lines
420 if (lua_getparam (2) == LUA_NOOBJECT) /* free format */417 if (lua_getparam (2) == LUA_NOOBJECT) /* free format */
421 {418 {
422 lua_Object o1 = lua_getparam(1);419 lua_Object o1 = lua_getparam(1);
423 if (lua_isnumber(o1))420 int t = lua_type(o1);
421 if (t == LUA_T_NUMBER)
424 status = fprintf (out, "%g", lua_getnumber(o1)) >= 0;422 status = fprintf (out, "%g", lua_getnumber(o1)) >= 0;
425 else if (lua_isstring(o1))423 else if (t == LUA_T_STRING)
426 status = fprintf (out, "%s", lua_getstring(o1)) >= 0;424 status = fprintf (out, "%s", lua_getstring(o1)) >= 0;
427 }425 }
428 else /* formated */426 else /* formated */
429 {427 {
430 int just, m, n;428 int just, m, n;
431 switch (getformat (lua_check_string(2, "write"), &just, &m, &n))429 switch (getformat(lua_check_string(2, "write"), &just, &m, &n))
432 {430 {
433 case 's':431 case 's':
434 {432 {
@@ -439,6 +437,9 @@ static void io_write (void) · 4 unmodified lines
439 status = 0;437 status = 0;
440 break;438 break;
441 }439 }
440 case 'q':
441 status = write_quoted(just, m);
442 break;
442 case 'f':443 case 'f':
443 status = write_float(just, m, n);444 status = write_float(just, m, n);
444 break;445 break;
@@ -467,59 +468,54 @@ static void io_execute (void) · 22 unmodified lines
467*/468*/
468static void io_remove (void)469static void io_remove (void)
469{470{
470 if (remove(lua_check_string(1, "remove")) == 0)471 pushresult(remove(lua_check_string(1, "remove")) == 0);
471 lua_pushnumber (1);
472 else
473 lua_pushnil();
474}472}
475 473
474static void io_rename (void)
475{
476 char *f1 = lua_check_string(1, "rename");
477 char *f2 = lua_check_string(2, "rename");
478 pushresult(rename(f1, f2) == 0);
479}
476 480
477/*481static void io_tmpname (void)
478** To get a environment variables
479*/
480static void io_getenv (void)
481{482{
482 char *env = getenv(lua_check_string(1, "getenv"));483 lua_pushstring(tmpnam(NULL));
483 if (env == NULL) lua_pushnil();
484 else lua_pushstring(env);
485}484}
486 485
487/*486static void io_errorno (void)
488** Return time: hour, min, sec
489*/
490static void io_time (void)
491{487{
492 time_t t;488/* lua_pushstring(strerror(errno));*/
493 struct tm *s;
494
495 time(&t);
496 s = localtime(&t);
497 lua_pushnumber(s->tm_hour);
498 lua_pushnumber(s->tm_min);
499 lua_pushnumber(s->tm_sec);
500}489}
501 490
491
502/*492/*
503** Return date: dd, mm, yyyy493** To get a environment variable
504*/494*/
505static void io_date (void)495static void io_getenv (void)
506{496{
507 time_t t;497 char *env = getenv(lua_check_string(1, "getenv"));
508 struct tm *s;498 lua_pushstring(env); /* if NULL push nil */
509
510 time(&t);
511 s = localtime(&t);
512 lua_pushnumber(s->tm_mday);
513 lua_pushnumber(s->tm_mon+1);
514 lua_pushnumber(s->tm_year+1900);
515}499}
516 500
517/*501/*
518** Beep502** Return user formatted time stamp
519*/503*/
520static void io_beep (void)504static void io_date (void)
521{505{
522 printf("\a");506 time_t t;
507 struct tm *tm;
508 char *s;
509 char b[BUFSIZ];
510 if (lua_getparam(1) == LUA_NOOBJECT)
511 s = "%c";
512 else
513 s = lua_check_string(1, "date");
514 time(&t); tm = localtime(&t);
515 if (strftime(b,sizeof(b),s,tm))
516 lua_pushstring(b);
517 else
518 lua_error("invalid `date' format");
523}519}
524 520
525/*521/*
@@ -528,9 +524,8 @@ static void io_beep (void) · 2 unmodified lines
528static void io_exit (void)524static void io_exit (void)
529{525{
530 lua_Object o = lua_getparam(1);526 lua_Object o = lua_getparam(1);
531 if (lua_isstring(o))527 int code = lua_isnumber(o) ? (int)lua_getnumber(o) : 1;
532 fprintf(stderr, "%s\n", lua_getstring(o));528 exit(code);
533 exit(1);
534}529}
535 530
536/*531/*
@@ -543,14 +538,14 @@ static void io_debug (void) · 6 unmodified lines
543 {538 {
544 char buffer[250];539 char buffer[250];
545 fprintf(stderr, "lua_debug> ");540 fprintf(stderr, "lua_debug> ");
546 if (gets(buffer) == 0) return;541 if (fgets(buffer, sizeof(buffer), stdin) == 0) return;
547 if (strcmp(buffer, "cont") == 0) return;542 if (strcmp(buffer, "cont") == 0) return;
548 lua_dostring(buffer);543 lua_dostring(buffer);
549 }544 }
550}545}
551 546
552 547
553void lua_printstack (FILE *f)548static void lua_printstack (FILE *f)
554{549{
555 int level = 0;550 int level = 0;
556 lua_Object func;551 lua_Object func;
@@ -560,13 +555,13 @@ void lua_printstack (FILE *f) · 3 unmodified lines
560 char *name;555 char *name;
561 int currentline;556 int currentline;
562 fprintf(f, "\t");557 fprintf(f, "\t");
563 switch (*getobjname(func, &name))558 switch (*lua_getobjname(func, &name))
564 {559 {
565 case 'g':560 case 'g':
566 fprintf(f, "function %s", name);561 fprintf(f, "function %s", name);
567 break;562 break;
568 case 'f':563 case 'f':
569 fprintf(f, "fallback %s", name);564 fprintf(f, "`%s' fallback", name);
570 break;565 break;
571 default:566 default:
572 {567 {
@@ -582,7 +577,7 @@ void lua_printstack (FILE *f) · 9 unmodified lines
582 }577 }
583 }578 }
584 if ((currentline = lua_currentline(func)) > 0)579 if ((currentline = lua_currentline(func)) > 0)
585 fprintf(f, " at line %d", currentline);580 fprintf(f, " at line %d", currentline);
586 fprintf(f, "\n");581 fprintf(f, "\n");
587 }582 }
588}583}
@@ -597,26 +592,27 @@ static void errorfb (void) · 8 unmodified lines
597}592}
598 593
599 594
600/*595static struct lua_reg iolib[] = {
601** Open io library596{"readfrom", io_readfrom},
602*/597{"writeto", io_writeto},
598{"appendto", io_appendto},
599{"read", io_read},
600{"readuntil",io_readuntil},
601{"write", io_write},
602{"execute", io_execute},
603{"remove", io_remove},
604{"rename", io_rename},
605{"tmpname", io_tmpname},
606{"ioerror", io_errorno},
607{"getenv", io_getenv},
608{"date", io_date},
609{"exit", io_exit},
610{"debug", io_debug},
611{"print_stack", errorfb}
612};
613
603void iolib_open (void)614void iolib_open (void)
604{615{
605 lua_register ("readfrom", io_readfrom);616 luaI_openlib(iolib, (sizeof(iolib)/sizeof(iolib[0])));
606 lua_register ("writeto", io_writeto);617 lua_setfallback("error", errorfb);
607 lua_register ("appendto", io_appendto);
608 lua_register ("read", io_read);
609 lua_register ("readuntil",io_readuntil);
610 lua_register ("write", io_write);
611 lua_register ("execute", io_execute);
612 lua_register ("remove", io_remove);
613 lua_register ("getenv", io_getenv);
614 lua_register ("time", io_time);
615 lua_register ("date", io_date);
616 lua_register ("beep", io_beep);
617 lua_register ("exit", io_exit);
618 lua_register ("debug", io_debug);
619 lua_register ("print_stack", errorfb);
620 lua_setfallback("error", errorfb);
621}618}
622
clients/lib/mathlib.c+41−23
@@ -3,9 +3,9 @@ · 2 unmodified lines
3** Mathematics library to LUA3** Mathematics library to LUA
4*/4*/
5 5
6char *rcs_mathlib="$Id: mathlib.c,v 1.13 1995/11/10 17:54:31 roberto Exp $";6char *rcs_mathlib="$Id: mathlib.c,v 1.17 1996/04/30 21:13:55 roberto Exp $";
7 7
8#include <stdio.h> /* NULL */8#include <stdlib.h>
9#include <math.h>9#include <math.h>
10 10
11#include "lualib.h"11#include "lualib.h"
@@ -113,7 +113,7 @@ static void math_pow (void) · 101 unmodified lines
113 lua_Object op = lua_getparam(3);113 lua_Object op = lua_getparam(3);
114 if (!lua_isnumber(o1) || !lua_isnumber(o2) || *(lua_getstring(op)) != 'p')114 if (!lua_isnumber(o1) || !lua_isnumber(o2) || *(lua_getstring(op)) != 'p')
115 {115 {
116 lua_Object old = lua_getlocked(old_pow);116 lua_Object old = lua_getref(old_pow);
117 lua_pushobject(o1);117 lua_pushobject(o1);
118 lua_pushobject(o2);118 lua_pushobject(o2);
119 lua_pushobject(op);119 lua_pushobject(op);
@@ -184,29 +184,47 @@ static void math_rad (void) · 64 unmodified lines
184 lua_pushnumber (d/180.*PI);184 lua_pushnumber (d/180.*PI);
185}185}
186 186
187static void math_random (void)
188{
189 lua_pushnumber((double)(rand()%RAND_MAX) / (double)RAND_MAX);
190}
191
192static void math_randomseed (void)
193{
194 srand(lua_check_number(1, "randomseed"));
195}
196
197
198static struct lua_reg mathlib[] = {
199{"abs", math_abs},
200{"sin", math_sin},
201{"cos", math_cos},
202{"tan", math_tan},
203{"asin", math_asin},
204{"acos", math_acos},
205{"atan", math_atan},
206{"atan2", math_atan2},
207{"ceil", math_ceil},
208{"floor", math_floor},
209{"mod", math_mod},
210{"sqrt", math_sqrt},
211{"min", math_min},
212{"max", math_max},
213{"log", math_log},
214{"log10", math_log10},
215{"exp", math_exp},
216{"deg", math_deg},
217{"rad", math_rad},
218{"random", math_random},
219{"randomseed", math_randomseed}
220};
221
187/*222/*
188** Open math library223** Open math library
189*/224*/
190void mathlib_open (void)225void mathlib_open (void)
191{226{
192 lua_register ("abs", math_abs);227 luaI_openlib(mathlib, (sizeof(mathlib)/sizeof(mathlib[0])));
193 lua_register ("sin", math_sin);228 old_pow = lua_refobject(lua_setfallback("arith", math_pow), 1);
194 lua_register ("cos", math_cos);
195 lua_register ("tan", math_tan);
196 lua_register ("asin", math_asin);
197 lua_register ("acos", math_acos);
198 lua_register ("atan", math_atan);
199 lua_register ("atan2", math_atan2);
200 lua_register ("ceil", math_ceil);
201 lua_register ("floor", math_floor);
202 lua_register ("mod", math_mod);
203 lua_register ("sqrt", math_sqrt);
204 lua_register ("min", math_min);
205 lua_register ("max", math_max);
206 lua_register ("log", math_log);
207 lua_register ("log10", math_log10);
208 lua_register ("exp", math_exp);
209 lua_register ("deg", math_deg);
210 lua_register ("rad", math_rad);
211 old_pow = lua_lockobject(lua_setfallback("arith", math_pow));
212}229}
230
clients/lib/strlib.c+147−63
@@ -3,12 +3,13 @@ · 2 unmodified lines
3** String library to LUA3** String library to LUA
4*/4*/
5 5
6char *rcs_strlib="$Id: strlib.c,v 1.14 1995/11/10 17:54:31 roberto Exp $";6char *rcs_strlib="$Id: strlib.c,v 1.23 1996/04/30 21:13:55 roberto Exp $";
7 7
8#include <string.h>8#include <string.h>
9#include <stdio.h>9#include <stdio.h>
10#include <stdlib.h>10#include <stdlib.h>
11#include <ctype.h>11#include <ctype.h>
12#include <limits.h>
12 13
13#include "lua.h"14#include "lua.h"
14#include "lualib.h"15#include "lualib.h"
@@ -24,12 +25,12 @@ void lua_arg_error(char *funcname) · 9 unmodified lines
24char *lua_check_string (int numArg, char *funcname)25char *lua_check_string (int numArg, char *funcname)
25{26{
26 lua_Object o = lua_getparam(numArg);27 lua_Object o = lua_getparam(numArg);
27 if (!(lua_isstring(o) || lua_isnumber(o)))28 if (!lua_isstring(o))
28 lua_arg_error(funcname);29 lua_arg_error(funcname);
29 return lua_getstring(o);30 return lua_getstring(o);
30}31}
31 32
32float lua_check_number (int numArg, char *funcname)33double lua_check_number (int numArg, char *funcname)
33{34{
34 lua_Object o = lua_getparam(numArg);35 lua_Object o = lua_getparam(numArg);
35 if (!lua_isnumber(o))36 if (!lua_isnumber(o))
@@ -37,13 +38,36 @@ float lua_check_number (int numArg, char *funcname) · 1 unmodified line
37 return lua_getnumber(o);38 return lua_getnumber(o);
38}39}
39 40
40static char *newstring (char *s)41static int lua_opt_number (int numArg, int def, char *funcname)
41{42{
42 char *ns = (char *)malloc(strlen(s)+1);43 return (lua_getparam(numArg) == LUA_NOOBJECT) ? def :
43 if (ns == 0)44 (int)lua_check_number(numArg, funcname);
44 lua_error("not enough memory for new string");45}
45 strcpy(ns, s);46
46 return ns;47char *luaI_addchar (int c)
48{
49 static char *buff = NULL;
50 static int max = 0;
51 static int n = 0;
52 if (n >= max)
53 {
54 if (max == 0)
55 {
56 max = 100;
57 buff = (char *)malloc(max);
58 }
59 else
60 {
61 max *= 2;
62 buff = (char *)realloc(buff, max);
63 }
64 if (buff == NULL)
65 lua_error("memory overflow");
66 }
67 buff[n++] = c;
68 if (c == 0)
69 n = 0; /* prepare for next string */
70 return buff;
47}71}
48 72
49 73
@@ -56,15 +80,12 @@ static void str_find (void) · 6 unmodified lines
56{80{
57 char *s1 = lua_check_string(1, "strfind");81 char *s1 = lua_check_string(1, "strfind");
58 char *s2 = lua_check_string(2, "strfind");82 char *s2 = lua_check_string(2, "strfind");
59 int init = (lua_getparam(3) == LUA_NOOBJECT) ? 0 :83 int init = lua_opt_number(3, 1, "strfind") - 1;
60 (int)lua_check_number(3, "strfind")-1;84 char *f = (init>=0 && init<=strlen(s1)) ? strstr(s1+init,s2) : NULL;
61 char *f = strstr(s1+init,s2);
62 if (f != NULL)85 if (f != NULL)
63 {86 {
64 int pos = f-s1+1;87 int pos = f-s1+1;
65 if (lua_getparam (4) == LUA_NOOBJECT)88 if (lua_opt_number(4, INT_MAX, "strfind") >= pos+strlen(s2)-1)
66 lua_pushnumber (pos);
67 else if ((int)lua_check_number(4, "strfind") >= pos+strlen(s2)-1)
68 lua_pushnumber (pos);89 lua_pushnumber (pos);
69 else90 else
70 lua_pushnil();91 lua_pushnil();
@@ -94,34 +115,16 @@ static void str_sub (void) · 23 unmodified lines
94{115{
95 char *s = lua_check_string(1, "strsub");116 char *s = lua_check_string(1, "strsub");
96 int start = (int)lua_check_number(2, "strsub");117 int start = (int)lua_check_number(2, "strsub");
97 int end = (lua_getparam(3) == LUA_NOOBJECT) ? strlen(s) :118 int end = lua_opt_number(3, strlen(s), "strsub");
98 (int)lua_check_number(3, "strsub");
99 if (end < start || start < 1 || end > strlen(s))119 if (end < start || start < 1 || end > strlen(s))
100 lua_pushliteral("");120 lua_pushliteral("");
101 else121 else
102 {122 {
103 char temp = s[end];123 luaI_addchar(0);
104 s[end] = 0;124 while (start <= end)
105 lua_pushstring (&s[start-1]);125 luaI_addchar(s[start++ - 1]);
106 s[end] = temp;126 lua_pushstring (luaI_addchar(0));
107 }
108}
109
110/*
111** Convert a string according to given function.
112*/
113typedef int (*strfunc)(int s);
114static void str_apply (strfunc f, char *funcname)
115{
116 char *s, *c;
117 c = s = newstring(lua_check_string(1, funcname));
118 while (*c != 0)
119 {
120 *c = f(*c);
121 c++;
122 }127 }
123 lua_pushstring(s);
124 free(s);
125}128}
126 129
127/*130/*
@@ -131,7 +134,11 @@ static void str_apply (strfunc f, char *funcname) · 3 unmodified lines
131*/134*/
132static void str_lower (void)135static void str_lower (void)
133{136{
134 str_apply(tolower, "strlower");137 char *s = lua_check_string(1, "strlower");
138 luaI_addchar(0);
139 while (*s)
140 luaI_addchar(tolower(*s++));
141 lua_pushstring(luaI_addchar(0));
135}142}
136 143
137 144
@@ -142,7 +149,11 @@ static void str_lower (void) · 4 unmodified lines
142*/149*/
143static void str_upper (void)150static void str_upper (void)
144{151{
145 str_apply(toupper, "strupper");152 char *s = lua_check_string(1, "strupper");
153 luaI_addchar(0);
154 while (*s)
155 luaI_addchar(toupper(*s++));
156 lua_pushstring(luaI_addchar(0));
146}157}
147 158
148/*159/*
@@ -151,42 +162,115 @@ static void str_upper (void) · 2 unmodified lines
151static void str_ascii (void)162static void str_ascii (void)
152{163{
153 char *s = lua_check_string(1, "ascii");164 char *s = lua_check_string(1, "ascii");
154 lua_Object o2 = lua_getparam(2);165 int pos = lua_opt_number(2, 1, "ascii") - 1;
155 int pos;
156 pos = (o2 == LUA_NOOBJECT) ? 0 : (int)lua_check_number(2, "ascii")-1;
157 if (pos<0 || pos>=strlen(s))166 if (pos<0 || pos>=strlen(s))
158 lua_arg_error("ascii");167 lua_arg_error("ascii");
159 lua_pushnumber(s[pos]);168 lua_pushnumber(s[pos]);
160}169}
161 170
162/*171void luaI_addquoted (char *s)
163** converts one or more integers to chars in a string172{
164*/173 luaI_addchar('"');
165#define maxparams 50174 for (; *s; s++)
166static void str_int2str (void)175 {
176 if (*s == '"' || *s == '\\' || *s == '\n')
177 luaI_addchar('\\');
178 luaI_addchar(*s);
179 }
180 luaI_addchar('"');
181}
182
183#define MAX_CONVERTION 2000
184#define MAX_FORMAT 50
185
186static void str_format (void)
167{187{
168 char s[maxparams+1];188 int arg = 1;
169 int i = 0;189 char *strfrmt = lua_check_string(arg++, "format");
170 while (lua_getparam(++i) != LUA_NOOBJECT)190 luaI_addchar(0); /* initialize */
191 while (*strfrmt)
171 {192 {
172 if (i > maxparams)193 if (*strfrmt != '%')
173 lua_error("too many parameters to function `int2str'");194 luaI_addchar(*strfrmt++);
174 s[i-1] = (int)lua_check_number(i, "int2str");195 else if (*++strfrmt == '%')
196 luaI_addchar(*strfrmt++); /* %% */
197 else
198 { /* format item */
199 char form[MAX_FORMAT]; /* store the format ('%...') */
200 char buff[MAX_CONVERTION]; /* store the formated value */
201 int size = 0;
202 int i = 0;
203 form[i++] = '%';
204 form[i] = *strfrmt++;
205 while (!isalpha(form[i]))
206 {
207 if (isdigit(form[i]))
208 {
209 size = size*10 + form[i]-'0';
210 if (size >= MAX_CONVERTION)
211 lua_error("format size/precision too long in function `format'");
212 }
213 else if (form[i] == '.')
214 size = 0; /* re-start */
215 if (++i >= MAX_FORMAT)
216 lua_error("bad format in function `format'");
217 form[i] = *strfrmt++;
218 }
219 form[i+1] = 0; /* ends string */
220 switch (form[i])
221 {
222 case 'q':
223 luaI_addquoted(lua_check_string(arg++, "format"));
224 buff[0] = '\0'; /* addchar already done */
225 break;
226 case 's':
227 {
228 char *s = lua_check_string(arg++, "format");
229 if (strlen(s) >= MAX_CONVERTION)
230 lua_error("string argument too long in function `format'");
231 sprintf(buff, form, s);
232 break;
233 }
234 case 'c': case 'd': case 'i': case 'o':
235 case 'u': case 'x': case 'X':
236 sprintf(buff, form, (int)lua_check_number(arg++, "format"));
237 break;
238 case 'e': case 'E': case 'f': case 'g':
239 sprintf(buff, form, lua_check_number(arg++, "format"));
240 break;
241 default: /* also treat cases 'pnLlh' */
242 lua_error("invalid format option in function `format'");
243 }
244 for (i=0; buff[i]; i++) /* move formated value to result */
245 luaI_addchar(buff[i]);
246 }
175 }247 }
176 s[i-1] = 0;248 lua_pushstring(luaI_addchar(0)); /* push the result */
177 lua_pushstring(s);
178}249}
179 250
251
252void luaI_openlib (struct lua_reg *l, int n)
253{
254 int i;
255 for (i=0; i<n; i++)
256 lua_register(l[i].name, l[i].func);
257}
258
259static struct lua_reg strlib[] = {
260{"strfind", str_find},
261{"strlen", str_len},
262{"strsub", str_sub},
263{"strlower", str_lower},
264{"strupper", str_upper},
265{"ascii", str_ascii},
266{"format", str_format}
267};
268
269
180/*270/*
181** Open string library271** Open string library
182*/272*/
183void strlib_open (void)273void strlib_open (void)
184{274{
185 lua_register ("strfind", str_find);275 luaI_openlib(strlib, (sizeof(strlib)/sizeof(strlib[0])));
186 lua_register ("strlen", str_len);
187 lua_register ("strsub", str_sub);
188 lua_register ("strlower", str_lower);
189 lua_register ("strupper", str_upper);
190 lua_register ("ascii", str_ascii);
191 lua_register ("int2str", str_int2str);
192}276}
clients/lua/Makefile+5−8
@@ -1,21 +1,18 @@
1# makefile for lua interpreter1# makefile for lua interpreter
2 2
3BIN= $(LUA)/bin3LUA= ../..
4INC= $(LUA)/include
5LIB= $(LUA)/lib
6 4
7CC= gcc5include $(LUA)/config
8CFLAGS= $(INCS) $(DEFS) $(WARN) -O2
9 6
10# in SunOs /usr/5include contains prototypes for standard lib7EXTRA_DEFS= $(POSIX)
11INCS= -I/usr/5include -I$(INC)
12WARN= -Wall -Wmissing-prototypes -Wshadow -ansi
13 8
14OBJS= lua.o9OBJS= lua.o
15SRCS= lua.c10SRCS= lua.c
16 11
17T=$(BIN)/lua12T=$(BIN)/lua
18 13
14all: $T
15
19$T: $(OBJS)16$T: $(OBJS)
20 $(CC) -o $@ $(OBJS) -L$(LIB) -llua -llualib -lm17 $(CC) -o $@ $(OBJS) -L$(LIB) -llua -llualib -lm
21 18
clients/lua/lua.c+11−3
@@ -3,7 +3,7 @@ · 2 unmodified lines
3** Linguagem para Usuarios de Aplicacao3** Linguagem para Usuarios de Aplicacao
4*/4*/
5 5
6char *rcs_lua="$Id: lua.c,v 1.7 1995/10/31 17:05:35 roberto Exp $";6char *rcs_lua="$Id: lua.c,v 1.10 1996/05/03 19:20:17 roberto Exp $";
7 7
8#include <stdio.h>8#include <stdio.h>
9#include <string.h>9#include <string.h>
@@ -14,11 +14,15 @@ char *rcs_lua="$Id: lua.c,v 1.7 1995/10/31 17:05:35 roberto Exp $"; · 4 unmodified lines
14static int lua_argc;14static int lua_argc;
15static char **lua_argv;15static char **lua_argv;
16 16
17#ifdef POSIX
17/*18/*
18** although this function is POSIX, there is no standard header file that19** although this function is POSIX, there is no standard header file that
19** defines it20** defines it
20*/21*/
21int isatty (int fd);22int isatty (int fd);
23#else
24#define isatty(x) (x==0) /* assume stdin is a tty */
25#endif
22 26
23/*27/*
24%F Allow Lua code to access argv strings.28%F Allow Lua code to access argv strings.
@@ -41,10 +45,10 @@ static void lua_getargv (void) · 16 unmodified lines
41 45
42static void manual_input (void)46static void manual_input (void)
43{47{
44 if (isatty(fileno(stdin)))48 if (isatty(0))
45 {49 {
46 char buffer[250];50 char buffer[250];
47 while (gets(buffer) != 0)51 while (fgets(buffer, sizeof(buffer), stdin) != 0)
48 lua_dostring(buffer);52 lua_dostring(buffer);
49 }53 }
50 else54 else
@@ -83,7 +87,11 @@ int main (int argc, char *argv[]) · 32 unmodified lines
83 printf("%s %s\n(written by %s)\n\n",87 printf("%s %s\n(written by %s)\n\n",
84 LUA_VERSION, LUA_COPYRIGHT, LUA_AUTHORS);88 LUA_VERSION, LUA_COPYRIGHT, LUA_AUTHORS);
85 else89 else
90 {
86 result = lua_dofile (argv[i]);91 result = lua_dofile (argv[i]);
92 if (result)
93 fprintf(stderr, "lua: error trying to run file %s\n", argv[i]);
94 }
87 }95 }
88 }96 }
89 return result;97 return result;
config+28−0
@@ -0,0 +1,28 @@
1# configuration file for making Lua
2
3# you need an ANSI C compiler
4CC= gcc
5WARN= -Wall -Wmissing-prototypes -Wshadow -ansi
6
7# in SunOs 4.1.x, uncomment the following line to avoid prototypes warnings
8# for standard functions
9#EXTRA_INCS= -I/usr/5include
10
11# if you don't have popen() in your C library, comment the following line:
12POPEN= -DPOPEN
13
14# if your C library is not POSIX compliant, comment the following line:
15POSIX= -DPOSIX
16
17### NO NEED TO CHANGE ANYTHING BELOW THIS LINE ================================
18
19VERSION= 2.4
20
21INC= $(LUA)/include
22LIB= $(LUA)/lib
23BIN= $(LUA)/bin
24
25INCS= -I$(INC) $(EXTRA_INCS)
26DEFS= $(EXTRA_DEFS)
27
28CFLAGS= -O2 $(WARN) $(INCS) $(DEFS)
doc/Makefile+9−2
@@ -1,16 +1,23 @@
1# makefile for lua distribution1# makefile for lua distribution
2 2
3all:3all:
4 rm -f manual.id
5 touch manual.id
4 latex manual.tex6 latex manual.tex
5 latex manual.tex7 latex manual.tex
8 makeindex manual
9 sort -df manual.idx | sed -e 's/_/\\_/g' >manual.id
10 latex manual.tex
6 dvips -o manual.ps manual.dvi11 dvips -o manual.ps manual.dvi
7 rm -f manual.tex manual.aux manual.log12 gzip manual.ps
13 mv manual.ps.gz refman.ps.gz
14 rm -f manual.*
8 15
9clean:16clean:
10 rm -f manual.tex17 rm -f manual.tex
11 18
12co:19co:
13 co -f -M manual.tex20 co -f -M manual.tex luac.man
14 21
15klean: clean22klean: clean
16 rm -f manual.tex manual.ps manual.dvi23 rm -f manual.tex manual.ps manual.dvi
doc/luac.man+75−0
@@ -0,0 +1,75 @@
1.\" $Id: luac.man,v 1.3 1996/03/28 20:24:55 lhf Exp $
2.TH LUAC 1 "12 March 1996"
3.SH NAME
4luac \- Lua compiler
5.SH SYNOPSIS
6.B luac
7[
8.B \-dlpv
9]
10[
11.B \-o
12.I outputfile
13]
14.I sourcefile
15\&.\|.\|.
16.SH DESCRIPTION
17.B luac
18is the Lua compiler.
19It translates programs written in the Lua programming language
20into binary files that can be loaded and executed with
21.B lua_dofile
22in C or
23.B dofile
24in Lua.
25
26.BR luac
27produces a single output file containing the bytecode
28for all named source files.
29By default,
30the output file is named
31.BR luac.out ,
32but you can change this with the
33.B \-o
34option.
35
36You can use "-" to indicate stdin as a source file.
37.SH OPTIONS
38.LP
39.TP 1i
40.B \-d
41turns debugging on.
42.TP
43.B \-l
44produces a listing of the compiled bytecode for Lua's virtual machine.
45.TP
46.B \-p
47parses sources files but does not generate any output file.
48.TP
49.B \-v
50prints version information.
51.TP
52.BI \-o " outputfile"
53Name the output file
54.IR output ,
55instead of the default
56.BR luac.out .
57The output file cannot be a source file.
58.SH FILES
59.PD 0
60.TP 20
61.B luac.out
62default output file
63.PD
64.SH "SEE ALSO"
65.BR lua (1)
66.LP
67.IR "Reference Manual of the Programming Language Lua"
68.SH DIAGNOSTICS
69Error messages should be self explanatory.
70.SH BUGS
71Inherits any bugs from Lua,
72but Lua has no bugs...
73.SH AUTHORS
74W. Celes, R. Ierusalimschy & L. H. de Figueiredo
75(lua@icad.puc-rio.br)
doc/luac.ps+246−0
@@ -0,0 +1,246 @@
1%!PS-Adobe-3.0
2%%Creator: groff version 1.09
3%%CreationDate: Fri Mar 29 10:45:53 1996
4%%DocumentNeededResources: font Times-Roman
5%%+ font Times-Bold
6%%+ font Times-Italic
7%%DocumentSuppliedResources: procset grops 1.09 0
8%%Pages: 1
9%%PageOrder: Ascend
10%%Orientation: Portrait
11%%EndComments
12%%BeginProlog
13%%BeginResource: procset grops 1.09 0
14/setpacking where{
15pop
16currentpacking
17true setpacking
18}if
19/grops 120 dict dup begin
20/SC 32 def
21/A/show load def
22/B{0 SC 3 -1 roll widthshow}bind def
23/C{0 exch ashow}bind def
24/D{0 exch 0 SC 5 2 roll awidthshow}bind def
25/E{0 rmoveto show}bind def
26/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
27/G{0 rmoveto 0 exch ashow}bind def
28/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
29/I{0 exch rmoveto show}bind def
30/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
31/K{0 exch rmoveto 0 exch ashow}bind def
32/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
33/M{rmoveto show}bind def
34/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
35/O{rmoveto 0 exch ashow}bind def
36/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
37/Q{moveto show}bind def
38/R{moveto 0 SC 3 -1 roll widthshow}bind def
39/S{moveto 0 exch ashow}bind def
40/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
41/SF{
42findfont exch
43[exch dup 0 exch 0 exch neg 0 0]makefont
44dup setfont
45[exch/setfont cvx]cvx bind def
46}bind def
47/MF{
48findfont
49[5 2 roll
500 3 1 roll
51neg 0 0]makefont
52dup setfont
53[exch/setfont cvx]cvx bind def
54}bind def
55/level0 0 def
56/RES 0 def
57/PL 0 def
58/LS 0 def
59/PLG{
60gsave newpath clippath pathbbox grestore
61exch pop add exch pop
62}bind def
63/BP{
64/level0 save def
651 setlinecap
661 setlinejoin
6772 RES div dup scale
68LS{
6990 rotate
70}{
710 PL translate
72}ifelse
731 -1 scale
74}bind def
75/EP{
76level0 restore
77showpage
78}bind def
79/DA{
80newpath arcn stroke
81}bind def
82/SN{
83transform
84.25 sub exch .25 sub exch
85round .25 add exch round .25 add exch
86itransform
87}bind def
88/DL{
89SN
90moveto
91SN
92lineto stroke
93}bind def
94/DC{
95newpath 0 360 arc closepath
96}bind def
97/TM matrix def
98/DE{
99TM currentmatrix pop
100translate scale newpath 0 0 .5 0 360 arc closepath
101TM setmatrix
102}bind def
103/RC/rcurveto load def
104/RL/rlineto load def
105/ST/stroke load def
106/MT/moveto load def
107/CL/closepath load def
108/FL{
109currentgray exch setgray fill setgray
110}bind def
111/BL/fill load def
112/LW/setlinewidth load def
113/RE{
114findfont
115dup maxlength 1 index/FontName known not{1 add}if dict begin
116{
1171 index/FID ne{def}{ pop pop}ifelse
118}forall
119/Encoding exch def
120dup/FontName exch def
121currentdict end definefont pop
122}bind def
123/DEFS 0 def
124/EBEGIN{
125moveto
126DEFS begin
127}bind def
128/EEND/end load def
129/CNT 0 def
130/level1 0 def
131/PBEGIN{
132/level1 save def
133translate
134div 3 1 roll div exch scale
135neg exch neg exch translate
1360 setgray
1370 setlinecap
1381 setlinewidth
1390 setlinejoin
14010 setmiterlimit
141[] 0 setdash
142/setstrokeadjust where{
143pop
144false setstrokeadjust
145}if
146/setoverprint where{
147pop
148false setoverprint
149}if
150newpath
151/CNT countdictstack def
152userdict begin
153/showpage{} def
154}bind def
155/PEND{
156clear
157countdictstack CNT sub{end}repeat
158level1 restore
159}bind def
160end def
161/setpacking where{
162pop
163setpacking
164}if
165%%EndResource
166%%IncludeResource: font Times-Roman
167%%IncludeResource: font Times-Bold
168%%IncludeResource: font Times-Italic
169grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
170def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
171/scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef
172/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
173/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
174/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
175/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
176/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
177/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
178/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
179/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
180/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
181/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
182/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
183/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
184/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
185/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
186/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
187/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
188/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
189/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
190/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
191/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
192/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
193/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
194/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
195/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
196/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
197/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE
198/Times-Roman@0 ENC0/Times-Roman RE
199%%EndProlog
200%%Page: 1 1
201%%BeginPageSetup
202BP
203%%EndPageSetup
204/F0 10/Times-Roman@0 SF(LU)72 48 Q -.034 -.4(AC \( 1 \))-.4 H
205(User Commands)157.852 E(LU)157.452 E -.034 -.4(AC \( 1 \))-.4 H/F1 9
206/Times-Bold@0 SF -.18(NA)72 96 S(ME).18 E F0(luac \255 Lua compiler)108
207108 Q F1(SYNOPSIS)72 124.8 Q/F2 10/Times-Bold@0 SF(luac)108 136.8 Q F0
208([)3.75 E F2(\255dlpv)3.75 E F0 3.75(][)3.75 G F2<ad6f>A/F3 10
209/Times-Italic@0 SF(output\214le)3.75 E F0(])3.75 E F3(sour)3.75 E
210(ce\214le)-.37 E F0 1.666(...)3.75 G F1(DESCRIPTION)72 153.6 Q F2(luac)
211108 165.6 Q F0 .371(is the Lua compiler)2.871 F 5.371(.I)-.55 G 2.871
212(tt)-5.371 G .37(ranslates programs written in the Lua programming lang\
213uage into binary \214les)-2.871 F(that can be loaded and e)108 177.6 Q
214-.15(xe)-.15 G(cuted with).15 E F2(lua_do\214le)2.5 E F0(in C or)2.5 E
215F2(do\214le)2.5 E F0(in Lua.)2.5 E F2(luac)108 201.6 Q F0 .159(produces\
216 a single output \214le containing the bytecode for all named source \
217\214les.)2.658 F .159(By def)5.159 F .159(ault, the output)-.1 F
218(\214le is named)108 213.6 Q F2(luac.out)2.5 E F0 2.5(,b)C
219(ut you can change this with the)-2.7 E F2<ad6f>2.5 E F0(option.)2.5 E
220-1.1(Yo)108 237.6 S 2.5(uc)1.1 G
221(an use "-" to indicate stdin as a source \214le.)-2.5 E F1(OPTIONS)72
222254.4 Q F2<ad64>108 266.4 Q F0(turns deb)60.74 E(ugging on.)-.2 E F2
223<ad6c>108 283.2 Q F0
224(produces a listing of the compiled bytecode for Lua')63.52 E 2.5(sv)
225-.55 G(irtual machine.)-2.5 E F2<ad70>108 300 Q F0
226(parses sources \214les b)60.74 E(ut does not generate an)-.2 E 2.5(yo)
227-.15 G(utput \214le.)-2.5 E F2<ad76>108 316.8 Q F0(prints v)61.3 E
228(ersion information.)-.15 E F2<ad6f>108 333.6 Q F3(output\214le)2.5 E F0
229.657(Name the output \214le)21.02 F F3(output)3.157 E F0 3.157(,i)C .657
230(nstead of the def)-3.157 F(ault)-.1 E F2(luac.out)3.157 E F0 5.657(.T)C
231.656(he output \214le cannot be a)-5.657 F(source \214le.)180 345.6 Q F1
232(FILES)72 362.4 Q F2(luac.out)108 374.4 Q F0(def)65.83 E
233(ault output \214le)-.1 E F1(SEE ALSO)72 391.2 Q F2(lua)108 403.2 Q F0
234(\(1\))A F3(Refer)108 420 Q(ence Manual of the Pr)-.37 E -.1(og)-.45 G
235-.15(ra).1 G(mming Langua).15 E .2 -.1(ge L)-.1 H(ua).1 E F1(DIA)72
236436.8 Q(GNOSTICS)-.495 E F0(Error messages should be self e)108 448.8 Q
237(xplanatory)-.15 E(.)-.65 E F1 -.09(BU)72 465.6 S(GS).09 E F0
238(Inherits an)108 477.6 Q 2.5(yb)-.15 G(ugs from Lua, b)-2.7 E
239(ut Lua has no b)-.2 E(ugs...)-.2 E F1 -.45(AU)72 494.4 S(THORS).45 E F0
2401.84 -.92(W. C)108 506.4 T(eles, R. Ierusalimsch).92 E 2.5(y&L)-.05 G
2412.5(.H)-2.5 G 2.5(.d)-2.5 G 2.5(eF)-2.5 G
242(igueiredo \(lua@icad.puc-rio.br\))-2.5 E(29 March 1996)72 768 Q
243(12 March 1996)142.35 E(1)198.45 E EP
244%%Trailer
245end
246%%EOF
doc/luac.txt+66−0
@@ -0,0 +1,66 @@
1
2
3
4LUAC(1) User Commands LUAC(1)
5
6
7
8NAME
9 luac - Lua compiler
10
11SYNOPSIS
12 luac [ -dlpv ] [ -o outputfile ] sourcefile ...
13
14DESCRIPTION
15 luac is the Lua compiler. It translates programs written in
16 the Lua programming language into binary files that can be
17 loaded and executed with lua_dofile in C or dofile in Lua.
18
19 luac produces a single output file containing the bytecode
20 for all named source files. By default, the output file is
21 named luac.out, but you can change this with the -o option.
22
23 You can use "-" to indicate stdin as a source file.
24
25OPTIONS
26 -d turns debugging on.
27
28 -l produces a listing of the compiled bytecode for
29 Lua's virtual machine.
30
31 -p parses sources files but does not generate any
32 output file.
33
34 -v prints version information.
35
36 -o outputfile
37 Name the output file output, instead of the
38 default luac.out. The output file cannot be a
39 source file.
40
41FILES
42 luac.out default output file
43
44SEE ALSO
45 lua(1)
46
47 Reference Manual of the Programming Language Lua
48
49DIAGNOSTICS
50 Error messages should be self explanatory.
51
52BUGS
53 Inherits any bugs from Lua, but Lua has no bugs...
54
55AUTHORS
56 W. Celes, R. Ierusalimschy & L. H. de Figueiredo
57 (lua@icad.puc-rio.br)
58
59
60
61
62
63Formatted 96/03/29 12 March 1996 1
64
65
66
doc/manual.ps+0−2859
@@ -1,2859 +0,0 @@
1%!PS-Adobe-2.0
2%%Creator: dvips 5.58 Copyright 1986, 1994 Radical Eye Software
3%%Title: manual.dvi
4%%CreationDate: Tue Nov 28 10:59:43 1995
5%%Pages: 27
6%%PageOrder: Ascend
7%%BoundingBox: 0 0 612 792
8%%EndComments
9%DVIPSCommandLine: /software/tex/bin/_dvips -o manual.ps manual.dvi
10%DVIPSParameters: dpi=300, comments removed
11%DVIPSSource: TeX output 1995.11.28:1056
12%%BeginProcSet: tex.pro
13/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N
14/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72
15mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1}
16ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
17isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div
18hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul
19TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if}
20forall round exch round exch]setmatrix}N /@landscape{/isls true N}B
21/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B
22/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{
23/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N
24string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N
25end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{
26/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]
27N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup
28length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{
29128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub
30get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data
31dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N
32/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup
33/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx
340 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff
35setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff
36.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]}
37if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup
38length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{
39cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin
400 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul
41add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict
42/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook
43known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X
44/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for
4565781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0
460]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V
47{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7
48getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false}
49ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false
50RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1
51false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform
52round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg
53rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail
54{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M}
55B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{
564 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{
57p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p
58a}B /bos{/SS save N}B /eos{SS restore}B end
59%%EndProcSet
60TeXDict begin 40258431 52099146 1000 300 300
61(/home/lhf/w/doc/lua/html/save/manual.dvi) @start /Fa
627 121 df<07F8001FFE003FFF803E07C03E03C01C01E00001E0003FE003FFE00FFFE03F
63C1E07C01E07801E0F001E0F001E0F001E07803E07C07E03FFFFE1FFEFE03F87E17157E94
641A>97 D<01F80007FF000FFF801F07C03C03C07801E07801E0F000F0F000F0FFFFF0FFFF
65F0FFFFF0F000007000007800007C00F03E00F01F03F00FFFE003FFC000FE0014157D941A
66>101 D<7F0F8000FF7FE0007FFFF0000FF0F0000FC078000F8078000F0078000F007800
670F0078000F0078000F0078000F0078000F0078000F0078000F0078000F0078000F007800
680F0078007FE1FF00FFF3FF807FE1FF00191580941A>110 D<7FC1F8FFC7FC7FDFFE03FE
691E03F80C03F00003E00003E00003C00003C00003C00003C00003C00003C00003C00003C0
700003C00003C0007FFF80FFFF807FFF8017157F941A>114 D<01C00003C00003C00003C0
710003C00003C00003C0007FFFE0FFFFE0FFFFE003C00003C00003C00003C00003C00003C0
720003C00003C00003C00003C00003C0F003C0F003C0F003C0F001E1E001FFE000FF80003F
7300141C7F9B1A>116 D<7FC7FCFFC7FE7FC7FC0F01E00F01E00F01E00F83E00783C00783
74C00783C003C78003C78003C78001C70001EF0001EF0001EF0000FE0000FE0000FE00007C
750017157F941A>118 D<7FC7F87FCFFC7FC7F80787C007C78003EF8001FF0000FE0000FC
7600007C00007C00007C0000FE0001EF0003EF0003C7800783C00F83E07FC7FCFFC7FE7FC7
77FC17157F941A>120 D E /Fb 1 122 df<1C0C2E1C4E1C8E389C381C381C383870387038
7870387018E00FE000E000C0E1C0E38047003C000E137F8C11>121
79D E /Fc 2 121 df<70F8F8F87005057C840D>58 D<07C3C00FE7E0187C603078F06079
80F06079F0C0F1E000F1C000F00000F00001E00001E00039E00079E030FBC060FBC060F3C0
81C0E7E3807CFF00383C0014147E931A>120 D E /Fd 47 121 df<0007F800007FFE0001
82FC0F0003F01F0007E03F800FC03F800FC03F800FC03F800FC01F000FC004000FC000000F
83C000000FC00000FFFFFF80FFFFFF80FFFFFF800FC01F800FC01F800FC01F800FC01F800F
84C01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800F
85C01F800FC01F800FC01F807FF8FFF07FF8FFF07FF8FFF01C237FA21F>12
86D<3C7EFFFFFFFF7E3C08087C8710>46 D<0000180000380000380000700000700000E000
8700E00000E00001C00001C0000380000380000380000700000700000700000E00000E0000
881C00001C00001C0000380000380000700000700000700000E00000E00001C00001C00001
89C0000380000380000700000700000700000E00000E00000E00001C00001C000038000038
900000380000700000700000E00000E00000C0000015317DA41C>I<00180000780003F800
91FFF800FFF800FDF80001F80001F80001F80001F80001F80001F80001F80001F80001F800
9201F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F800
9301F80001F8007FFFE07FFFE07FFFE013207C9F1C>49 D<03FC000FFF003FFFC0783FE07C
940FF0FE07F0FE03F8FE03F8FE03F87C03F83803F80003F80003F00007F00007E0000FC000
951F80001F00003C0000780000F00001E03803C0380700380600380C00781FFFF03FFFF07F
96FFF0FFFFF0FFFFF0FFFFF015207D9F1C>I<01FE0007FF800FFFE01E07F03F03F03F03F8
973F83F83F03F81F03F80C03F80003F00007E00007C0001F8001FE0001FF000007E00003F0
980001F80001FC0001FE0001FE7C01FE7C01FEFE01FEFE01FCFE01FC7C03F87C07F03FFFE0
990FFFC003FE0017207E9F1C>I<0000E00001E00003E00007E0000FE0000FE0001FE0003F
100E00077E000E7E000E7E001C7E00387E00707E00E07E00E07E01C07E03807E07007E0E007
101E0FFFFFFFFFFFFFFFFFF0007E00007E00007E00007E00007E00007E000FFFF00FFFF00FF
102FF18207E9F1C>I<2000603C01E03FFFC03FFFC03FFF803FFE003FFC003FF00038000038
103000038000038000039FC003FFF003E0FC03807E03003F00003F00003F00003F80003F838
10403F87C03F8FC03F8FC03F8FC03F0F803F07007E03C0FC03FFF800FFF0003F80015207D9F
1051C>I<001F8000FFE003FFF007F0F00FC1F81F81F83F01F83F01F87E00F07E00007E0000
106FE0800FE7FC0FEFFE0FF81F0FF00F8FF00FCFF00FCFE00FEFE00FEFE00FEFE00FE7E00FE
1077E00FE7E00FE3E00FC3E00FC1F00F80F83F007FFE003FFC000FF0017207E9F1C>I<7000
108007C00007FFFFE7FFFFE7FFFFE7FFFFC7FFFF87FFFF0F00070E000E0E001C0E00380E007
10900000E00000E00001C00003C0000380000780000780000F80000F00001F00001F00001F0
1100001F00003F00003F00003F00003F00003F00003F00003F00001E00017227DA11C>I<00
111FE0003FFC007FFE00F83F01E01F01E00F83E00F83E00F83F00F83F80F83FE1F01FF9E01F
112FFC00FFF8007FFC003FFE00FFFF01F7FF83E1FFC7C07FC7C01FEF800FEF8007EF8003EF8
113003EF8003E7C003C7E00783F01F81FFFF00FFFC001FF0017207E9F1C>I<000070000000
11400F800000000F800000000F800000001FC00000001FC00000003FE00000003FE00000003
115FE000000077F000000077F0000000F7F8000000E3F8000000E3F8000001C1FC000001C1F
116C000003C1FE00000380FE00000380FE00000700FF000007007F00000F007F80000FFFFF8
1170000FFFFF80001FFFFFC0001C001FC0001C001FC00038000FE00038000FE00078000FF00
1180700007F00FFF007FFF8FFF007FFF8FFF007FFF825227EA12A>65
119D<0003FE0180001FFF838000FFFFE78001FF00FF8003F8003F8007F0001F800FE0000F80
1201FC0000F803F800007803F800007807F800003807F000003807F00000380FF00000000FF
12100000000FF00000000FF00000000FF00000000FF00000000FF00000000FF000000007F00
1220000007F000003807F800003803F800003803F800007801FC00007000FE0000F0007F000
1231E0003F8003C0001FF00F80000FFFFF000001FFFC0000003FE000021227DA128>67
124D<FFFFFF8000FFFFFFF000FFFFFFFC0007F003FE0007F0007F0007F0003F8007F0001FC0
12507F0000FE007F0000FE007F0000FF007F00007F007F00007F007F00007F007F00007F807
126F00007F807F00007F807F00007F807F00007F807F00007F807F00007F807F00007F807F0
1270007F807F00007F007F00007F007F00007F007F0000FE007F0000FE007F0001FC007F000
1283F8007F0007F0007F003FE00FFFFFFFC00FFFFFFF000FFFFFF800025227EA12B>I<FFFF
129FFFCFFFFFFFCFFFFFFFC07F001FC07F0007C07F0003C07F0001C07F0001E07F0001E07F0
1301C0E07F01C0E07F01C0E07F01C0E07F03C0007F07C0007FFFC0007FFFC0007FFFC0007F0
1317C0007F03C0007F01C0707F01C0707F01C0707F01C0E07F0000E07F0000E07F0001E07F0
132001E07F0003E07F0007E07F001FCFFFFFFFCFFFFFFFCFFFFFFFC20227EA125>I<FFFFFF
133F8FFFFFFF8FFFFFFF807F003F807F000F807F0007807F0003807F0003C07F0003C07F01C
1341C07F01C1C07F01C1C07F01C1C07F03C0007F07C0007FFFC0007FFFC0007FFFC0007F07C
1350007F03C0007F01C0007F01C0007F01C0007F01C0007F0000007F0000007F0000007F000
1360007F0000007F0000007F00000FFFFC000FFFFC000FFFFC0001E227EA123>I<FFFF83FF
137FEFFFF83FFFEFFFF83FFFE07F0001FC007F0001FC007F0001FC007F0001FC007F0001FC0
13807F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007
139FFFFFFC007FFFFFFC007FFFFFFC007F0001FC007F0001FC007F0001FC007F0001FC007F0
140001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F000
1411FC007F0001FC0FFFF83FFFEFFFF83FFFEFFFF83FFFE27227EA12C>72
142D<FFFF80FFFF80FFFF8007F00007F00007F00007F00007F00007F00007F00007F00007F0
1430007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0
1440007F00007F00007F00007F00007F00007F00007F000FFFF80FFFF80FFFF8011227EA115
145>I<FFFFC000FFFFC000FFFFC00007F0000007F0000007F0000007F0000007F0000007F0
146000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0
147000007F0000007F0000007F0003807F0003807F0003807F0003807F0007807F0007807F0
148007807F000F007F001F007F003F007F00FF0FFFFFFF0FFFFFFF0FFFFFFF01D227EA122>
14976 D<FFF800001FFFFFF800001FFFFFFC00003FFF07FC00003FE007FC00003FE0077E00
1500077E0077E000077E0073F0000E7E0073F0000E7E0071F8001C7E0071F8001C7E0071F80
15101C7E0070FC00387E0070FC00387E00707E00707E00707E00707E00703F00E07E00703F0
1520E07E00703F00E07E00701F81C07E00701F81C07E00700FC3807E00700FC3807E007007E
1537007E007007E7007E007007E7007E007003FE007E007003FE007E007001FC007E007001F
154C007E007000F8007E0FFF80F80FFFFFFF80F80FFFFFFF80700FFFF30227EA135>I<0007
155FC0000003FFF800000FE0FE00003F803F80007E000FC000FC0007E001FC0007F001F8000
1563F003F80003F803F80003F807F00001FC07F00001FC07F00001FC0FF00001FE0FF00001F
157E0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0
1587F00001FC07F80003FC07F80003FC03F80003F803FC0007F801FC0007F000FE000FE0007
159F001FC0003F803F80000FE0FE000003FFF80000007FC000023227DA12A>79
160D<FFFFFF00FFFFFFE0FFFFFFF007F007F807F001FC07F001FE07F000FE07F000FF07F000
161FF07F000FF07F000FF07F000FF07F000FF07F000FE07F001FE07F001FC07F007F807FFFF
162F007FFFFC007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000
1630007F0000007F0000007F0000007F00000FFFF8000FFFF8000FFFF800020227EA126>I<
16401FE0607FF8E1FFFFE3F01FE7C007E78003E78001EF8001EF8000EF8000EFC0000FF0000
165FFE0007FFF007FFFC03FFFF01FFFF80FFFFC03FFFE003FFE0003FE00007F00003F00001F
166E0001FE0001FE0001FF0001EF0003EFC003CFF00FCFFFFF8E7FFE0C0FF8018227DA11F>
16783 D<7FFFFFFF807FFFFFFF807FFFFFFF807E03F81F807C03F807807803F807807003F8
1680380F003F803C0F003F803C0E003F801C0E003F801C0E003F801C0E003F801C00003F800
169000003F800000003F800000003F800000003F800000003F800000003F800000003F80000
1700003F800000003F800000003F800000003F800000003F800000003F800000003F8000000
17103F800000003F800000003F8000001FFFFF00001FFFFF00001FFFFF00022227EA127>I<
172FFFF001FFEFFFF001FFEFFFF001FFE07F00001C007F80003C003F800038003FC00078001
173FC00070001FC00070000FE000E0000FE000E0000FF001E00007F001C00007F803C00003F
174803800003F803800001FC07000001FC07000001FE0F000000FE0E000000FF0E0000007F1
175C0000007F1C0000007FBC0000003FB80000003FF80000001FF00000001FF00000000FE00
176000000FE00000000FE000000007C000000007C0000000038000027227FA12A>86
177D<0FFE003FFF807E07E07E03F07E01F07E01F83C01F80001F80001F800FFF807FFF81FE1
178F83F01F87E01F8FC01F8FC01F8FC01F8FC01F87E03F87E0EFF1FFCFF07F03F18167E951B
179>97 D<FF800000FF800000FF8000001F8000001F8000001F8000001F8000001F8000001F
1808000001F8000001F8000001F8000001F8000001F8FE0001FFFF8001FF07C001FC03E001F
181801F001F800F801F800F801F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F
182800FC01F800FC01F800F801F801F801F801F001FC03E001FE07C001E7FF8001C0FC0001A
183237EA21F>I<00FF8007FFE00F83F01F03F03E03F07E03F07C01E07C0000FC0000FC0000
184FC0000FC0000FC0000FC00007C00007E00007E00003E00381F00700FC0F007FFC000FF00
18515167E9519>I<0001FF000001FF000001FF0000003F0000003F0000003F0000003F0000
186003F0000003F0000003F0000003F0000003F0000003F0001FE3F0007FFBF000F81FF001F
187007F003E003F007E003F007C003F00FC003F00FC003F00FC003F00FC003F00FC003F00FC
188003F00FC003F00FC003F007C003F007C003F003E003F001F00FF000F83FFE007FFBFE001
189FC3FE01B237EA21F>I<00FE0007FF800F87C01E01E03E01F07C00F07C00F8FC00F8FC00
190F8FFFFF8FFFFF8FC0000FC0000FC00007C00007C00007E00003E00381F00700FC0F003FF
191C000FF0015167E951A>I<01FE1F0007FFFF800F87E7801F03E7801E01E7003E01F0003E
19201F0003E01F0003E01F0003E01F0001E01E0001F03E0000F87C0000FFF800019FE000018
1930000001C0000001C0000001FFFE0001FFFF8000FFFFE000FFFFF003FFFFF007C003F80F8
194001F80F8000F80F8000F80F8000F807C001F007E003F001F80FC000FFFF80001FFC00019
195217F951C>103 D<FF800000FF800000FF8000001F8000001F8000001F8000001F800000
1961F8000001F8000001F8000001F8000001F8000001F8000001F87E0001F9FF8001FB8FC00
1971FE07C001FC07E001FC07E001F807E001F807E001F807E001F807E001F807E001F807E00
1981F807E001F807E001F807E001F807E001F807E001F807E001F807E00FFF1FFC0FFF1FFC0
199FFF1FFC01A237EA21F>I<1E003F007F807F807F807F803F001E00000000000000000000
200000000FF80FF80FF801F801F801F801F801F801F801F801F801F801F801F801F801F801F
201801F801F80FFF0FFF0FFF00C247FA30F>I<003C007E00FF00FF00FF00FF007E003C0000
2020000000000000000000003FF03FF03FF003F003F003F003F003F003F003F003F003F003F
203003F003F003F003F003F003F003F003F003F003F003F003F783FFC3FFC3EFC7E78FC7FF0
2041FC0102E83A311>I<FF800000FF800000FF8000001F8000001F8000001F8000001F8000
205001F8000001F8000001F8000001F8000001F8000001F8000001F83FF801F83FF801F83FF
206801F80F0001F83E0001F8780001F8F00001F9E00001FBE00001FFE00001FFF00001FFF80
207001FCFC0001F8FC0001F87E0001F83F0001F83F0001F81F8001F80FC00FFF1FFC0FFF1FF
208C0FFF1FFC01A237EA21E>I<FF80FF80FF801F801F801F801F801F801F801F801F801F80
2091F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F80
2101F801F80FFF0FFF0FFF00C237FA20F>I<FF87F00FE000FF9FFC3FF800FFB87E70FC001F
211E03EC07C001FC03F807E001FC03F807E001F803F007E001F803F007E001F803F007E001F
212803F007E001F803F007E001F803F007E001F803F007E001F803F007E001F803F007E001F
213803F007E001F803F007E001F803F007E001F803F007E00FFF1FFE3FFC0FFF1FFE3FFC0FF
214F1FFE3FFC02A167E952F>I<FF87E000FF9FF800FFB8FC001FE07C001FC07E001FC07E00
2151F807E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F807E00
2161F807E001F807E001F807E001F807E00FFF1FFC0FFF1FFC0FFF1FFC01A167E951F>I<00
217FE0007FFC00F83E01E00F03E00F87C007C7C007C7C007CFC007EFC007EFC007EFC007EFC
218007EFC007EFC007E7C007C7C007C3E00F81F01F00F83E007FFC000FE0017167E951C>I<
219FF8FE000FFFFF800FFF07C001FC03E001F801F001F801F801F801F801F800FC01F800FC0
2201F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F801F801F801F801F803F00
2211FC03E001FE0FC001FFFF8001F8FC0001F8000001F8000001F8000001F8000001F800000
2221F8000001F800000FFF00000FFF00000FFF000001A207E951F>I<FF0F80FF1FE0FF33F0
2231F63F01FC3F01FC3F01FC1E01F80001F80001F80001F80001F80001F80001F80001F8000
2241F80001F80001F80001F8000FFF800FFF800FFF80014167F9517>114
225D<07F3001FFF00781F00700F00F00700F00700F80000FF0000FFF0007FFC003FFE001FFF
2260007FF00003F80E00F80E00780F00780F00780F80700FC1E00FFFC00C7F00011167E9516
227>I<01C00001C00001C00001C00003C00003C00003C00007C00007C0000FC0003FFF00FF
228FF00FFFF000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000F
229C3800FC3800FC3800FC3800FC3800FC30007E70003FE0000FC0011207F9F16>I<FF83FE
23000FF83FE00FF83FE001F807E001F807E001F807E001F807E001F807E001F807E001F807E
231001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F80FE001F80FE
232000F83FFC007FF7FC001FC7FC01A167E951F>I<FFF03FE0FFF03FE0FFF03FE00FC00E00
2330FE01E0007E01C0007E01C0003F0380003F0380003F8780001F8700001FCF00000FCE000
23400FCE000007FC000007FC000007FC000003F8000003F8000001F0000001F0000000E0000
2351B167F951E>I<FFE3FF8FF8FFE3FF8FF8FFE3FF8FF81FC07C03C00FC0FE03800FC0FE03
236800FE0FF078007E1FF070007E1DF070003F1DF8E0003F38F8E0003F38F8E0001FB8FDC00
23701FF07DC0001FF07FC0000FF07F80000FE03F80000FE03F800007E03F000007C01F00000
2383C01E000003800E00025167F9528>I<FFF0FFE0FFF0FFE0FFF0FFE007E0780007F0F000
23903F8F00001F9E00000FFC00000FF8000007F0000003F0000001F8000003FC000007FE000
24000F7F00001E3F00001C1F80003C0FC000780FE00FFC1FFE0FFC1FFE0FFC1FFE01B167F95
2411E>I E /Fe 4 112 df<03CC0E2E183C381C301C701CE038E038E038E038C073C073C0F3
24260F263361E1C10107C8F14>97 D<383E1F006CC331804F83C1C0CF03C1C0CE0381C0CE03
24381C01C0703801C0703801C0703801C070700380E0730380E0730380E0E30380E0E60701C
2440640300C03801C107D8F1F>109 D<383E006CC3004F8380CF0380CE0380CE03801C0700
2451C07001C07001C0E00380E60380E60381C60381CC0700C8030070013107D8F16>I<01F0
24606180C0C180E300E700E600EE00EE00EE00CE01CE018E030606030C01F000F107C8F14>
247I E /Ff 2 104 df<003C00E001C0038003800380038003800380038003800380038003
248800380038007001E00F8001E000700038003800380038003800380038003800380038003
249800380038001C000E0003C0E257E9B13>102 D<F8001E00070003800380038003800380
2500380038003800380038003800380038001C000E0003C00E001C003800380038003800380
2510380038003800380038003800380038007001E00F8000E257E9B13>I
252E /Fg 35 122 df<00FC000383000603800E07801C07801C03001C00001C00001C00001C
2530000FFFF80FFFF801C03801C03801C03801C03801C03801C03801C03801C03801C03801C
25403801C03801C0380FF8FF0FF8FF0141A809915>12 D<70F8FCFC7404040808102040060C
2557D990B>39 D<70F0F8F87808081010102040050C7D840B>44 D<70F8F8F87005057D840B
256>46 D<07E01C38381C381C700E700E700EF00FF00FF00FF00FF00FF00FF00FF00FF00FF0
2570F700E700E700E381C381C1C3807E010187F9713>48 D<07E01FF8383C781C781E781E30
2581E001E001C0038007007E00038001C000E000F000F700FF80FF80EF01E703C3FF80FE010
259187F9713>51 D<70F8F8F87000000000000070F0F8F8780808101010204005177D8F0B>
26059 D<000C0000001E0000001E0000001E0000003F0000003F0000003F00000067800000
2616780000067800000C3C00000C3C00000C3C0000181E0000181E0000181E0000300F00003
262FFF00007FFF80006007800060078000E007C000C003C001E003C00FF81FFC0FF81FFC01A
2631A7F991D>65 D<FFFF80FFFFE00F00F00F00780F003C0F003C0F003C0F003C0F003C0F00
264780F00700F01E00FFFC00F00F00F00380F003C0F001E0F001E0F001E0F001E0F001E0F00
2653C0F003C0F00F8FFFFF0FFFFC0171A7F991B>I<FFF000FFF0000F00000F00000F00000F
26600000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00180F
26700180F00180F00380F00380F00300F00700F01F0FFFFF0FFFFF0151A7F9918>76
268D<FFFF80FFFFE00F00F00F00780F00380F003C0F003C0F003C0F003C0F003C0F00380F00
269700F01E00FFFC00F00000F00000F00000F00000F00000F00000F00000F00000F00000F00
27000FFF000FFF000161A7F991A>80 D<07C21FF6383E701E600EE006E006E006F000F8007F
271803FF01FF80FFC01FE001E000F0007C007C007C007E006F00EFC1CDFF887E0101A7E9915
272>83 D<7FFFFF007FFFFF00781E0F00601E0300601E0300E01E0380C01E0180C01E0180C0
2731E0180001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E000000
2741E0000001E0000001E0000001E0000001E0000001E0000001E000003FFF00003FFF00019
2751A7F991C>I<FFC3FF0FF0FFC3FF0FF01E007803C01E007801801E007801800F00FC0300
2760F00FC03000F00FC030007819E060007819E060007819E060003C39F0C0003C30F0C0003
277C30F0C0003E30F1C0001E607980001E607980001E607980000FC03F00000FC03F00000FC
27803F000007801E000007801E000007801E000003801C000003000C000241A7F9927>87
279D<FEFEC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0
280FEFE07257D9B0B>91 D<FEFE060606060606060606060606060606060606060606060606
281060606060606060606FEFE0725809B0B>93 D<1FC000707000783800781C00301C00001C
2820003FC001F1C003C1C00781C00F01C00F01D80F01D80F03D80785D801F8F0011107F8F13
283>97 D<FC0000FC00001C00001C00001C00001C00001C00001C00001C00001C00001CFC00
2841F07001E03801C03C01C01C01C01E01C01E01C01E01C01E01C01E01C01E01C01C01C0380
2851E03001F060018F800131A809915>I<07F01C1C383C783C7018F000F000F000F000F000
286F0007000780C380C1C3807E00E107F8F11>I<003F00003F000007000007000007000007
2870000070000070000070000070003E7000C1F00180F00380700700700F00700F00700F007
28800F00700F00700F00700700700780700380F001C3FE007E7E0131A7F9915>I<07C01C70
28938387038701CF01CFFFCF000F000F000F0007000780C38081C3807E00E107F8F11>I<01
290F007180E3C0C3C1C181C001C001C001C001C00FFC0FFC01C001C001C001C001C001C001C
291001C001C001C001C001C00FF80FF800E1A80990C>I<0FC700387B80703B80F03C00F03C
29200F03C00F03C007038003870006FC0004000004000006000007FF0003FFC003FFE00600F
29300C00300C00300C00300C00300600600381C0007E00011187F8F13>I<387C7C7C380000
294000000FCFC1C1C1C1C1C1C1C1C1C1C1C1CFFFF081A80990A>105
295D<FC00FC001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C
296001C001C001C001C001C001C00FF80FF80091A80990A>108 D<FC7C1F00FD8E63801E07
29781C01E0781C01C0701C01C0701C01C0701C01C0701C01C0701C01C0701C01C0701C01C07
29801C01C0701C01C0701C0FF9FE7F8FF9FE7F81D107F8F20>I<FC7C00FD87001E03801E03
299801C03801C03801C03801C03801C03801C03801C03801C03801C03801C0380FF9FF0FF9F
300F01410808F15>I<07E01C38381C700E700EF00FF00FF00FF00FF00FF00F700E700E381C
3011C3807E010107F8F13>I<FCFC00FF07001E03801C03C01C03C01C01E01C01E01C01E01C
30201E01C01E01C01E01C03C01C03801E07001F0E001CF8001C00001C00001C00001C00001C
3030000FF8000FF80001317808F15>I<FCF0FD1C1E3C1E3C1C181C001C001C001C001C001C
304001C001C001C00FF80FF800E10808F0F>114 D<1F2060E04060C060C060F0007F003FC0
3051FE000F0C070C030E030E020F0408F800C107F8F0F>I<18001800180018001800180038
306007FC0FFC03800380038003800380038003800386038603860386038601CC007800B177F
307960F>I<FC1F80FC1F801C03801C03801C03801C03801C03801C03801C03801C03801C03
308801C03801C07800C07800E0BF003F3F01410808F15>I<FE3F80FE3F803C0E001C0C001C
3090C000E18000E18000E180007300007300007700003E00003E00001C00001C00001C00011
310107F8F14>I<FE3F80FE3F803C0E001C0C001C0C000E18000E18000E1800073000073000
31107700003E00003E00001C00001C00001C000018000018000618000F30000F30000E60000
31278000011177F8F14>121 D E /Fh 4 52 df<00C00000C00000C00000C00000C00000C0
3130000C00000C00000C000FFFF80FFFF8000C00000C00000C00000C00000C00000C00000C0
3140000C00000C00011147E8F17>43 D<0C007C009C001C001C001C001C001C001C001C001C
315001C001C001C001C00FF8009107E8F0F>49 D<1F006180C0C0E0E0E0E000E000C001C001
3168003000400082010203FC07FC0FFC00B107F8F0F>I<1F00218071C071C021C001800300
3171F00018000C000E040E0E0E0E0C041803F000B107F8F0F>I E /Fi
3185 107 df<03F0000FFC001FFE003FFF007FFF807FFF80FFFFC0FFFFC0FFFFC0FFFFC0FF
319FFC0FFFFC07FFF807FFF803FFF001FFE000FFC0003F00012127E9317>15
320D<0000000600000000060000000006000000000300000000030000000003800000000180
32100000000C0000000006000000000700000000018FFFFFFFFFFFFFFFFFFFF000000001800
32200000070000000006000000000C000000001800000000380000000030000000003000000
3230006000000000600000000060028187E962D>33 D<001F007F00F801E003C003C003C003
324C003C003C003C003C003C003C003C003C003C003C003C007800F00FE00F800FE000F0007
3258003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C001E000F800
3267F001F102D7DA117>102 D<F800FE001F00078003C003C003C003C003C003C003C003C0
32703C003C003C003C003C003C003C001E000F0007F001F007F00F001E003C003C003C003C0
32803C003C003C003C003C003C003C003C003C003C003C007801F00FE00F800102D7DA117>
329I<C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0
330C0C0C0C0C0C0C0C0C0C0022D7BA10D>106 D E /Fj 3 52 df<06001E00FE00EE000E00
3310E000E000E000E000E000E000E000E000E000E000E000E00FFE0FFE00B137D9211>49
332D<1F003FC041E0C0F0E070E07000F000E000E001C00380030004000810101020307FE0FF
333E0FFE00C137E9211>I<1FC03FE07070707820380078007000E00FC000700038003C003C
334403CE03CE03840707FE01FC00E137F9211>I E /Fk 46 121 df<3C03C07E07E0FF0FF0
335FF8FF8FF8FF8FF8FF87F87F83D83D80180180380380300300300300600600E00E01C01C0
33638038030030015117E9F1B>34 D<3C007E00FF00FF80FF80FF807F803D80018003800300
337030006000E001C003800300009117D9F0F>39 D<3C7EFFFFFFFF7E3C08087D870F>46
338D<00380000F80007F800FFF800FFF800F9F80001F80001F80001F80001F80001F80001F8
3390001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8
3400001F80001F8007FFFE07FFFE07FFFE0131D7D9C1A>49 D<03FC001FFF803FFFC07C1FE0
341FE07F0FE03F0FE03F8FE01F87C01F83801F80003F80003F00007E00007E0000FC0001F00
342003E00007C0000F00001E0380380380700380E00781FFFF83FFFF07FFFF0FFFFF0FFFFF0
343FFFFF0151D7E9C1A>I<03FC000FFF801FFFC03C0FE07E07F07E03F07E03F07E03F03C07
344F00007E0000FC0001F8003FE0003FC00000F800007E00003F00003F00003F83803F87C03
345F8FE03F8FE03F8FE03F0FC07F07C0FE03FFFC01FFF0003FC00151D7E9C1A>I<0001E000
34603E00003E00007E0000FE0001FE0003BE00073E000F3E001E3E001C3E00383E00703E00E
34703E01C03E03803E07803E0F003E0FFFFFEFFFFFEFFFFFE0007E00007E00007E00007E000
34807E000FFFE00FFFE00FFFE171D7F9C1A>I<3800E03FFFE03FFFC03FFF803FFF003FFC00
3493FC00038000038000038000038000039FC003FFF803E07C03803E01003F00003F00003F8
3500003F87803F8FC03F8FC03F8FC03F8FC03F07807E07C0FE03FFFC00FFF0003F800151D7E
3519C1A>I<003F0001FFC007FFE00FC1E01F03F01E03F03E03F07E03F07C01E07C0000FC10
35200FCFF00FDFFC0FF03E0FE01F0FE01F0FC01F8FC01F8FC01F8FC01F87C01F87C01F87C01
353F83C01F03E01F01F03E00FFFC007FF8001FC00151D7E9C1A>I<7000007FFFF87FFFF87F
354FFF87FFFF07FFFE0FFFFC0F00380E00700E00E00E00E00001C0000380000780000700000
355F00000F00001F00001E00003E00003E00003E00007E00007E00007E00007E00007E00007
356E00003C000018000151E7D9D1A>I<01FE0007FF801FFFC03E07E03C03F07C01F07C01F0
3577E01F07F81F07FE3E03FF3C03FFF801FFF000FFF8007FFC01FFFE03E7FF07C1FF87807F8
358F803F8F801F8F800F8F800F8F800F07C01F07F03E03FFFC00FFF8003FC00151D7E9C1A>
359I<0000E000000001F000000001F000000003F800000003F800000003F800000007FC0000
3600007FC0000000FFE0000000EFE0000000EFE0000001C7F0000001C7F0000003C7F800000
361383F800000383F800000701FC00000701FC00000F01FE00000E00FE00000FFFFE00001FF
362FFF00001FFFFF00003C007F800038003F800038003F800070001FC00070001FC00FFF01F
363FFE0FFF01FFFE0FFF01FFFE0231F7E9E28>65 D<FFFFFE00FFFFFFC0FFFFFFE007E007F0
36407E003F807E001FC07E001FC07E001FC07E001FC07E001FC07E001FC07E001F807E003F0
36507E00FE007FFFF8007FFFFE007E003F007E001F807E000FC07E000FC07E000FE07E000FE
36607E000FE07E000FE07E000FE07E001FC07E001FC07E007F8FFFFFFF0FFFFFFE0FFFFFF00
3671F1F7E9E25>I<0007F806007FFF0E01FFFFDE03FE03FE07F000FE0FC0007E1F80003E3F
36880001E3F00001E7F00000E7E00000E7E00000EFE000000FE000000FE000000FE000000FE
369000000FE000000FE0000007E0000007E00000E7F00000E3F00000E3F80001C1F80001C0F
370C0003807F0007803FE03F001FFFFC0007FFF800007FC001F1F7D9E26>I<FFFFFE0000FF
371FFFFC000FFFFFFF00007F007F80007F001FC0007F000FE0007F0007F0007F0003F0007F0
372003F8007F0001F8007F0001F8007F0001FC007F0001FC007F0001FC007F0001FC007F000
3731FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001F8007F0001F8007F0003F
3748007F0003F0007F0007F0007F0007E0007F001FC0007F007F800FFFFFFF000FFFFFFC000
375FFFFFE0000221F7E9E28>I<FFFFFFE0FFFFFFE0FFFFFFE007F007E007F003E007F001E0
37607F000F007F000F007F0707007F0707007F0707007F0707007F1F00007FFF00007FFF000
37707FFF00007F1F00007F0700007F0701C07F0701C07F0701C07F0003807F0003807F00038
37807F0007807F0007807F001F807F007F8FFFFFFF0FFFFFFF0FFFFFFF01E1F7E9E22>I<FF
379FFFFE0FFFFFFE0FFFFFFE007F007E007F003E007F001E007F000F007F000F007F0007007
380F0707007F0707007F0707007F0700007F1F00007FFF00007FFF00007FFF00007F1F00007
381F0700007F0700007F0700007F0700007F0000007F0000007F0000007F0000007F0000007
382F00000FFFFC000FFFFC000FFFFC0001C1F7E9E21>I<FFFF80FFFF80FFFF8007F00007F0
3830007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0
3840007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F000FFFF
38580FFFF80FFFF80111F7F9E14>73 D<FFFFC000FFFFC000FFFFC00007F0000007F0000007
386F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007
387F0000007F0000007F0000007F0000007F001C007F001C007F001C007F001C007F003C007
388F003C007F0078007F0078007F00F8007F03F80FFFFFF80FFFFFF80FFFFFF801A1F7E9E1F
389>76 D<001FF80000FFFF0001F81F8007E007E00FC003F01F8001F81F0000F83F0000FC7F
3900000FE7E00007E7E00007EFE00007FFE00007FFE00007FFE00007FFE00007FFE00007FFE
39100007FFE00007FFE00007F7E00007E7F0000FE7F0000FE3F0000FC3F8001FC1F8001F80F
392C003F007E007E001F81F8000FFFF00001FF800201F7D9E27>79 D<FFFFFE00FFFFFF80FF
393FFFFE007F00FF007F003F807F001F807F001FC07F001FC07F001FC07F001FC07F001FC07
394F001FC07F001F807F003F007F00FF007FFFFC007FFFF0007F0000007F0000007F0000007
395F0000007F0000007F0000007F0000007F0000007F0000007F0000007F00000FFFF8000FF
396FF8000FFFF80001E1F7E9E24>I<FFFFF80000FFFFFF8000FFFFFFC00007F00FF00007F0
39703F80007F001F80007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001
398F80007F003F00007F00FE00007FFFF800007FFFF000007F03F800007F00FC00007F00FE0
3990007F007F00007F007F00007F007F00007F007F00007F007F00007F007F00007F007F020
40007F007F07007F003F070FFFF81F8E0FFFF80FFC0FFFF803F80241F7E9E27>82
401D<03FC180FFF381FFFF83E03F87C00F8780078F80078F80038F80038FC0000FF0000FFF8
402007FFF007FFFC03FFFE01FFFF00FFFF803FFF8001FFC0001FC0000FC00007CE0007CE000
4037CE0007CF00078F800F8FE01F0FFFFE0EFFFC0C1FF00161F7D9E1D>I<7FFFFFFC7FFFFF
404FC7FFFFFFC7E0FE0FC780FE03C700FE01CF00FE01EF00FE01EE00FE00EE00FE00EE00FE0
4050EE00FE00E000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE0
40600000FE000000FE000000FE000000FE000000FE000000FE000000FE00007FFFFC007FFFF
407C007FFFFC01F1E7E9D24>I<0600600E00E01C01C0380380300300600600600600E00E00
408C00C00DE0DE0FF0FF0FF8FF8FF8FF8FF8FF87F87F83F03F01E01E015117D9F1B>92
409D<07FC001FFF803F0FC03F07E03F03F03F03F00C03F00003F001FFF00FFFF01F83F07E03
410F07C03F0F803F0F803F0F803F0FC07F07E0DFE3FF8FE07E07E17147F9319>97
411D<FF800000FF800000FF8000001F8000001F8000001F8000001F8000001F8000001F8000
412001F8000001F8000001F8000001F8FE0001FFFF8001FF07C001FC03E001F803F001F801F
413001F801F001F801F801F801F801F801F801F801F801F801F801F801F801F801F001F801F
414001F803E001FC03E001FE0FC001E7FF0001C1FC00019207F9F1D>I<01FE0007FF801F0F
415C03E0FC03E0FC07C0FC07C0300FC0000FC0000FC0000FC0000FC0000FC00007C00007E00
416003E00E03F01C01F83C007FF8001FC0013147E9317>I<0007FC000007FC000007FC0000
41700FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC0001
418FCFC000FFFFC001F83FC003E00FC007E00FC007C00FC007C00FC00FC00FC00FC00FC00FC
41900FC00FC00FC00FC00FC00FC00FC007C00FC007C00FC007E00FC003E01FC001F07FF800F
420FFFF8003F8FF8019207E9F1D>I<01FE0007FF800F83C01E01E03E00F07C00F07C00F8FC
42100F8FFFFF8FFFFF8FC0000FC0000FC00007C00007C00003E00381E00380F80F007FFE000
422FF8015147F9318>I<003F8000FFC003F3E007E7E007C7E00FC7E00FC3C00FC0000FC000
4230FC0000FC0000FC000FFFC00FFFC00FFFC000FC0000FC0000FC0000FC0000FC0000FC000
4240FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0007FFC007FFC007FFC0013207F
4259F10>I<03FC7C0FFFFE1E07DE3C03DE7C03EC7C03E07C03E07C03E07C03E03C03C01E07
426801FFF0033FC003000007000007800007FFF803FFFF03FFFF81FFFFC3FFFFC7C00FEF800
4273EF8003EF8003EF8003E7C007C3F01F80FFFE003FF80171E7F931A>I<FF800000FF8000
42800FF8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000
429001F8000001F87F0001F9FF8001FB8FC001FE07E001FC07E001FC07E001F807E001F807E
430001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F807E
43100FFF3FFC0FFF3FFC0FFF3FFC01A207E9F1D>I<1E003F007F807F807F807F803F001E00
43200000000000000000000FF80FF80FF801F801F801F801F801F801F801F801F801F801F80
4331F801F801F801F80FFF0FFF0FFF00C217EA00F>I<FF800000FF800000FF8000001F8000
434001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F83FF
435001F83FF001F83FF001F81E0001F83C0001F8780001F9E00001FBC00001FFE00001FFF00
436001FDF00001F9F80001F0FC0001F07E0001F03E0001F03F0001F01F800FFE3FF80FFE3FF
43780FFE3FF8019207F9F1C>107 D<FF80FF80FF801F801F801F801F801F801F801F801F80
4381F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F80
439FFF0FFF0FFF00C207E9F0F>I<FF07F00FE000FF1FFC3FF800FF387E70FC001F603FC07E
440001FC03F807E001FC03F807E001F803F007E001F803F007E001F803F007E001F803F007E
441001F803F007E001F803F007E001F803F007E001F803F007E001F803F007E001F803F007E
442001F803F007E00FFF1FFE3FFC0FFF1FFE3FFC0FFF1FFE3FFC02A147E932D>I<FF07F000
443FF1FF800FF38FC001F607E001FC07E001FC07E001F807E001F807E001F807E001F807E00
4441F807E001F807E001F807E001F807E001F807E001F807E001F807E00FFF3FFC0FFF3FFC0
445FFF3FFC01A147E931D>I<01FF0007FFC01F83F03E00F83E00F87C007C7C007CFC007EFC
446007EFC007EFC007EFC007EFC007E7C007C7C007C3E00F83E00F81F83F007FFC001FF0017
447147F931A>I<FF8FE000FFFFF800FFF0FC001FC07E001F803F001F803F001F801F001F80
4481F801F801F801F801F801F801F801F801F801F801F801F801F001F803F001F803E001FC0
4497E001FE0FC001FFFF0001F9FC0001F8000001F8000001F8000001F8000001F8000001F80
4500000FFF00000FFF00000FFF00000191D7F931D>I<FF1F00FF3FC0FF67E01FC7E01FC7E0
4511FC7E01F81801F80001F80001F80001F80001F80001F80001F80001F80001F80001F8000
452FFF800FFF800FFF80013147F9316>114 D<0FE63FFE783E700EF00EF00EFE00FFE07FF8
4533FFC1FFE0FFF007FE01FE00FF00FF00EFC1EFFFCC7F010147E9315>I<03800380038003
454800780078007800F801F803FFCFFFCFFFC1F801F801F801F801F801F801F801F801F801F
4558E1F8E1F8E1F8E1F8E0F9C07F803F00F1D7F9C14>I<FF83FE00FF83FE00FF83FE001F80
4567E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F80
4577E001F807E001F807E001F80FE001F80FE000F83FFC007FF7FC001FC7FC01A147E931D>
458I<FFE7FF3FE0FFE7FF3FE0FFE7FF3FE01F80FC07000FC1FC0E000FC1FC0E000FC3FE1E00
45907E3BE1C0007E3BE1C0007F7BF3C0003F71F380003F71FB80001FE0FF00001FE0FF00001
460FE0FF00000FC07E00000FC07E00000FC07E000007803C000007803C00023147F9326>
461119 D<FFF3FF00FFF3FF00FFF3FF000FE0E00007E1E00003F3C00001FF800000FF000000
462FE0000007E0000003F0000007F800000FFC00001EFE00003C7E0000383F0000781F800FF
463C3FF80FFC3FF80FFC3FF8019147F931C>I E /Fl 84 127 df<70F8F8F8F8F8F8F8F8F8
464F8F8F8F8F8F8F870000000000070F8F8F870051C779B18>33 D<2008701CF83EF83EF83E
465F83EF83EF83E701C701C701C701C701C30180F0E7C9C18>I<030600078F00078F00078F
46600078F00078F00078F007FFFC0FFFFE0FFFFE07FFFC00F1E000F1E000F1E000F1E000F1E
467000F1E007FFFC0FFFFE0FFFFE07FFFC01E3C001E3C001E3C001E3C001E3C001E3C000C18
46800131C7E9B18>I<00C00001C00001C00001C00003F0000FFC003FFE007DDF0071CF00E1
469C780E1CF80E1CF80E1CF80F1C70079C0007FC0003FF0001FFC0007FE0001FF0001CF0021
470C78071C380F9C380F9C380F1C380F1C70079C7007DDE003FFC001FF80007E00001C00001
471C00001C00000C00011247D9F18>I<3803007C07807C0780EE0F80EE0F00EE0F00EE1F00
472EE1E00EE1E00EE3E007C3C007C3C00387C0000780000780000F80000F00001F00001E000
47301E00003E00003C00003C00007C0000783800787C00F87C00F0EE00F0EE01F0EE01E0EE0
4741E0EE03E0EE03C07C03C07C018038013247E9F18>I<01C00007E0000FF0000E70001C38
475001C38001C38001C38001C73F81CF3F81CE3F80FC1C00FC3800F83800F03801F07003F87
476007B8E0071CE00F1FC00F0FC00F07C00F07870F0787078FE707FFFE03FC7E00F03C0151C
4777F9B18>I<387C7C7E3E0E0E0E1C1C38F8F0C0070E789B18>I<007000F001E003C007800F
478001E001E003C003C007800780078007000F000F000F000F000F000F000F000F000700078
47900780078003C003C001E001E000F00078003C001F000F000700C24799F18>I<6000F000
48078003C001E000F000780078003C003C001E001E001E000E000F000F000F000F000F000F0
48100F000F000E001E001E001E003C003C0078007800F001E003C007800F00060000C247C9F
48218>I<01C00001C00001C00001C00061C300F9CF80FDDF807FFF003FFE000FF8000FF800
4833FFE007FFF00FDDF80F9CF8061C30001C00001C00001C00001C00011147D9718>I<0060
4840000F00000F00000F00000F00000F00000F00000F0007FFFC0FFFFE0FFFFE07FFFC000F0
4850000F00000F00000F00000F00000F00000F00000600013147E9718>I<1C3E7E7F3F1F07
4860E1E7CF860080C788518>I<7FFFC0FFFFE0FFFFE07FFFC013047E8F18>I<3078FCFC7830
4870606778518>I<000300000780000780000F80000F00001F00001E00001E00003E00003C
48800007C0000780000780000F80000F00001F00001E00003E00003C00003C00007C0000780
489000F80000F00000F00001F00001E00003E00003C00003C00007C0000780000F80000F000
49000F0000060000011247D9F18>I<01F00007FC000FFE001F1F001E0F003C07807803C078
49103C07803C0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F803E078
49203C07803C07C07C03C07801E0F001F1F000FFE0007FC0001F000131C7E9B18>I<01C001
493C003C007C007C01FC0FFC0FBC063C003C003C003C003C003C003C003C003C003C003C003
494C003C003C003C003C003C07FFEFFFF7FFE101C7C9B18>I<03F0001FFE003FFF007C0F80
4957807C0F003C0F801E0F801E07001E00001E00001E00003C00003C0000780000780000F00
496001E00003C0000F80001F00003E00007C0000F80001E01E03C01E07FFFE0FFFFE07FFFE0
497131C7E9B18>I<03F8001FFE003FFF003C0F807C07C07C03C07C03C01003C00003800007
49880000F0003FE0003FE0003FF00000F800007C00003C00001E00001E00001E07001E0F801
499E0F803C0F007C07C0F807FFF001FFE0007F000131C7E9B18>I<001F00003F00007F0000
500770000F70001E70001C70003C7000787000707000E07001E07003C0700380700780700F0
5010700FFFFF8FFFFF8FFFFF8000700000700000700000700000700000700007FF0007FF000
5027FF0151C7F9B18>I<3FFF807FFF807FFF80780000780000780000780000780000780000
5037800007800007BF8007FFE007FFF007C0F803003C00003C00001E00001E07001E0F801E0
504F801E0F803C07807C07C0F803FFF001FFC0003F000131C7E9B18>I<F00000FFFFE0FFFF
505E0FFFFE0F007C0F00F80000F00001E00003C00003C0000780000780000F00000F00001E0
5060001E00001E00003C00003C00003C00003C0000780000780000780000780000780000780
50700078000030000131D7E9C18>55 D<3078FCFC783000000000000000003078FCFC783006
50814779318>58 D<183C7E7E3C180000000000000000183C7E7E3E1E0E1C3C78F060071A78
5099318>I<0000C00003E00007E0001FC0003F8000FE0001FC0007F0000FE0003F80007F00
51000FC0000FC00007F00003F80000FE00007F00001FC0000FE00003F80001FC00007E00003
511E00000C013187E9918>I<7FFFC0FFFFE0FFFFE07FFFC00000000000000000000000007F
512FFC0FFFFE0FFFFE07FFFC0130C7E9318>I<600000F80000FC00007F00003F80000FE000
51307F00001FC0000FE00003F80001FC00007E00007E0001FC0003F8000FE0001FC0007F000
5140FE0003F80007F0000FC0000F8000060000013187E9918>I<0FF0003FFC007FFF00781F
51500F80780F80780F80780201F00007E0000FC0001F00001E00003C00003C00003C00003C0
5160003C00003800000000000000000000000000000000003800007C00007C00007C0000380
51700111C7D9B18>I<007C0001FE0007FF000F87801E03C03C1DC0387FC070FFE071E3E071
518C1E0E1C1E0E380E0E380E0E380E0E380E0E380E0E380E0E1C1C071C1C071E3C070FF8038
5197F003C1C001E01E00F83E007FFC001FF80007E00131C7E9B18>I<00F80000F80000F800
52001FC0001DC0001DC0001DC0003DE0003DE0003DE0003DE00038E00078F00078F00078F00
521078F00078F000F07800FFF800FFF800FFF800F07801E03C01E03C01E03C07F8FF0FF8FF8
5227F8FF0151C7F9B18>I<7FFE00FFFF007FFF801E07C01E03C01E01E01E01E01E01E01E01
523E01E01E01E03C01E07C01FFF801FFF001FFFC01E03E01E01E01E00F01E00F01E00F01E00
524F01E00F01E00F01E01E01E03E07FFFC0FFFF807FFE00141C7F9B18>I<00F8E003FFE007
525FFE00F07E01E03E03C03E03C01E07801E07801E0700000F00000F00000F00000F00000F0
5260000F00000F00000F000007000007801E07801E03C01E03C01E01E03C00F07C007FF8003
527FE0000F800131C7E9B18>I<7FFC00FFFF007FFF801E07C01E03E01E01E01E01F01E00F0
5281E00F01E00F81E00781E00781E00781E00781E00781E00781E00781E00781E00781E00F0
5291E00F01E01F01E01E01E03E01E07C07FFF80FFFF007FFC00151C809B18>I<FFFFF0FFFF
530F0FFFFF01E00F01E00F01E00F01E00F01E00001E00001E0F001E0F001E0F001FFF001FFF
531001FFF001E0F001E0F001E0F001E00001E00001E00781E00781E00781E00781E0078FFFF
532F8FFFFF8FFFFF8151C7F9B18>I<FFFFF8FFFFF8FFFFF81E00781E00781E00781E00781E
53300001E00001E0F001E0F001E0F001FFF001FFF001FFF001E0F001E0F001E0F001E00001E
53400001E00001E00001E00001E00001E0000FFE000FFE000FFE000151C7F9B18>I<01F1C0
53507FFC00FFFC01F0FC01E07C03C03C03803C07803C07803C0700000F00000F00000F00000
536F00000F00000F01FF0F03FF0F01FF07003C07803C07803C03807C03C07C01E0FC01F0FC0
5370FFFC007FFC001F3C0141C7E9B18>I<7FFF80FFFFC07FFF8001E00001E00001E00001E0
5380001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E0
5390001E00001E00001E00001E00001E00001E0007FFF80FFFFC07FFF80121C7D9B18>73
540D<01FFE001FFE001FFE0000F00000F00000F00000F00000F00000F00000F00000F00000F
54100000F00000F00000F00000F00000F00000F00000F00000F00000F00700F00F80F00F80F
54200F83E007FFC003FF8000FE000131C7E9B18>I<FFE000FFE000FFE0001E00001E00001E
54300001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E
54400001E00001E00001E00F01E00F01E00F01E00F01E00F0FFFFF0FFFFF0FFFFF0141C7F9B
54518>76 D<FC01F8FE03F8FE03F83F07E03B06E03B06E03B06E03B8EE03B8EE0398CE0398C
546E039DCE039DCE039DCE038D8E038F8E038F8E03870E03870E03800E03800E03800E03800
547E03800E03800E0FE03F8FE03F8FE03F8151C7F9B18>I<7E07F0FF0FF87F07F01F81C01D
54881C01D81C01DC1C01CC1C01CC1C01CE1C01CE1C01CE1C01C61C01C71C01C71C01C31C01C
54939C01C39C01C39C01C19C01C19C01C1DC01C0DC01C0DC01C0FC07F07C0FF87C07F03C015
5501C7F9B18>I<0FFE003FFF807FFFC07C07C07803C0F803E0F001E0F001E0F001E0F001E0
551F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0
552F803E07803C07C07C07FFFC03FFF800FFE00131C7E9B18>I<FFFE00FFFF80FFFFC01E07
553C01E03E01E01E01E00F01E00F01E00F01E00F01E00F01E01E01E03E01E07C01FFFC01FFF
554801FFE001E00001E00001E00001E00001E00001E00001E00001E0000FFC000FFC000FFC0
55500141C7F9B18>I<7FF800FFFE007FFF001E1F801E07801E07C01E03C01E03C01E03C01E
55607C01E07801E1F801FFF001FFE001FFE001E0F001E0F001E07801E07801E07801E07801E
55707801E07BC1E07BC1E07BC7F83F8FFC1F87F80F0161C7F9B18>82
558D<7FFFF8FFFFF8FFFFF8F07878F07878F07878F078780078000078000078000078000078
559000078000078000078000078000078000078000078000078000078000078000078000078
5600000780007FF8007FF8007FF80151C7F9B18>84 D<FFC7FEFFC7FEFFC7FE1E00F01E00F0
5611E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F0
5621E00F01E00F01E00F01E00F01E00F00F01E00F01E007C7C003FF8001FF00007C00171C80
5639B18>I<FF07F8FF8FF8FF07F83C01E01E03C01E03C01E03C01E03C00F07800F07800F07
564800F07800F0780078F00078F00078F00078F00038E00038E0003DE0003DE0001DC0001DC
5650001DC0001FC0001FC0000F80000F800151C7F9B18>I<FE03F8FE03F8FE03F870007070
56600707000703800E03800E03800E03800E03800E038F8E039FCE039DCE039DCE019DCC019
567DCC019DCC0198CC0198CC01D8DC01D8DC01D8DC01D05C00F07800F07800F07800E038015
5681C7F9B18>I<FFFCFFFCFFFCF000F000F000F000F000F000F000F000F000F000F000F000
569F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000
570FFFCFFFCFFFC0E24789F18>91 D<600000F00000F00000F800007800007C00003C00003C
57100003E00001E00001F00000F00000F00000F800007800007C00003C00003C00003E00001
572E00001F00000F00000F800007800007800007C00003C00003E00001E00001E00001F0000
5730F00000F8000078000078000030011247D9F18>I<FFFCFFFCFFFC003C003C003C003C00
5743C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C00
5753C003C003C003C003C003C003C003CFFFCFFFCFFFC0E247F9F18>I<03800FE03FF8FFFE
576FC7EF01E40040F077C9B18>I<7FFFC0FFFFE0FFFFE07FFFC013047E7F18>I<061E3E3870
57770E0E0E0F8FC7C7C38070E789E18>I<0FF0003FFC007FFE007C1F007C0F003807800007
5788000FF8007FF801FFF807F87807C0780F00780F00780F00780F807807C1F803FFFF81FFB
579F807E1F815147E9318>I<7F0000FF00007F00000F00000F00000F00000F00000F00000F
5803E000FFF800FFFE00FC1F00F80F00F00780F00780F003C0F003C0F003C0F003C0F003C0F
581003C0F00780F80780F80F00FC1F00FFFE00FFF80073E00161C809B18>I<01FC0007FF00
5821FFF803E0F803C0F80780700780000F00000F00000F00000F00000F00000F00000780000
5837803C03C03C03E07C01FFF8007FF0001FC0012147D9318>I<001FC0003FC0001FC00003
584C00003C00003C00003C00003C001F3C007FFC01FFFC03E0FC03C07C07803C07803C0F003
585C0F003C0F003C0F003C0F003C0F003C07803C07807C03C07C03E1FC01FFFF807FBFC01F3
586F8161C7F9B18>I<01F80007FE000FFF001F0F803C03C07803C07801C0F001E0F001E0FF
587FFE0FFFFE0FFFFE0F000007800007801E03C01E01F03E00FFFC007FF8000FE0013147E93
58818>I<001F80007FC000FFE000F3E001E3E001E08001E00001E0007FFFC0FFFFC0FFFFC0
58901E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E000
59001E00001E0007FFF807FFF807FFF80131C7F9B18>I<03F1E00FFFF01FFFF83E1F783C0F
591307807807807807807807807807807803C0F003E1F003FFE003FFC003BF0003800003800
592001FFE001FFFC03FFFE07801F0700070E00038E00038E00038E000387800F07E03F01FFF
593C00FFF8001FC00151F7F9318>I<7F0000FF00007F00000F00000F00000F00000F00000F
59400000F1F000F7F800FFFC00FE1C00FC1E00F81E00F01E00F01E00F01E00F01E00F01E00F
59501E00F01E00F01E00F01E00F01E00F01E07FE3FCFFF3FE7FE3FC171C809B18>I<01C000
59603E00003E00003E00001C0000000000000000000000000007FE000FFE0007FE00001E000
59701E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E000
59801E000FFFF80FFFF80FFFF80111D7D9C18>I<001C003E003E003E001C00000000000000
599000FFE0FFE0FFE001E001E001E001E001E001E001E001E001E001E001E001E001E001E00
6001E001E001E001E001E001E001E701CF83CF878FFF87FF01FC00F277E9C18>I<7E0000FE
60100007E00000E00000E00000E00000E00000E00000E3FF00E3FF00E3FF00E07800E0F000E
6021E000E3C000E78000EF0000FF8000FFC000F9C000F0E000E0F000E07000E03800E03C07F
603C7F8FFC7F87FC7F8151C7F9B18>I<FFE000FFE000FFE00001E00001E00001E00001E000
60401E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E000
60501E00001E00001E00001E00001E00001E000FFFFC0FFFFC0FFFFC0121C7D9B18>I<F9C1
606C0FFF7F0FFFFF03E3E383C3C383C3C383838383838383838383838383838383838383838
60738383838383838383838383838FE3E3EFE7E7EFE3E3E1714809318>I<7F1F00FF7F807F
608FFC00FE1C00FC1E00F81E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F
60901E00F01E00F01E07FE3FCFFF3FE7FE3FC1714809318>I<01F0000FFE001FFF003E0F80
6103C07807803C07803C0F001E0F001E0F001E0F001E0F001E0F001E07803C07803C03C0780
6113F1F801FFF000FFE0001F00013147E9318>I<7F3E00FFFF807FFFE00FC1F00F80F00F00
612780F00780F003C0F003C0F003C0F003C0F003C0F003C0F00780F80780F80F00FC1F00FFF
613E00FFF800F3E000F00000F00000F00000F00000F00000F00000F00007FE000FFF0007FE0
61400161E809318>I<01F9E007FDE00FFFE01F0FE03C07E07803E07801E0F001E0F001E0F0
61501E0F001E0F001E0F001E07801E07803E03C07E03E0FE01FFFE007FDE001F1E00001E000
61601E00001E00001E00001E00001E00001E0000FFC001FFE000FFC171E7F9318>I<FF87E0
617FF9FF0FFBFF807F87807F03007E00007C00007C000078000078000078000078000078000
618078000078000078000078000FFFE00FFFF00FFFE0015147F9318>I<07FF003FFF007FFF
61900700F00E00F00E00F00F000007E00007FF0001FFC0007FF00003F00700780F00380F003
62080F80380FC0F00FFFF00FFFC00E7F00011147D9318>I<03800007800007800007800007
62180007FFFC0FFFFC0FFFFC007800007800007800007800007800007800007800007800007
62280000780C00781E00781E00781E003C3C003FFC001FF00007E0013197F9818>I<7F0FE0
623FF1FE07F0FE00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E0
6240F01E00F01E00F03E00F07E007FFFC03FFFE01F9FC1714809318>I<7F8FF0FF8FF87F8F
625F01C01C00E03800E03800E0380070700070700070700078F00038E00038E0003DE0001DC
6260001DC0001DC0000F80000F80000700015147F9318>I<FF07F8FF8FF8FF07F83800E038
62700E03800E03800E01C01C01C71C01CF9C01CF9C01CF9C01DDDC00DDD800DDD800DDD800F
6288F800F8F800F8F8007070015147F9318>I<7F8FF07F9FF07F8FF00F0700078E00039E00
62901DC0001F80000F80000700000F00000F80001DC00039E00038E000707000E07807F8FF0
630FF8FF87F8FF015147F9318>I<7F8FF0FF8FF87F8FF00E01C00E03800E03800703800707
63100070700038700038700038E0001CE0001CE0001CC0000DC0000FC000078000078000078
6320000700000700000700000F0007CE0007DE00073C0007F80003F00001E0000151E7F9318
633>I<3FFFF07FFFF07FFFF07803E07807C0780F80001F00003E00007C0000F80001F00003
634E00007C0000F80F01F00F03E00F07C00F0FFFFF0FFFFF0FFFFF014147F9318>I<0007E0
635001FE0007FE0007C0000F00000F00000F00000F00000F00000F00000F00000F00000F000
63600F00000F00001F0007FE000FFC000FFC0007FE00001F00000F00000F00000F00000F000
63700F00000F00000F00000F00000F00000F00000F000007C00007FE0001FE00007E013247E
6389F18>I<60F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0
639F0F0F0600424769F18>I<7E0000FF8000FFE00003E00000F00000F00000F00000F00000
640F00000F00000F00000F00000F00000F00000F00000F800007FC0003FE0003FE0007FC000
641F80000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00003
642E000FFE000FF80007E000013247E9F18>I<0E0C1F1E3FBEFBF8F1F060E00F067C9B18>I
643E /Fm 34 122 df<00001FE000007FF00001C03800018078000380780007003000070000
6440007000000070000000E0000000E0000000E000000FFFFE000FFFFE0001C01C0001C01C0
645001C01C0001C01C0001C0380003803800038038000380380003807000038070000780700
6460070071800700E3000700E3000700E3000600E6000E007E000E003C000E0000000E00000
64701C0000001C00000318000007B800000F30000007E0000003C0000001D29829F1A>12
648D<00003FC0FF800000FFE3FFC00001C1E700E0000381EE01E0000380DC01E00007001C00
649C0000700180000000700380000000700380000000E00380000000E00380000000E007000
6500000FFFFFFFF8000FFFFFFFF80000E00700700001C00700700001C00700700001C00E007
65100001C00E00E00001C00E00E00003800E00E00003800E00E00003801C01C00003801C01C
65200003801C01C00007001C01C60007001C038C00070038038C00070038038C00070038039
6538000E003801F8000E003000F0000E00700000000E00700000001C00700000001C00E0000
6540031860E000000798F1C000000F31E380000007E0FF00000003C07C00000002B29829F28
655>14 D<1C3E7E7E3E060C0C18183060C080070E769F0E>39 D<000200060006000E003C00
656FC03DC031C0038003800380038007000700070007000E000E000E000E001C001C001C001
657C00380038003800380FFF8FFF80F1E7B9D17>49 D<070F1F1F0E00000000000000000000
65870F8F8F0E008147B930E>58 D<0000FE020007FF06001F818C003E00DC0078007C00F000
6597C01E0003803C00038078000380F8000381F0000301F0000303E0000303E0000007C0000
660007C0000007C0000007C000000F8000000F8000000F8000000F80000C0F8000180780001
6618078000300780003003C0006003C000C001E0018000F00300007C0E00003FF800000FE00
662001F217A9F21>67 D<01FFFFFC01FFFFF8001E0078001E0038001E0038003C0018003C00
66318003C0018003C003000780C3000780C3000780C0000781C0000F0380000FFF80000FFF8
6640000F0380001E0300001E0300001E0300001E0300003C0000003C0000003C0000003C000
6650007800000078000000780000007800000FFFC0000FFF800001E1F7D9E1E>70
666D<00FF007FE001FF00FFC0001F001E00001F800C00001F800C0000378018000033C01800
6670033C018000033C018000063C030000061E030000061E030000061E0300000C0F0600000
668C0F0600000C0F0600000C0786000018078C000018078C00001803CC00001803CC0000300
6693D800003001F800003001F800003001F800006000F000006000F000006000F00000E000F
6700000FFC0060000FFC0060000231F7D9E22>78 D<01FFFF8001FFFFE0001E01F0001E0078
671001E0078003C007C003C007C003C007C003C007C007800F8007800F8007800F0007801E0
67200F003C000F00F8000FFFF0000FFF80001E0000001E0000001E0000001E0000003C00000
67303C0000003C0000003C0000007800000078000000780000007800000FFF80000FFF00000
6741E1F7D9E1F>80 D<0007E040001FF8C0003C1D8000700F8000E0078001C0078001800300
675038003000380030003800300038000000380000003C0000003F8000001FF800001FFE000
676007FF000001FF0000001F800000078000000380000003800000038003000380030003800
6773000300070007000700060007800E0007801C000EE078000C7FE000081F800001A217D9F
6781A>83 D<00F18003FDC0078F800E07801C07803C07803C0700780700780700780700F00E
67900F00E00F00E00F00E30F01C60F03C60707C6078FCC03FCFC00F070014147C9317>97
680D<07803F803F000700070007000E000E000E000E001C001C001CF01FFC3F1E3E0E3C0F38
6810F700F700F700F700FE01EE01EE01EE03CE03CE038607071E03FC01F0010207B9F15>I<
682007E0001FF000383800F07801E07801C07003C0200780000780000780000F00000F00000
683F00000F00000F00000700200700700381E001FF80007E00011147C9315>I<0000780003
684F80003F00000700000700000700000E00000E00000E00000E00001C00001C000F1C003FD
685C0078F800E07801C07803C07803C0700780700780700780700F00E00F00E00F00E00F00E
68630F01C60F03C60707C6078FCC03FCFC00F070015207C9F17>I<007C0001FF000783000F
68701801E01803C01803C0300780E007FFC007FE000F00000F00000F00000F0000070000070
68802007807003C1E001FF80007E00011147C9315>I<0000F80001FC0003BC00033C000718
689000700000700000E00000E00000E00000E00000E0000FFE001FFE0001C00001C00001C00
69000380000380000380000380000380000700000700000700000700000700000E00000E000
69100E00000E00000E00001C00001C00001C0000180003380007B8000F300007E00003C0000
6921629829F0E>I<003C6000FF7001E3E00381E00701E00F01E00F01C01E01C01E01C01E01
693C03C03803C03803C03803C03803C07003C0F001C1F001E3F000FFE0003CE00000E00000E
69400001C00001C00301C00783800F0F0007FE0003F8000141D7E9315>I<01E0000FE0000F
695C00001C00001C00001C000038000038000038000038000070000070000073E00077F000E
696C3800F81C00F01C00E01C01E03801C03801C03801C0380380700380700380700380E1870
6970E30700E30701C60700C60E00FC060078015207D9F17>I<006000F000F000E000000000
698000000000000000000000F001F80318031C063806380C3800700070007000E000E000E00
6991C301C601C6038C018C01F800F000C1F7D9E0E>I<0001800003C00003C0000380000000
700000000000000000000000000000000000000003C00007E0000C700018700030700030700
701060E00000E00000E00000E00001C00001C00001C00001C00003800003800003800003800
70200700000700000700000700000E00000E00030E00079C000F380007F00003C0000122882
7039E0E>I<01E0000FE0000FC00001C00001C00001C0000380000380000380000380000700
704000700000703C00707E00E0C600E18E00E31E00E61E01CC1C01F80001F00001FC00039E0
705003870003870003838607070C07070C07070C0703980E03F00601E0013207D9F15>I<03
706C01FC01F8003800380038007000700070007000E000E000E000E001C001C001C001C0038
707003800380038007000700070007180E300E300E300E6007E003C000A207C9F0C>I<1E07
708C0F8003F1FE1FC0033B8730E0063E076070063C03C07006380380700C780780E00070070
7090E000700700E000700700E000E00E01C000E00E01C000E00E01C000E00E038601C01C038
710C01C01C038C01C01C071801C01C031803803803F001801801E0023147D9325>I<1E07C0
7113F1FE033B87063E07063C038638038C780700700700700700700700E00E00E00E00E00E0
7120E01C31C01C61C01C61C038C1C018C3801F81800F018147D931A>I<007C0001FF000383
713800F01C01E01C01C01E03C01E07801E07801E07801E0F003C0F003C0F003C0F00780F007
71400700F00701E003838001FF00007C00013147C9317>I<01C1E007E7F8067E3C0C7C1C0C
715781E0C701E18E01E00E01E00E01E00E01E01C03C01C03C01C03C01C07803C07803C07003
716C0E003E3C0077F80071E000700000700000E00000E00000E00000E00001C0000FFC000FF
7178000171D809317>I<0E0F003F3F8033F1C063C1C063C3C06383C0C78380070000070000
7180700000E00000E00000E00000E00001C00001C00001C00001C000038000018000012147D
7199313>114 D<00FC03FE07070E0F0E0F0E0E1E000F800FF007F803FC003E001E701EF01C
720F01CE03860703FE01F8010147D9313>I<018001C0038003800380038007000700FFF0FF
721F00E000E000E000E001C001C001C001C0038003800380038307060706070C071803F001E
722000C1C7C9B0F>I<0F00601F80703180E031C0E06380E06380E0C381C00701C00701C007
72301C00E03800E03800E03800E038C0E07180E07180E0F180E1F3007F3F003E1C016147D93
72418>I<0F01C01F83C03183E031C1E06380E06380E0C380C00700C00700C00700C00E0180
7250E01800E01800E03000E03000E06000E06000F0C0007F80001E00013147D9315>I<0F00
72660E01F8071E03180E1F031C0E0F06380E0706380E070C381C0600701C0600701C0600701
727C0600E0380C00E0380C00E0380C00E0381800E0381800E0781800E078300070F860007F9
728FC0001F0F8001C147D931E>I<0787800FCFC018F8E03070E06071E06071E0C0E1C000E0
7290000E00000E00001C00001C00001C00071C060F380C0F380C0E38180C7C3007CFE00387C
7300013147D9315>I<0F00601F80703180E031C0E06380E06380E0C381C00701C00701C007
73101C00E03800E03800E03800E03800E07000E07000E0F000E1F0007FE0003EE00000E0000
7320E00001C00781C0078380070700060E0003FC0001F0000141D7D9316>I
733E /Fn 74 123 df<001FC1F0007FF7F801F07E7C03C0FC7C0780FC7C0F00F8380F007800
7340F0078000F0078000F0078000F0078000F007800FFFFFF80FFFFFF800F0078000F007800
7350F0078000F0078000F0078000F0078000F0078000F0078000F0078000F0078000F007800
7360F0078000F0078000F0078000F0078000F0078007FE3FF807FE3FF801E20809F1B>11
737D<001F8000FFC001E0E003C0F00781F00F01F00F00E00F00000F00000F00000F00000F00
73800FFFFF0FFFFF00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00
739F00F00F00F00F00F00F00F00F00F00F00F00F07FC3FE7FC3FE1720809F19>I<001FB000
740FFF001E1F003C1F00781F00F00F00F00F00F00F00F00F00F00F00F00F00F00F0FFFFF0FF
741FFF00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F
74200F00F00F00F00F00F00F00F00F07FE7FE7FE7FE1720809F19>I<001FC0FC00007FE7FE
7430001F07F070003C0FE07800780FC0F800F00F80F800F007807000F007800000F00780000
7440F007800000F007800000F00780000FFFFFFFF80FFFFFFFF800F007807800F007807800F
745007807800F007807800F007807800F007807800F007807800F007807800F007807800F00
7467807800F007807800F007807800F007807800F007807800F007807800F007807807FE3FF
7473FF07FE3FF3FF02420809F26>I<070F1F1E3C78F0E0400809779F17>19
748D<7038F87CFC7EFC7E7C3E0C060C060C06180C180C381C3018603040200F0E7F9F17>34
749D<70F8FCFC7C0C0C0C181838306040060E7C9F0D>39 D<006000C001800380070006000E
750001C001C003C003800380078007000700070007000F000F000F000F000F000F000F000F0
75100F000F000F000F00070007000700070007800380038003C001C001C000E000600070003
75280018000C000600B2E7CA112>I<C0006000300038001C000C000E000700070007800380
753038003C001C001C001C001C001E001E001E001E001E001E001E001E001E001E001E001E0
75401C001C001C001C003C0038003800780070007000E000C001C00380030006000C0000B2E
7557EA112>I<70F8F8F878181818183030606040050E7C840D>44 D<FFF0FFF0FFF00C0380
7568B0F>I<70F8F8F87005057C840D>I<0000400000C0000180000180000180000300000300
757000300000600000600000C00000C00000C00001800001800001800003000003000006000
75800600000600000C00000C00000C000018000018000018000030000030000060000060000
7590600000C00000C00000C0000180000180000300000300000300000600000600000600000
760C00000C00000122D7EA117>I<03F0000FFC001E1E001C0E003807007807807003807003
76180700380F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003
762C0F003C0F003C07003807003807003807807803807001C0E001E1E000FFC0003F000121F
7637E9D17>I<00C001C00FC0FFC0F3C003C003C003C003C003C003C003C003C003C003C003
764C003C003C003C003C003C003C003C003C003C003C003C003C07FFF7FFF101E7D9D17>I<
76507F0000FFC00383E00700F00600F80F80780FC07C0FC07C0FC03C07803C03003C00007C0
766000780000780000F00001E00001C0000380000700000E00001C0000380000300C00600C0
7670C00C01801C03FFF807FFF80FFFF80FFFF80121E7E9D17>I<03F0000FFC001C1E00300F
76800780F807C0F807C07807C0F803C0F80000F00000F00001E00007C0007F00007F000003C
76900000E00000F000007800007800007C03007C07807C0FC07C0FC07C0FC0780780F80700F
770003C1E001FFC0007F000121F7E9D17>I<000700000700000F00001F00001F00003F0000
7717F0000EF0000CF0001CF00038F00030F00070F000E0F000C0F00180F00380F00300F0060
7720F00E00F00FFFFF0FFFFF0000F00000F00000F00000F00000F00000F0000FFF000FFF014
7731E7F9D17>I<3003003FFF003FFE003FF8003FE000300000300000300000300000300000
77430000031F00037FC003E1E00380F00380F003007800007800007C00007C00007C07807C0
775F807C0F807C0F80780F00780600F00700E00383C001FF80007E000121F7E9D17>I<007C
7760001FE000783000E07800C0F801C0F80380700380000780000700000700000F1F800F3FE
77700F40E00F80700F80380F80380F003C0F003C0F003C0F003C0F003C07003C07003C07003
778803803803807001C07000E1E0007FC0001F000121F7E9D17>I<6000007FFFE07FFFE07F
779FFC07FFFC0E00180C00300C00300C00600000C0000180000180000300000700000600000
780E00000E00001E00001C00001C00003C00003C00003C00003C00007C00007C00007C00007
781C00007C00007C000038000131F7E9D17>I<03F0000FFC001C1E00380700300700700380
7827003807003807803807C07007F07003F8E001FFC000FF80007FC0007FE001EFF00387F80
783701F80700FC0E003C0E003C0E001C0E001C0E001C0F001807003803807001E0E000FFC00
78403F000121F7E9D17>I<03F00007F8001E1C00380E00380700700700700380F00380F003
78580F003C0F003C0F003C0F003C0F003C07007C07007C03807C01C0BC01FF3C007E3C00003
786800003800007800007003807007C0E007C0E00781C003078001FF0000FC000121F7E9D17
787>I<70F8F8F8700000000000000000000070F8F8F87005147C930D>I<70F8F8F870000000
7880000000000000070F8F8F878181818183030606040051D7C930D>I<FFFFFFFCFFFFFFFC
7890000000000000000000000000000000000000000000000000000000000000000FFFFFFFC
790FFFFFFFC1E0C7E9023>61 D<0003800000038000000380000007C0000007C0000007C000
791000FE000000FE000000FE0000019F0000019F0000019F0000030F8000030F8000030F800
79200607C0000607C0000607C0000C03E0000C03E0000C03E0001FFFF0001FFFF0001801F00
79303000F8003000F8003000F80060007C0060007C01F0007E0FFC03FFEFFC03FFE1F207F9F
79422>65 D<FFFFE000FFFFF8000F803E000F801E000F801F000F800F800F800F800F800F80
7950F800F800F800F800F800F000F801F000F803E000F807C000FFFF8000FFFFC000F801F00
7960F800F800F8007C00F8003C00F8003E00F8003E00F8003E00F8003E00F8003E00F8007C0
7970F8007C00F800F800F803F00FFFFFE00FFFFF8001B1F7E9E20>I<000FE010007FF83000
798F80E7003E00370078001F00F0000F01F0000F01E0000703C0000703C0000707C00003078
799000030F8000030F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8
800000000780000307C0000303C0000303C0000301E0000601F0000600F0000C00780018003
801E0030000F80E00007FFC00000FE0001C217E9F21>I<FFFFFF80FFFFFF800F800F800F80
80203800F8003800F8001800F8001C00F8000C00F8000C00F80C0C00F80C0C00F80C0000F80
803C0000F81C0000FFFC0000FFFC0000F81C0000F80C0000F80C0000F80C0600F80C0600F80
80400600F8000C00F8000C00F8000C00F8001C00F8001C00F8003C00F800F80FFFFFF80FFFF
805FF801B1F7E9E1F>69 D<FFFFFF80FFFFFF8007C00F8007C0038007C0018007C0018007C0
80601C007C000C007C000C007C060C007C060C007C0600007C0600007C0E00007FFE00007FF
807E00007C0E00007C0600007C0600007C0600007C0600007C0000007C0000007C0000007C0
808000007C0000007C0000007C0000007C00000FFFF0000FFFF00001A1F7F9E1E>I<000FE0
80910007FF83000F80E7003E00370078001F00F0000F01F0000F01E0000703C0000703C0000
810707C00003078000030F8000030F8000000F8000000F8000000F8000000F8000000F80000
81100F8007FFEF8007FFE780001F07C0001F03C0001F03C0001F01E0001F01F0001F00F0001
812F007C001F003E003F000FC0E70007FFC10000FF0001F217E9F24>I<FFF8FFF8FFF8FFF8
8130F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F80
8140F800F800F800F800F800F800FFFFF800FFFFF800F800F800F800F800F800F800F800F80
8150F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F80
816FFF8FFF8FFF8FFF81D1F7E9E22>I<FFF8FFF80F800F800F800F800F800F800F800F800F
817800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F
81880FFF8FFF80D1F7F9E10>I<FFFC00FFFC000F80000F80000F80000F80000F80000F8000
8190F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F8006
8200F80060F80060F80060F800E0F800E0F800C0F801C0F803C0F80FCFFFFFCFFFFFC171F7E
8219E1C>76 D<FFC0000FFEFFE0001FFE07E0001FC007E0001FC006F00037C006F00037C006
822F00037C006780067C006780067C006780067C0063C00C7C0063C00C7C0063C00C7C0061E
8230187C0061E0187C0060F0307C0060F0307C0060F0307C006078607C006078607C0060786
82407C00603CC07C00603CC07C00603CC07C00601F807C00601F807C00601F807C00600F007
825C00F00F007C0FFF0F0FFFEFFF060FFFE271F7F9E2A>I<FF801FF8FFC01FF80FE003C00F
826E001800DF001800DF001800CF801800CFC01800C7C01800C3E01800C3F01800C1F01800C
8270F81800C0FC1800C07C1800C07E1800C03E1800C01F1800C01F9800C00F9800C007D800C
828007F800C003F800C001F800C001F800C000F800C000F800C0007801E000380FFC00380FF
829C001801D1F7E9E22>I<001FE000007FF80001F03E0003C00F00078007800F0003C01E00
83001E03E0001F03C0000F07C0000F87C0000F878000078F800007CF800007CF800007CF800
831007CF800007CF800007CF800007CF800007CF800007C7C0000F87C0000F87C0000F83C00
83200F03E0001F01E0001E00F0003C00780078003C00F0001F03E00007FF800001FE0001E21
8337E9F23>I<FFFFE000FFFFF8000F803E000F801F000F800F800F8007800F8007C00F8007
834C00F8007C00F8007C00F8007C00F8007800F800F800F801F000F803E000FFFF8000FFFE0
835000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000
836000F8000000F8000000F800000FFF80000FFF800001A1F7E9E1F>I<FFFF8000FFFFF000
8370F807C000F803E000F801F000F800F000F800F800F800F800F800F800F800F800F800F00
8380F801F000F803E000F807C000FFFF0000FFFE0000F81F8000F807C000F807C000F803E00
8390F803E000F803E000F803E000F803E000F803E000F803E000F803E0C0F803E0C0F801F0C
840FFF80F18FFF807F8000001F01E207E9E21>82 D<03F0400FFCC01E0FC03807C07803C070
84101C0F001C0F000C0F000C0F000C0F80000FC00007F00007FF0003FFE001FFF000FFF8003
842FFC0007FE00007E00003F00001F00000F0C000F0C000F0C000F0E000E0E000E0F001E0F8
84301C0FE0780C7FF0081FC0014217E9F19>I<7FFFFFE07FFFFFE07C0F81E0700F80E0600F
8448060600F8060E00F8070C00F8030C00F8030C00F8030C00F8030000F8000000F8000000F
8458000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F
8468000000F8000000F8000000F8000000F8000000F8000000F800003FFFE0003FFFE001C1F
8477E9E21>I<FFF81FF8FFF81FF80F8003C00F8001800F8001800F8001800F8001800F8001
848800F8001800F8001800F8001800F8001800F8001800F8001800F8001800F8001800F8001
849800F8001800F8001800F8001800F8001800F8001800F8001800F80018007800300078003
8500003C0030003C0060001E00C0000F83800003FF000000FC0001D207E9E22>I<FFF807FE
851FFF807FE0F8000F00F8000E007C000C007C000C007C000C003E0018003E0018003F00180
85201F0030001F0030001F8070000F8060000F8060000FC0E00007C0C00007C0C00003E1800
853003E1800003E1800001F3000001F3000001FB000000FE000000FE000000FE0000007C000
8540007C0000003800000038000000380001F207F9E22>I<FFF8FFF83FF0FFF8FFF83FF01F
855800F8007800F800F8003000F8007C003000FC007C0070007C007C0060007C00FE0060007
856E00FE00E0003E00FE00C0003E01FF00C0003E019F00C0001F019F0180001F019F0180001
857F030F8180000F830F8300000F830F8300000F8607C3000007C607C6000007C607C600000
8587CC03E6000007EC03EE000003EC03EC000003FC03FC000003F801FC000001F801F800000
8591F801F8000001F000F8000000F000F0000000F000F0000000E000700000006000600002C
860207F9E2F>I<FFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0
861C0C0C0C0C0C0C0C0C0C0C0C0C0FFFF082D7CA10D>91 D<0804180C3018703860306030C0
86260C060C060F87CFC7EFC7E7C3E381C0F0E7A9F17>I<FFFF030303030303030303030303
8630303030303030303030303030303030303030303030303030303030303FFFF082D80A10D
864>I<0FE0003FF8007C3C007C1E007C0F00380F00000F00000F0001FF000FCF003E0F0078
8650F00780F00F00F30F00F30F00F30F01F30783FF03FC7E00F83C014147E9317>97
866D<1E0000FE0000FE00001E00001E00001E00001E00001E00001E00001E00001E00001E00
867001E3F001EFFC01FC1E01F00F01E00701E00781E00381E003C1E003C1E003C1E003C1E00
8683C1E003C1E00381E00781E00701F00F01D83E01CFF80183E0016207F9F19>I<01F80007
869FE001E1F003C1F00381F00780E00700000F00000F00000F00000F00000F00000F0000078
87000007800003C01803C03801F070007FE0001F80011147F9314>I<0001E0000FE0000FE0
8710001E00001E00001E00001E00001E00001E00001E00001E00001E003F1E007FDE01F07E0
8723C03E03801E07801E07001E0F001E0F001E0F001E0F001E0F001E0F001E07001E07801E0
8733801E03C03E01E0FE00FFDFC03F1FC16207F9F19>I<03F0000FFC001E1E003C0F003807
87400780700700380F00380FFFF80FFFF80F00000F00000F000007000007800003801803C03
875801F070007FE0001F80011147F9314>I<003E0000FF0003CF80078F80078F800F07000F
87600000F00000F00000F00000F00000F0000FFF000FFF0000F00000F00000F00000F00000F
87700000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00007F
878F0007FF0001120809F0E>I<0000E003E3F00FFE701C1C70380E60780F00780F00780F00
879780F00780F00380E001C1C001FF80033E0002000003000003000003FFE003FFF801FFFC0
8801FFFE07001E06000F0E00070E00070E000707000E07801E03E07C00FFF0003FC00141F7F
8819417>I<1E0000FE0000FE00001E00001E00001E00001E00001E00001E00001E00001E00
882001E00001E1F001E7F801EC3C01F81E01F01E01E01E01E01E01E01E01E01E01E01E01E01
883E01E01E01E01E01E01E01E01E01E01E01E01E01E01E0FFC7FCFFC7FC16207F9F19>I<1C
884003E003E003E001C000000000000000000000000001E00FE00FE001E001E001E001E001E
885001E001E001E001E001E001E001E001E001E001E00FFC0FFC00A1F7F9E0D>I<007000F8
88600F800F80070000000000000000000000000007807F807F800F800780078007800780078
887007800780078007800780078007800780078007800780078007800787078F878F8F0F9E0
8887FC03F000D28839E0E>I<1E0000FE0000FE00001E00001E00001E00001E00001E00001E
88900001E00001E00001E00001E1FF01E1FF01E0F801E0E001E0C001E18001E30001E70001E
890F0001FF8001F78001E3C001E3E001E1E001E1F001E0F801E07801E07C0FFCFF8FFCFF815
891207F9F18>I<1E00FE00FE001E001E001E001E001E001E001E001E001E001E001E001E00
8921E001E001E001E001E001E001E001E001E001E001E001E001E001E001E00FFC0FFC00A20
8937F9F0D>I<1E1F80FC00FE7FC3FE00FEC1E60F001F80FC07801F00F807801E00F007801E
89400F007801E00F007801E00F007801E00F007801E00F007801E00F007801E00F007801E00
895F007801E00F007801E00F007801E00F007801E00F00780FFC7FE3FF0FFC7FE3FF024147F
8969327>I<1E1F00FE7F80FEC3C01F81E01F01E01E01E01E01E01E01E01E01E01E01E01E01
897E01E01E01E01E01E01E01E01E01E01E01E01E01E01E0FFC7FCFFC7FC16147F9319>I<01
898F80007FE001E07803C03C03801C07000E07000E0F000F0F000F0F000F0F000F0F000F0F0
89900F07000E07801E03801C03C03C01E078007FE0001F80014147F9317>I<1E3F00FEFFC0
900FFC3E01F00F01E00701E00781E00781E003C1E003C1E003C1E003C1E003C1E003C1E0078
9011E00781E00F01F00F01F83E01EFF801E3E001E00001E00001E00001E00001E00001E0000
9021E0000FFC000FFC000161D7F9319>I<01F06007FCE01F0EE03C03E03C03E07801E07801
903E0F001E0F001E0F001E0F001E0F001E0F001E07801E07801E03803E03C03E01F0FE00FFD
904E003F1E00001E00001E00001E00001E00001E00001E00001E0000FFC000FFC161D7F9318
905>I<1E78FEFCFF9E1F1E1F0C1F001E001E001E001E001E001E001E001E001E001E001E00
9061E00FFE0FFE00F147F9312>I<0FC83FF870386018E018E018F000FF807FE03FF81FFC01
907FC003EC00EC00EE00EE00CF83CDFF887E00F147F9312>I<06000600060006000E000E00
9081E003E00FFF8FFF81E001E001E001E001E001E001E001E001E001E001E0C1E0C1E0C1E0C
9091E0C0F1807F003E00E1C7F9B12>I<1E01E0FE0FE0FE0FE01E01E01E01E01E01E01E01E0
9101E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E03E01E03E00E0DE007F9FC
91103F1FC16147F9319>I<FFC7F8FFC7F81E01E01F01C00F01800F01800783000783000783
9120003C60003C60003C60001EC0001EC0001FC0000F80000F8000070000070000070001514
9137F9318>I<FF9FF3FCFF9FF3FC1E03C0F01E03C0601F03C0E00F07C0C00F07E0C00F87E1
914C0078CE180078CF18007CCF38003D8730003D87B0003F87F0001F03E0001F03E0001F03E
9150000E01C0000E01C0000E01C001E147F9321>I<7FE7FC7FE7FC0F83E007838003C30003
916E70001EE0000FC00007800007800003C00007E0000FE0001CF000187800387800703C00F
91703E0FF87FEFF87FE1714809318>I<FFC7F8FFC7F81E01E01F01C00F01800F0180078300
91807830007830003C60003C60003C60001EC0001EC0001FC0000F80000F800007000007000
91900700000600000600000600070C000F8C000C18000E380007F00003C0000151D7F9318>
920I<7FFF7FFF781E703E603C607860F861F001E003E007C007830F831F031E073C067C0678
9211EFFFEFFFE10147F9314>I E /Fo 41 122 df<0001FF0000001FFFC000007F81E00000
922FC01E00001F807F00003F807F00007F007F00007F007F00007F007F00007F007F00007F0
92301C00007F000000007F000000007F000000007F03FF800FFFFFFF800FFFFFFF800FFFFFF
924F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F8
9250007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F800
92607F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F8007F
927FF3FFF807FFF3FFF807FFF3FFF80212A7FA925>12 D<000E00001E00007E0007FE00FFFE
92800FFFE00F8FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE
9290000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE
9300000FE0000FE0000FE0000FE0000FE0000FE0000FE00FFFFFEFFFFFEFFFFFE17277BA622
931>49 D<00FF800007FFF0001FFFFC003E07FE007E01FF807F007F80FF807FC0FF803FC0FF
932803FE0FF801FE0FF801FE07F001FE03E003FE000003FE000003FC000003FC000007F8000
933007F000000FE000000FC000001F8000003F0000007C000000F8000001F0000003C000000
9347800E0007000E000E000E001C001C0030001C0060001C00FFFFFC01FFFFFC03FFFFFC07F
935FFFFC0FFFFFF80FFFFFF80FFFFFF801B277DA622>I<007F800003FFF00007FFFC000F81
936FE001F00FF001F80FF003FC07F803FC07F803FC07F803FC07F801FC07F800F80FF000000
937FF000000FE000001FC000003F8000007F00000FF800000FFC0000001F8000000FE000000
9387F0000007F8000003FC000003FC000003FE01C003FE07F003FE07F003FE0FF803FE0FF80
9393FE0FF803FC0FF803FC07F007F807E00FF003F01FE001FFFFC0007FFF00000FF80001B27
9407DA622>I<00000F0000000F0000001F0000003F0000007F000000FF000001FF000001FF
941000003BF0000073F00000E3F00001C3F00003C3F0000383F0000703F0000E03F0001C03F
9420003803F0007803F0007003F000E003F001C003F0038003F0070003F00F0003F00FFFFFF
943F8FFFFFFF8FFFFFFF800007F0000007F0000007F0000007F0000007F0000007F0000007F
9440000007F00001FFFF8001FFFF8001FFFF81D277EA622>I<180003001F801F001FFFFE00
9451FFFFC001FFFF8001FFFF0001FFFE0001FFF80001FFE00001C0000001C0000001C000000
9461C0000001C0000001C0000001C7FC0001DFFF8001F80FC001E003F0008003F0000001F80
94700001FC000001FC000001FE000001FE03C001FE07E001FE0FF001FE0FF001FE0FF001FE0
948FF001FC0FE001FC07C003F8078003F803C007F001F01FE000FFFFC0003FFF00000FF8000
9491B277DA622>I<0007F800003FFE0000FFFF0001FC0F8003F00F8007E01FC00FC03FC01F
950803FC01F803FC03F803FC03F001F807F000F007F0000007F000000FF020000FF1FF000FF
9513FFC00FF603E00FFC03F00FF801F80FF801FC0FF801FC0FF001FC0FF001FE0FF001FE0FF
952001FE07F001FE07F001FE07F001FE07F001FE03F001FE03F001FC01F801FC01F801F800F
953C03F0007E07E0003FFFC0001FFF800003FC0001B277DA622>I<380000003E0000003FFF
954FFF03FFFFFF03FFFFFF07FFFFFE07FFFFFC07FFFFF807FFFFF0070000E0070000E007000
9551C00E0003800E0007000E000E0000001C0000001C0000003800000078000000F8000000F
9560000001F0000001F0000003F0000003F0000007E0000007E0000007E000000FE000000FE
957000000FE000000FE000001FE000001FE000001FE000001FE000001FE000001FE000001FE
958000000FC0000007800001C297CA822>I<00000780000000000780000000000FC0000000
959000FC0000000000FC0000000001FE0000000001FE0000000003FF0000000003FF0000000
960003FF00000000077F80000000077F800000000F7FC00000000E3FC00000000E3FC000000
96101C1FE00000001C1FE00000003C1FF0000000380FF0000000380FF00000007007F800000
96207007F8000000F007FC000000E003FC000000E003FC000001C001FE000001C001FE00000
9633FFFFFF000003FFFFFF000003FFFFFF00000700007F80000700007F80000F00007FC0000
964E00003FC0001E00003FE0001C00001FE0001C00001FE0003C00001FF00FFFE003FFFFCFF
965FE003FFFFCFFFE003FFFFC2E297EA833>65 D<FFFFFFFFE0FFFFFFFFE0FFFFFFFFE003FC
966001FE003FC0007F003FC0001F003FC0001F003FC0000F003FC00007003FC00007003FC00
967007003FC01C07803FC01C03803FC01C03803FC01C03803FC03C00003FC03C00003FC0FC0
9680003FFFFC00003FFFFC00003FFFFC00003FC0FC00003FC03C00003FC03C00003FC01C00E
96903FC01C00E03FC01C00E03FC01C01C03FC00001C03FC00001C03FC00001C03FC00003C03
970FC00003803FC00007803FC0000F803FC0001F803FC0003F803FC001FF8FFFFFFFFF0FFFF
971FFFFF0FFFFFFFFF027297EA82C>69 D<FFFFFFFFC0FFFFFFFFC0FFFFFFFFC003FC003FC0
97203FC000FE003FC0003E003FC0001E003FC0001E003FC0000E003FC0000E003FC0000E003
973FC0000F003FC01C07003FC01C07003FC01C07003FC01C00003FC03C00003FC03C00003FC
9740FC00003FFFFC00003FFFFC00003FFFFC00003FC0FC00003FC03C00003FC03C00003FC01
975C00003FC01C00003FC01C00003FC01C00003FC00000003FC00000003FC00000003FC0000
9760003FC00000003FC00000003FC00000003FC00000003FC000000FFFFFC0000FFFFFC0000
977FFFFFC000024297EA82A>I<FFFFF0FFFFF0FFFFF003FC0003FC0003FC0003FC0003FC00
97803FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC00
97903FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC00
98003FC0003FC0003FC0003FC0003FC0003FC00FFFFF0FFFFF0FFFFF014297EA819>73
981D<FFFFFC0000FFFFFC0000FFFFFC000003FC00000003FC00000003FC00000003FC000000
98203FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003
983FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC
98400000003FC00000003FC00000003FC0001C003FC0001C003FC0001C003FC0001C003FC00
98503C003FC00038003FC00038003FC00078003FC00078003FC000F8003FC000F8003FC001F
9868003FC007F8003FC01FF00FFFFFFFF00FFFFFFFF00FFFFFFFF0022297EA828>76
987D<FFFE0000003FFF80FFFE0000003FFF80FFFF0000007FFF8003FF0000007FE00003FF00
98800007FE00003BF800000EFE00003BF800000EFE000039FC00001CFE000039FC00001CFE0
98900038FE000038FE000038FE000038FE000038FE000038FE0000387F000070FE0000387F0
99000070FE0000383F8000E0FE0000383F8000E0FE0000381FC001C0FE0000381FC001C0FE0
991000381FC001C0FE0000380FE00380FE0000380FE00380FE00003807F00700FE00003807F
99200700FE00003803F80E00FE00003803F80E00FE00003803F80E00FE00003801FC1C00FE0
9930003801FC1C00FE00003800FE3800FE00003800FE3800FE000038007F7000FE000038007
994F7000FE000038007F7000FE000038003FE000FE000038003FE000FE000038001FC000FE0
99500038001FC000FE000038000F8000FE000FFFE00F803FFFF80FFFE00F803FFFF80FFFE00
9967003FFFF8039297DA840>I<FFFFFFF800FFFFFFFF00FFFFFFFFC003FC003FE003FC000F
997F003FC0007F803FC0007FC03FC0003FC03FC0003FE03FC0003FE03FC0003FE03FC0003FE
99803FC0003FE03FC0003FE03FC0003FE03FC0003FC03FC0007FC03FC0007F803FC000FF003
999FC003FE003FFFFFF8003FFFFFE0003FC00000003FC00000003FC00000003FC00000003FC
100000000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00
1001000003FC00000003FC00000003FC00000003FC000000FFFFF00000FFFFF00000FFFFF000
10020027297EA82E>80 D<00FF806003FFF0E00FFFF9E01F80FFE03F001FE03E0007E07C0003
1003E07C0003E0FC0001E0FC0001E0FC0000E0FE0000E0FE0000E0FF000000FFC000007FFC00
1004007FFFE0003FFFF8001FFFFE001FFFFF0007FFFF8003FFFFC000FFFFC0000FFFE000007F
1005E000001FF000000FF0000007F0E00003F0E00003F0E00003F0E00003F0F00003E0F00003
1006E0F80007E0FC0007C0FF000F80FFE03F80F3FFFE00E1FFFC00C01FF0001C297CA825>83
1007D<7FFFFFFFFF807FFFFFFFFF807FFFFFFFFF807F807F807F807C007F800F8078007F8007
10088078007F80078070007F800380F0007F8003C0F0007F8003C0E0007F8001C0E0007F8001
1009C0E0007F8001C0E0007F8001C0E0007F8001C000007F80000000007F80000000007F8000
10100000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000
10110000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000
10120000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000
10130000007F80000000FFFFFFC00000FFFFFFC00000FFFFFFC0002A287EA72F>I<FFFFF000
10147FFFFFFFF0007FFFFFFFF0007FFF03FE000001C001FE0000038001FE0000038001FF0000
1015078000FF0000070000FF80000F00007F80000E00007FC0000E00003FC0001C00003FC000
10161C00003FE0003C00001FE0003800001FF0007800000FF0007000000FF80070000007F800
1017E0000007F800E0000003FC01C0000003FC01C0000003FE03C0000001FE0380000001FF07
101880000000FF0700000000FF87000000007F8E000000007F8E000000007FDE000000003FDC
1019000000003FFC000000001FF8000000001FF8000000000FF0000000000FF0000000000FF0
10200000000007E00000000007E00000000003C00000000003C0000030297FA833>86
1021D<01FF80000FFFF0001F81FC003FC0FE003FC07F003FC03F003FC03F801F803F800F003F
10228000003F8000003F800000FF80007FFF8003FFFF800FF03F801FC03F803F803F807F003F
102380FE003F80FE003F80FE003F80FE003F80FE007F807F00DF803F839FFC1FFF0FFC03FC03
1024FC1E1B7E9A21>97 D<FFE00000FFE00000FFE000000FE000000FE000000FE000000FE000
1025000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE1FE
1026000FEFFF800FFE0FE00FF803F00FF001F80FE001FC0FE000FC0FE000FE0FE000FE0FE000
1027FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FE0FE000
1028FE0FE000FE0FE001FC0FE001FC0FF001F80FF803F00F9C0FE00F0FFF800E01FC00202A7E
1029A925>I<003FE00001FFFC0003F07E000FC0FF001FC0FF003F80FF003F80FF007F007E00
10307F003C007F000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000
10317F0000007F0000007F8000003F8003803F8003801FC007000FE00E0003F83C0001FFF800
1032003FC000191B7E9A1E>I<00007FF000007FF000007FF0000007F0000007F0000007F000
10330007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000
10343F87F001FFF7F007F03FF00FC00FF01F8007F03F8007F03F8007F07F0007F07F0007F07F
10350007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F07F
10360007F07F0007F03F0007F03F8007F01F800FF00FC01FF007F07FFF01FFE7FF007F87FF20
10372A7EA925>I<003FC00001FFF00003F0FC000FC03E001F803F001F801F003F801F807F00
10381F807F001FC07F000FC0FF000FC0FF000FC0FFFFFFC0FFFFFFC0FF000000FF000000FF00
103900007F0000007F0000007F0000003F8001C01F8001C00FC0038007C0070003F01E0000FF
1040FC00003FE0001A1B7E9A1F>I<0003F800001FFE00007E3F0001FC3F8001F87F8003F87F
10418007F07F8007F03F0007F03F0007F0000007F0000007F0000007F0000007F0000007F000
104200FFFFC000FFFFC000FFFFC00007F0000007F0000007F0000007F0000007F0000007F000
10430007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000
10440007F0000007F0000007F0000007F0000007F0000007F000007FFF80007FFF80007FFF80
104500192A7EA915>I<00FF81F003FFE7F80FC1FE1C1F80FC7C3F007E7C3F007E387F007F00
10467F007F007F007F007F007F007F007F007F007F003F007E003F007E001F80FC000FC1F800
10471FFFE00018FF800038000000380000003C0000003E0000003FFFF8003FFFFF001FFFFFC0
10480FFFFFE007FFFFF01FFFFFF03E0007F07C0001F8F80000F8F80000F8F80000F8F80000F8
10497C0001F07C0001F03F0007E00FC01F8007FFFF00007FF0001E287E9A22>I<FFE00000FF
1050E00000FFE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000F
1051E000000FE000000FE000000FE000000FE000000FE0FE000FE3FF800FE70FC00FEC0FE00F
1052F807E00FF807F00FF007F00FF007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1053E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1054E007F00FE007F0FFFE3FFFFFFE3FFFFFFE3FFF202A7DA925>I<07000F801FC03FE03FE0
10553FE01FC00F8007000000000000000000000000000000FFE0FFE0FFE00FE00FE00FE00FE0
10560FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0FFFE
1057FFFEFFFE0F2B7EAA12>I<FFE00000FFE00000FFE000000FE000000FE000000FE000000F
1058E000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000F
1059E01FFC0FE01FFC0FE01FFC0FE007800FE00F000FE01E000FE03C000FE078000FE0E0000F
1060E3C0000FE7C0000FEFE0000FFFF0000FFFF8000FF3F8000FE1FC000FC0FE000FC07F000F
1061C07F000FC03F800FC01FC00FC00FE00FC00FE00FC007F0FFFC1FFFFFFC1FFFFFFC1FFF20
10622A7FA923>107 D<FFE0FFE0FFE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0
10630FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0
10640FE00FE00FE00FE00FE00FE00FE0FFFEFFFEFFFE0F2A7EA912>I<FFC07F001FC000FFC1
1065FFC07FF000FFC707E1C1F8000FCC07F301FC000FD803F600FC000FD803FE00FE000FF003
1066FC00FE000FF003FC00FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F8
106700FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800
1068FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800FE
1069000FE003F800FE000FE003F800FE00FFFE3FFF8FFFE0FFFE3FFF8FFFE0FFFE3FFF8FFFE0
1070331B7D9A38>I<FFC0FE00FFC3FF80FFC70FC00FCC0FE00FD807E00FD807F00FF007F00F
1071F007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1072E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F0FFFE3FFFFF
1073FE3FFFFFFE3FFF201B7D9A25>I<003FE00001FFFC0003F07E000FC01F801F800FC03F80
10740FE03F0007E07F0007F07F0007F07F0007F0FF0007F8FF0007F8FF0007F8FF0007F8FF00
107507F8FF0007F8FF0007F8FF0007F87F0007F07F0007F03F800FE03F800FE01F800FC00FC0
10761F8007F07F0001FFFC00003FE0001D1B7E9A22>I<FFE1FE00FFEFFF80FFFE0FE00FF807
1077F00FF003F80FE001FC0FE001FC0FE001FE0FE000FE0FE000FF0FE000FF0FE000FF0FE000
1078FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FE0FE001FE0FE001FE0FE001FC0FE003
1079FC0FF003F80FF807F00FFC1FE00FEFFF800FE1FC000FE000000FE000000FE000000FE000
1080000FE000000FE000000FE000000FE000000FE00000FFFE0000FFFE0000FFFE000020277E
10819A25>I<FFC1F0FFC7FCFFCE3E0FDC7F0FD87F0FF07F0FF07F0FF03E0FE0000FE0000FE0
1082000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0
1083000FE000FFFF00FFFF00FFFF00181B7F9A1B>114 D<03FE300FFFF03E03F07800F07000
1084F0F00070F00070F80070FE0000FFE0007FFF007FFFC03FFFE01FFFF007FFF800FFF80007
1085FC0000FCE0007CE0003CF0003CF00038F80038FC0070FF01E0F7FFC0C1FF00161B7E9A1B
1086>I<00E00000E00000E00000E00001E00001E00001E00003E00003E00007E0000FE0001F
1087FFE0FFFFE0FFFFE00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000F
1088E0000FE0000FE0000FE0000FE0700FE0700FE0700FE0700FE0700FE0700FE07007F0E003
1089F0C001FF80007F0014267FA51A>I<FFE07FF0FFE07FF0FFE07FF00FE007F00FE007F00F
1090E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1091E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE00FF00FE00FF007
1092E01FF003F077FF01FFE7FF007F87FF201B7D9A25>I<FFFC03FFFFFC03FFFFFC03FF0FF0
109300F007F000E007F800E003F801C003F801C003FC03C001FC038001FE078000FE070000FF
10940700007F0E00007F0E00007F9E00003F9C00003FFC00001FF800001FF800000FF000000F
1095F000000FF0000007E0000007E0000003C0000003C000201B7F9A23>I<FFFC7FFC1FFCFF
1096FC7FFC1FFCFFFC7FFC1FFC0FE00FE001C007F007E0038007F007E0038007F807F0078003
1097F807F0070003F80FF8070003FC0FF80F0001FC0FF80E0001FC1FFC0E0000FE1CFC1C0000
1098FE1CFE1C0000FF387E3C00007F387E3800007F787F3800003FF03F7000003FF03FF00000
10993FE01FF000001FE01FE000001FE01FE000000FC00FC000000FC00FC000000F8007C00000
110007800780000007800780002E1B7F9A31>I<FFFC1FFEFFFC1FFEFFFC1FFE07F0038003F8
1101078003FC0F0001FE1E0000FE3C00007F3800007FF800003FF000001FE000000FE000000F
1102F0000007F800000FF800001FFC00003CFE000038FF0000787F0000F03F8001E01FC003C0
11031FE003800FE0FFF03FFFFFF03FFFFFF03FFF201B7F9A23>I<FFFC03FFFFFC03FFFFFC03
1104FF0FF000F007F000E007F800E003F801C003F801C003FC03C001FC038001FE078000FE07
11050000FF0700007F0E00007F0E00007F9E00003F9C00003FFC00001FF800001FF800000FF0
110600000FF000000FF0000007E0000007E0000003C0000003C0000003800000038000000780
110700380700007C0F0000FE0E0000FE1E0000FE1C0000FE38000074F000003FE000000F8000
11080020277F9A23>I E /Fp 39 127 df<007E0001C1800301800703C00E03C00E01800E00
1109000E00000E00000E00000E0000FFFFC0FFFFC00E01C00E01C00E01C00E01C00E01C00E01
1110C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C07F87F87F87F8151D809C17
1111>12 D<FC00FC001C001C001C001C001C001C001C001C001C001C001C001C001C001C00FF
111280FF8009127F910C>16 D<070F0F1C3870E0400808789C15>19 D<1C001E000780038003
1113800380FF00800009087B7E12>24 D<70F8F8F87005057D840C>46
1114D<07C01FF0387C603C601EF01FF81FF80FF80F700F001F001E001E003C0038007000E000
1115C00180030006000C031803100320067FFEFFFEFFFE101C7E9B15>50
1116D<00060000000F0000000F0000000F0000001F8000001F8000001F8000003FC0000033C0
1117000033C0000073E0000061E0000061E00000E1F00000C0F00000C0F00001C0F800018078
11180001FFF80003FFFC0003003C0003003C0007003E0006001E0006001E000E001F001E000F
111900FF807FF0FF807FF01C1D7F9C1F>65 D<001F808000FFE18001F03B8007C00F800F0007
1120801F0007801E0003803C0003807C0001807C00018078000180F8000000F8000000F80000
112100F8000000F8000000F8000000F8000000F8000000780001807C0001807C0001803C0001
1122801E0003001F0003000F00060007C00C0001F0380000FFF000001FC000191E7E9C1E>67
1123D<FFFFFCFFFFFC0F007C0F001C0F000C0F000E0F00060F03060F03060F03060F03000F07
1124000FFF000FFF000F07000F03000F03000F03030F03030F00030F00060F00060F00060F00
11250E0F001E0F007CFFFFFCFFFFFC181C7E9B1C>69 D<FFF0FFF00F000F000F000F000F000F
1126000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F
112700FFF0FFF00C1C7F9B0F>73 D<FFF800FFF8000F00000F00000F00000F00000F00000F00
1128000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00180F00180F00
1129180F00180F00380F00300F00700F00F00F01F0FFFFF0FFFFF0151C7E9B1A>76
1130D<003F800000E0E0000380380007001C000E000E001E000F003C0007803C0007807C0007
1131C0780003C0780003C0F80003E0F80003E0F80003E0F80003E0F80003E0F80003E0F80003
1132E0F80003E0780003C07C0007C07C0007C03C0007803E000F801E000F000F001E0007001C
1133000380380000E0E000003F80001B1E7E9C20>79 D<FFFF80FFFFE00F01F00F00780F003C
11340F003E0F003E0F003E0F003E0F003E0F003C0F003C0F00780F01F00FFFC00F00000F0000
11350F00000F00000F00000F00000F00000F00000F00000F00000F0000FFF000FFF000171C7E
11369B1C>I<7FFFFFC07FFFFFC0780F03C0700F01C0600F00C0E00F00E0C00F0060C00F0060
1137C00F0060C00F0060000F0000000F0000000F0000000F0000000F0000000F0000000F0000
1138000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000
113903FFFC0003FFFC001B1C7F9B1E>84 D<0FE0001838003C1C003C0E00180E00000E00000E
11400001FE000F8E003C0E00780E00700E00F00E60F00E60F00E60701E603827C00FC3801312
11417F9115>97 D<FC0000FC00001C00001C00001C00001C00001C00001C00001C00001C0000
11421C00001CFC001F87001E03801C01C01C01E01C00E01C00F01C00F01C00F01C00F01C00F0
11431C00F01C00E01C01E01C01C01E03801B070018FC00141D7F9C17>I<03F80E0C1C1E381E
1144780C7000F000F000F000F000F000F0007000780638061C0C0E1803E00F127F9112>I<00
11451F80001F8000038000038000038000038000038000038000038000038000038003F3800E
11460F801C0780380380780380700380F00380F00380F00380F00380F00380F0038070038078
114703803803801C07800E1BF003F3F0141D7F9C17>I<07E00C301818381C701E700EF00EFF
1148FEF000F000F000F000700070063806180C0E1803E00F127F9112>I<00F8018C071E061E
11490E0C0E000E000E000E000E000E00FFE0FFE00E000E000E000E000E000E000E000E000E00
11500E000E000E000E000E007FE07FE00F1D809C0D>I<00038007E4C00C39C0381DC0381C00
1151781E00781E00781E00781E00381C00381C001C300037E0002000003000003000003FF800
11521FFF001FFF803003806001C0C000C0C000C0C000C06001803003001C0E0007F800121C7F
11539215>I<FC0000FC00001C00001C00001C00001C00001C00001C00001C00001C00001C00
1154001C7C001C87001D03001E03801C03801C03801C03801C03801C03801C03801C03801C03
1155801C03801C03801C03801C0380FF9FF0FF9FF0141D7F9C17>I<38007C007C007C003800
1156000000000000000000000000FC00FC001C001C001C001C001C001C001C001C001C001C00
11571C001C001C001C00FF80FF80091D7F9C0C>I<01C003E003E003E001C000000000000000
1158000000000007E007E000E000E000E000E000E000E000E000E000E000E000E000E000E000
1159E000E000E000E000E000E060E0F0C0F1C061803E000B25839C0D>I<FC00FC001C001C00
11601C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C00
11611C001C001C001C001C00FF80FF80091D7F9C0C>108 D<FC7E07E000FC838838001D0190
116218001E01E01C001C01C01C001C01C01C001C01C01C001C01C01C001C01C01C001C01C01C
1163001C01C01C001C01C01C001C01C01C001C01C01C001C01C01C001C01C01C00FF8FF8FF80
1164FF8FF8FF8021127F9124>I<FC7C00FC87001D03001E03801C03801C03801C03801C0380
11651C03801C03801C03801C03801C03801C03801C03801C0380FF9FF0FF9FF014127F9117>
1166I<03F0000E1C00180600380700700380700380F003C0F003C0F003C0F003C0F003C0F003
1167C07003807003803807001C0E000E1C0003F00012127F9115>I<FCFC00FF87001E03801C
116801C01C01E01C00E01C00F01C00F01C00F01C00F01C00F01C00F01C01E01C01E01C01C01E
116903801F07001CFC001C00001C00001C00001C00001C00001C0000FF8000FF8000141A7F91
117017>I<03F1800E19801C0780380780780380780380F00380F00380F00380F00380F00380
1171F003807003807803803807801C07800E1B8003E380000380000380000380000380000380
1172000380001FF0001FF0141A7F9116>I<FCE0FD381E781E781C301C001C001C001C001C00
11731C001C001C001C001C001C00FFC0FFC00D127F9110>I<1F9020F04070C030C030E030F8
1174007F803FE00FF000F8C038C018C018E018E010D0608FC00D127F9110>I<0C000C000C00
11750C000C000C001C001C003FE0FFE01C001C001C001C001C001C001C001C001C301C301C30
11761C301C300C200E6003C00C1A7F9910>I<FC1F80FC1F801C03801C03801C03801C03801C
117703801C03801C03801C03801C03801C03801C03801C03801C07800C07800E1BF003E3F014
1178127F9117>I<FF0FE0FF0FE01C07801C03000E06000E06000E0600070C00070C00070C00
117903980003980003F80001F00001F00000E00000E00000E00013127F9116>I<FF3FCFE0FF
11803FCFE03C0F07801C0F03001C1B03001C1B87000E1B86000E3B86000E3186000731CC0007
118131CC000760CC0003E0F80003E0F80003C0780003C0780001C0700001C070001B127F911E
1182>I<7F8FF07F8FF00F0780070600038E0001DC0001D80000F00000700000780000F80001
1183DC00038E00030E000607000F0380FF0FF8FF0FF81512809116>I<FF0FE0FF0FE01C0780
11841C03000E06000E06000E0600070C00070C00070C0003980003980003F80001F00001F000
118500E00000E00000E00000C00000C00000C000F18000F18000F300006600003C0000131A7F
11869116>I<1C043F0843F080E00E047D9B15>126 D E /Fq 13 118
1187df<0F001F003F803F007E00F800F000C0000908769C18>19 D<00038000000380000007
1188C0000007C0000007C000000FE000000FE000001FF000001BF000003BF8000031F8000031
1189F8000060FC000060FC0000E0FE0000C07E0000C07E0001803F0001FFFF0003FFFF800300
11901F8007001FC006000FC006000FC00C0007E00C0007E0FF803FFEFF803FFE1F1C7E9B24>
119165 D<07F8601FFEE03C07E07801E07000E0F000E0F00060F00060F80000FE0000FFE000
11927FFE003FFF003FFF800FFFC007FFE0007FE00003F00001F00000F0C000F0C000F0C000E0
1193E000E0F001C0FC03C0EFFF00C3FC00141C7D9B1B>83 D<07F8001FFE003F1F803F07803F
119407C01E07C00C07C003FFC01FFFC03F87C07E07C0FC07C0FC07C0FC07C0FC0FC07E1FC03F
1195FBF80FE1F815127F9117>97 D<FF0000FF00001F00001F00001F00001F00001F00001F00
1196001F00001F00001F00001F1FC01FFFE01FC1F81F00F81F007C1F007C1F007E1F007E1F00
11977E1F007E1F007E1F007E1F007C1F007C1F80F81FC1F01C7FE0181F80171D7F9C1B>I<03
1198F8000FFE001F3F003E3F007C3F007C1E00FC0C00FC0000FC0000FC0000FC0000FC00007C
119900007E01803E03801F07000FFE0003F80011127E9115>I<1C003E007F007F007F003E00
12001C00000000000000000000007F007F001F001F001F001F001F001F001F001F001F001F00
12011F001F001F001F00FFC0FFC00A1E7F9D0E>105 D<FF1FC0FE00FF7FE3FF001FE1F70F80
12021F80FC07C01F80FC07C01F00F807C01F00F807C01F00F807C01F00F807C01F00F807C01F
120300F807C01F00F807C01F00F807C01F00F807C01F00F807C01F00F807C0FFE7FF3FF8FFE7
1204FF3FF825127F9128>109 D<01FC000FFF801F07C03E03E07C01F07C01F0FC01F8FC01F8
1205FC01F8FC01F8FC01F8FC01F87C01F07C01F03E03E01F07C00FFF8001FC0015127F9118>
1206111 D<FE7C00FEFF001FDF801F9F801F9F801F0F001F06001F00001F00001F00001F0000
12071F00001F00001F00001F00001F0000FFE000FFE00011127F9114>114
1208D<1FD83FF87038E018E018F000FF807FE07FF01FF807FC007CC01CC01CE01CF038FFF0CF
1209C00E127E9113>I<030003000300070007000F000F003F00FFFCFFFC1F001F001F001F00
12101F001F001F001F001F001F0C1F0C1F0C1F0C0F9807F003E00E1A7F9913>I<FF07F8FF07
1211F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00
1212F81F01F80F03F807FEFF03F8FF18127F911B>I E /Fr 19 118 df<387CFCFE7E3E0E1C
12133CF8F040070C788516>44 D<FFFF80FFFF80FFFF8011037E8D16>I<3078FCFC78300606
1214788516>I<00F80003FC0007FE000F07001C3B8038FF8079FF8073C7C07383C0E701C0E7
121501C0E701C0E701C0E701C0E701C0E701C073838073C78079FF0038FE001C38000F03C007
1216FFC003FF0000FC0012197E9816>64 D<1FE0003FF0007FF800783C00300E00000E00003E
12170007FE001FFE007FCE00780E00E00E00E00E00E00E00783E007FFFE03FF7E00FC3E01312
12187E9116>97 D<FC0000FC0000FC00001C00001C00001C00001C00001C7C001DFE001FFF00
12191F07801E03C01C01C01C00E01C00E01C00E01C00E01C00E01C00E01E01C01E03C01F0780
12201FFF001DFE000CF80013197F9816>I<03F80FFC1FFE3C1E780C7000E000E000E000E000
1221E000F000700778073E0E1FFC0FF803F010127D9116>I<003F00003F00003F0000070000
1222070000070000070003E7000FF7001FFF003C1F00780F00700700E00700E00700E00700E0
12230700E00700E00700700F00780F003C1F001FFFE00FF7E007C7E013197F9816>I<03F000
12240FFC001FFE003C0F00780700700380E00380FFFF80FFFF80FFFF80E00000E00000700380
12257803803E07801FFF0007FE0001F80011127E9116>I<001E00007F0001FF8001C7800383
1226000380000380007FFF00FFFF00FFFF000380000380000380000380000380000380000380
1227000380000380000380000380000380007FFC00FFFE007FFC0011197F9816>I<FC0000FC
12280000FC00001C00001C00001C00001C00001CF8001DFC001FFE001F0F001E07001C07001C
122907001C07001C07001C07001C07001C07001C07001C07001C0700FF8FE0FF9FE0FF8FE013
1230197F9816>104 D<07000F800F800F800700000000000000FF80FF80FF80038003800380
1231038003800380038003800380038003800380FFFCFFFEFFFC0F1A7C9916>I<7FC000FFC0
1232007FC00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0
12330001C00001C00001C00001C00001C00001C00001C00001C0007FFF00FFFF807FFF001119
12347E9816>108 D<03E0000FF8001FFC003C1E00780F00700700E00380E00380E00380E003
123580E00380F00780700700780F003C1E001FFC000FF80003E00011127E9116>111
1236D<FC7C00FDFE00FFFF001F07801E03C01C01C01C00E01C00E01C00E01C00E01C00E01C00
1237E01E01C01E03C01F07801FFF001DFE001CF8001C00001C00001C00001C00001C00001C00
123800FF8000FF8000FF8000131B7F9116>I<7F0F80FF3FC07F7FE007F1E007C0C007800007
123980000700000700000700000700000700000700000700000700007FFC00FFFC007FFC0013
1240127F9116>114 D<0FEC3FFC7FFCF03CE01CE01C70007F801FF007F8003C600EE00EF00E
1241F81EFFFCFFF8C7E00F127D9116>I<0300000700000700000700000700007FFF00FFFF00
1242FFFF00070000070000070000070000070000070000070000070100070380070380070380
124307870003FE0001FC0000F80011177F9616>I<FC3F00FC3F00FC3F001C07001C07001C07
1244001C07001C07001C07001C07001C07001C07001C07001C07001C1F001FFFE00FFFE007E7
1245E013127F9116>I E /Fs 40 125 df<038007800F800F001E003C0038007000E0004000
1246090A77A218>19 D<70F8FCFC7404040404080810102040060F7C840E>44
1247D<FFF8FFF8FFF80D03808B10>I<00C001C007C0FFC0FBC003C003C003C003C003C003C0
124803C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C0
124903C003C0FFFFFFFF10217CA018>49 D<3000803C07003FFF003FFE003FF80037E0003000
12500030000030000030000030000030000031F800360C003807003007003007800003C00003
1251C00003E00003E00003E07003E0F803E0F803E0F803E0F803C0C003C0600780600780300F
1252001C1E000FFC0003F00013227EA018>53 D<01F00007FC000E0E001C0700380380780380
1253700380F001C0F001C0F001C0F001E0F001E0F001E0F001E0F001E07001E07003E03803E0
12541805E00C05E00619E003E1E00001C00001C00003C00003803803807C03807C0700780E00
1255301C003838001FF00007C00013227EA018>57 D<000FE010003FF83000F80E7001E00770
125603C001F0078001F00F0000F01E0000F03E0000703C0000707C0000707C00003078000030
125778000030F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000
125878000000780000307C0000307C0000303C0000303E0000601E0000600F0000C0078000C0
125903C0018001E0030000FC0E00003FFC00000FE0001C247DA223>67
1260D<FFFFF800FFFFFF0007C00F8007C003C007C001E007C000F007C0007807C0007C07C000
12613C07C0003E07C0001E07C0001E07C0001E07C0001F07C0001F07C0001F07C0001F07C000
12621F07C0001F07C0001F07C0001F07C0001F07C0001E07C0001E07C0003E07C0003C07C000
12633C07C0007807C000F007C001F007C003E007C00F80FFFFFF00FFFFF80020227FA125>I<
1264FFFFFFE0FFFFFFE007C007E007C001E007C000E007C0006007C0007007C0007007C00030
126507C0003007C0183007C0183007C0180007C0180007C0380007C0780007FFF80007FFF800
126607C0780007C0380007C0180007C0180007C0180007C0180007C0000007C0000007C00000
126707C0000007C0000007C0000007C0000007C00000FFFF0000FFFF00001C227FA120>70
1268D<FFFE1FFFC0FFFE1FFFC007C000F80007C000F80007C000F80007C000F80007C000F800
126907C000F80007C000F80007C000F80007C000F80007C000F80007C000F80007C000F80007
1270C000F80007FFFFF80007FFFFF80007C000F80007C000F80007C000F80007C000F80007C0
127100F80007C000F80007C000F80007C000F80007C000F80007C000F80007C000F80007C000
1272F80007C000F80007C000F80007C000F800FFFE1FFFC0FFFE1FFFC022227FA125>72
1273D<FFFEFFFE07C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007
1274C007C007C007C007C007C007C007C007C007C007C007C007C007C007C0FFFEFFFE0F227F
1275A112>I<FFFE0000FFFE00000F8000000F8000000F8000000F8000000F8000000F800000
12760F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000
12770F8000000F8000000F8000000F8000000F8001800F8001800F8001800F8001800F800380
12780F8003800F8003000F8007000F8007000F800F000F803F00FFFFFF00FFFFFF0019227EA1
12791E>76 D<FFC003FFC0FFE003FFC007F0003C0007F000180006F800180006FC001800067C
1280001800063E001800063F001800061F001800060F801800060FC018000607C018000603E0
128118000603F018000601F018000600F818000600FC180006007C180006003E180006003F18
12820006001F180006000F980006000FD800060007D800060003F800060003F800060001F800
1283060000F800060000F80006000078000F00003800FFF0003800FFF000180022227FA125>
128478 D<FFFFF800FFFFFE0007C01F8007C007C007C003C007C001E007C001E007C001F007
1285C001F007C001F007C001F007C001F007C001E007C001E007C003C007C0078007C01F0007
1286FFFC0007C0000007C0000007C0000007C0000007C0000007C0000007C0000007C0000007
1287C0000007C0000007C0000007C0000007C0000007C00000FFFE0000FFFE00001C227FA121
1288>80 D<FFFFF00000FFFFFE000007C01F000007C007800007C003C00007C003E00007C001
1289F00007C001F00007C001F00007C001F00007C001F00007C001E00007C003E00007C003C0
12900007C007800007C01E000007FFF0000007C03C000007C01E000007C00F000007C00F8000
129107C007C00007C007C00007C007C00007C007C00007C007C00007C007C00007C007C00007
1292C007C00007C007C0C007C007C0C007C003C0C0FFFE01E180FFFE00F1000000003E002223
12937FA124>82 D<FFFE03FFC0FFFE03FFC007C0003C0007C000180007C000180007C0001800
129407C000180007C000180007C000180007C000180007C000180007C000180007C000180007
1295C000180007C000180007C000180007C000180007C000180007C000180007C000180007C0
129600180007C000180007C000180007C000180007C000180007C000180003C000300003E000
1297300001E000300001E000600000F000C0000078018000003E070000000FFE00000003F800
12980022237FA125>85 D<FFF83FFE07FEFFF83FFE07FE1F8003F001F80F8003E000600F8003
1299F000600FC003F000E007C003F000C007C003F000C007E006F800C003E006F8018003E006
1300F8018003E00C7C018001F00C7C030001F00C7C030001F01C7E030001F8183E070000F818
13013E060000F8183E060000FC301F0600007C301F0C00007C301F0C00007C600F8C00003E60
13020F9800003E600F9800003EE00FD800003FC007F800001FC007F000001FC007F000001F80
130303F000000F8003E000000F8003E000000F0001E00000070001C00000070001C000000700
130401C0002F237FA132>87 D<1FF000383C007C0E007C0F007C078038078000078000078000
1305FF8007C7801E07803C0780780780700780F00798F00798F00798F00F987817983C23F00F
1306C1E015157E9418>97 D<0F0000FF0000FF00001F00000F00000F00000F00000F00000F00
1307000F00000F00000F00000F00000F00000F3F000F61C00F80600F00300F00380F003C0F00
13081C0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001C0F003C0F00380F00700F80
1309600E61C00C3F0017237FA21B>I<01FE000707000C0F801C0F80380F80780700700000F0
13100000F00000F00000F00000F00000F00000F000007000007800C03800C01C01800C030007
1311060001F80012157E9416>I<0001E0001FE0001FE00003E00001E00001E00001E00001E0
13120001E00001E00001E00001E00001E00001E001F9E00707E00C03E01C01E03801E07801E0
13137001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E07001E07801E03801E01801E0
13140C03F0070DFE01F1FE17237EA21B>I<01FC000707000C03801C01C03801C07801E07000
1315E0F000E0FFFFE0F00000F00000F00000F00000F000007000007800603800601C00C00E01
13168007070000FC0013157F9416>I<003E0000E18003C3C00387C00787C00F03800F00000F
131700000F00000F00000F00000F00000F00000F0000FFF800FFF8000F00000F00000F00000F
131800000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F
131900000F0000FFF000FFF000122380A20F>I<0000F003F1180E1E381C0E38380730380700
13207807807807807807807807803807003807001C0E001E1C0033F000200000200000300000
13213800003FFE001FFFC00FFFE03801F0700070E00038E00038E00038E00038600030700070
13223800E00E038003FE0015217F9518>I<0F0000FF0000FF00001F00000F00000F00000F00
1323000F00000F00000F00000F00000F00000F00000F00000F0F800F31C00F40E00F80F00F80
1324F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00
1325F00F00F00F00F0FFF3FFFFF3FF18237FA21B>I<0E001F001F001F000E00000000000000
1326000000000000000000000F007F007F001F000F000F000F000F000F000F000F000F000F00
13270F000F000F000F000F000F00FFE0FFE00B2280A10D>I<0F00FF00FF001F000F000F000F
1328000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F
1329000F000F000F000F000F000F000F000F00FFF0FFF00C2380A20D>108
1330D<0F0FC07E00FF30E18700FF407203801F807C03C00F807C03C00F007803C00F007803C0
13310F007803C00F007803C00F007803C00F007803C00F007803C00F007803C00F007803C00F
1332007803C00F007803C00F007803C00F007803C00F007803C0FFF3FF9FFCFFF3FF9FFC2615
13337F9429>I<0F0F80FF31C0FF40E01F80F00F80F00F00F00F00F00F00F00F00F00F00F00F
133400F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F0FFF3FFFFF3FF18157F94
13351B>I<01FC000707000C01801800C03800E0700070700070F00078F00078F00078F00078
1336F00078F00078F000787000707800F03800E01C01C00E038007070001FC0015157F9418>
1337I<0F3F00FF61C0FF80600F00700F00380F003C0F003C0F001E0F001E0F001E0F001E0F00
13381E0F001E0F001E0F003C0F003C0F00380F00700F80E00F61C00F3F000F00000F00000F00
1339000F00000F00000F00000F00000F0000FFF000FFF000171F7F941B>I<01F860070CE00E
134002E01C03E03801E07801E07801E0F001E0F001E0F001E0F001E0F001E0F001E0F001E078
134101E07801E03801E01C03E00C03E0070DE001F1E00001E00001E00001E00001E00001E000
134201E00001E00001E0001FFE001FFE171F7E941A>I<0F1E00FF2300FF47801F87800F8300
13430F80000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F0000
13440F00000F0000FFF800FFF8001115809413>I<0FC8307860386018E018E018F000FC007F
1345C03FE01FF007F8007CC03CC01CC01CE01CE018F038D8708FC00E157E9413>I<06000600
134606000600060006000E000E000E001E003FFCFFFC1E001E001E001E001E001E001E001E00
13471E001E001E0C1E0C1E0C1E0C1E0C1E0C0F18071001E00E1F7F9E13>I<0F00F0FF0FF0FF
13480FF01F01F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F
134900F00F00F00F01F00F01F00702F80386FF00F8FF18157F941B>I<FFC1FEFFC1FE1F00F8
13500F00600F00600780C00780C00780C003C18003C18003E38001E30001E30000F60000F600
135100F600007C00007C00007C0000380000380017157F941A>I<FFC1FEFFC1FE1F00F80F00
1352600F00600780C00780C00780C003C18003C18003E38001E30001E30000F60000F60000F6
135300007C00007C00007C00003800003800003000003000007000006000F86000F8C000F8C0
135400F980006300003E0000171F7F941A>121 D<3FFFC03C0780380F80300F00701E00603E
135500603C0060780000F80000F00001E00003C00007C0C00780C00F00C01F01C01E01803C01
1356807C0380780780FFFF8012157F9416>I<FFFFFFFFFFFF3001808C31>124
1357D E /Ft 20 118 df<78FCFCFCFC7806067A8512>46 D<007F800001FFE0000781F8000E
1358007C0018003E0030001F0030000F8060000FC0600007C0F80007C0FC0007E0FE0007E0FE
13590003E0FE0003E0FE0003E07C0007E0000007E0000007C0000007C000000FC000000F8000
1360000F8000001F0000003E0000003C00000078000000F8000000F0000001E0000003C00000
1361070000000E0000001C000000180000003000000060000000C00060018000600380006007
13620000C00E0000C00C0000C0180001C03FFFFFC07FFFFF80FFFFFF80FFFFFF801B2F7DAE21
1363>50 D<FFFFC00000FFFFC0000007F000000003E000000003E000000003E000000003E000
1364000003E000000003E000000003E000000003E000000003E000000003E000000003E00000
13650003E000000003E000000003E000000003E000000003E000000003E000000003E0000000
136603E000000003E000000003E000000003E000000003E000000003E000000003E000000003
1367E000000003E000000003E000000003E000006003E000006003E000006003E000006003E0
13680000C003E00000C003E00000C003E00000C003E00001C003E00001C003E00003C003E000
136903C003E00007C003E0000F8003E0003F8007E000FF80FFFFFFFF80FFFFFFFF8023317DB0
137029>76 D<FFF00000007FF8FFF8000000FFF807F8000000FF0003F8000000FE00037C0000
137101BE00037C000001BE00037C000001BE00033E0000033E00033E0000033E00033E000003
13723E00031F0000063E00031F0000063E00031F0000063E00030F80000C3E00030F80000C3E
137300030F80000C3E000307C000183E000307C000183E000307C000183E000303E000303E00
13740303E000303E000303E000303E000301F000603E000301F000603E000301F000C03E0003
137500F800C03E000300F800C03E0003007C01803E0003007C01803E0003007C01803E000300
13763E03003E0003003E03003E0003003E03003E0003001F06003E0003001F06003E0003001F
137706003E0003000F8C003E0003000F8C003E0003000F8C003E00030007D8003E00030007D8
1378003E00030007D8003E00030003F0003E00030003F0003E00030003F0003E00078001E000
13793E000FC001E0007F00FFFC01E00FFFF8FFFC00C00FFFF835317CB03D>I<FFFFFFE000FF
1380FFFFFC0007E0007F0003E0000F8003E00007C003E00003E003E00001F003E00001F803E0
13810000F803E00000F803E00000FC03E00000FC03E00000FC03E00000FC03E00000FC03E000
138200FC03E00000F803E00000F803E00001F803E00001F003E00003E003E00007C003E0000F
13838003E0007F0003FFFFFC0003FFFFE00003E000000003E000000003E000000003E0000000
138403E000000003E000000003E000000003E000000003E000000003E000000003E000000003
1385E000000003E000000003E000000003E000000003E000000003E000000003E000000003E0
138600000003E000000007F0000000FFFF800000FFFF80000026317DB02D>80
1387D<FFFFFF000000FFFFFFF0000007E001FC000003E0003F000003E0000F800003E00007C0
13880003E00003E00003E00003F00003E00003F00003E00001F00003E00001F80003E00001F8
13890003E00001F80003E00001F80003E00001F80003E00001F00003E00003F00003E00003F0
13900003E00003E00003E00007C00003E0000F800003E0003F000003E001FC000003FFFFF000
13910003FFFFC0000003E001F0000003E0007C000003E0003E000003E0001F000003E0000F00
13920003E0000F800003E00007800003E00007C00003E00007C00003E00007C00003E00007C0
13930003E00007C00003E00007E00003E00007E00003E00007E00003E00007E00003E00007E0
13940003E00007E01803E00007F01803E00003F01803E00003F01807F00001F830FFFF8000F8
139570FFFF80007FE0000000000F802D327CB031>82 D<03FE00000FFFC0001E03E0003F00F0
1396003F0078003F003C001E001C000C001E0000001E0000001E0000001E0000001E000001FE
139700003FFE0001FF1E0007F01E000F801E001F001E003E001E007C001E007C001E00F8001E
13980CF8001E0CF8001E0CF8003E0CF8003E0C7C007E0C3E00DF1C1F038FB80FFF07F003F803
1399C01E1F7D9E21>97 D<001FF00000FFFC0001F01E0007C03F000F003F000F003F001E001E
1400003C000C003C0000007C00000078000000F8000000F8000000F8000000F8000000F80000
140100F8000000F8000000F8000000F80000007C0000007C0000003C0000003E0001801E0001
1402800F0003000F80070007C00E0001F81C0000FFF000001FC000191F7E9E1D>99
1403D<003F800000FFE00003E0F80007803C000F001E001E001E001E000F003C000F007C000F
1404007C000F8078000780F8000780FFFFFF80FFFFFF80F8000000F8000000F8000000F80000
140500F8000000F8000000780000007C0000003C0000003C0001801E0001800F0003000F8006
14060007C00E0001F0380000FFF000001FC000191F7E9E1D>101 D<0003F0000FF8003C3C00
1407787E00F07E01E07E01E03C01C01803C00003C00003C00003C00003C00003C00003C00003
1408C00003C00003C00003C000FFFFC0FFFFC003C00003C00003C00003C00003C00003C00003
1409C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003
1410C00003C00003C00003C00003C00003C00003C00003C00007E0007FFF007FFF0017327FB1
141114>I<000000F0007F03F801FFCF1C03C1FC3C0780F83C0F0078181F007C001E003C003E
1412003E003E003E003E003E003E003E003E003E003E003E003E003E001E003C001F007C000F
14130078000780F0000FC1E0000DFFC0001C7F000018000000180000001C0000001C0000001E
14140000000FFFF8000FFFFF0007FFFF800FFFFFC01E0007E0380001F07000007070000078E0
1415000038E0000038E0000038E0000038E000003870000070780000F03C0001E01E0003C007
1416C01F0001FFFC00003FE0001E2F7E9F21>I<0780000000FF80000000FF800000000F8000
1417000007800000000780000000078000000007800000000780000000078000000007800000
1418000780000000078000000007800000000780000000078000000007800000000780000000
141907800000000781FE00000787FF8000078E07C000079803E00007B001E00007E000F00007
1420C000F00007C000F00007C000F000078000F000078000F000078000F000078000F0000780
142100F000078000F000078000F000078000F000078000F000078000F000078000F000078000
1422F000078000F000078000F000078000F000078000F000078000F000078000F000078000F0
1423000FC001F800FFFC1FFF80FFFC1FFF8021327EB125>I<0F001F801F801F801F800F0000
142400000000000000000000000000000000000000000007807F807F800F8007800780078007
1425800780078007800780078007800780078007800780078007800780078007800780078007
142680078007800FC0FFF8FFF80D307EAF12>I<0780FF80FF800F8007800780078007800780
1427078007800780078007800780078007800780078007800780078007800780078007800780
1428078007800780078007800780078007800780078007800780078007800780078007800780
1429078007800FC0FFFCFFFC0E327EB112>108 D<0781FE003FC000FF87FF80FFF000FF8E07
1430C1C0F8000F9803E3007C0007B001E6003C0007E000FC001E0007C000F8001E0007C000F8
1431001E0007C000F8001E00078000F0001E00078000F0001E00078000F0001E00078000F000
14321E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E
143300078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00
1434078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E000F
1435C001F8003F00FFFC1FFF83FFF0FFFC1FFF83FFF0341F7E9E38>I<0781FE0000FF87FF80
143600FF8E07C0000F9803E00007B001E00007E000F00007C000F00007C000F00007C000F000
1437078000F000078000F000078000F000078000F000078000F000078000F000078000F00007
14388000F000078000F000078000F000078000F000078000F000078000F000078000F0000780
143900F000078000F000078000F000078000F000078000F0000FC001F800FFFC1FFF80FFFC1F
1440FF80211F7E9E25>I<001FC00000FFF80001E03C0007800F000F0007801E0003C01E0003
1441C03C0001E03C0001E0780000F0780000F0780000F0F80000F8F80000F8F80000F8F80000
1442F8F80000F8F80000F8F80000F8F80000F8780000F07C0001F03C0001E03C0001E01E0003
1443C01E0003C00F00078007C01F0001F07C0000FFF800001FC0001D1F7E9E21>I<0783E0FF
14448FF8FF9C7C0FB87C07F07C07E03807E00007C00007C00007C00007800007800007800007
1445800007800007800007800007800007800007800007800007800007800007800007800007
144680000780000780000FC000FFFE00FFFE00161F7E9E19>114 D<00C00000C00000C00000
1447C00000C00001C00001C00001C00003C00003C00007C0000FC0001FC000FFFFE0FFFFE003
1448C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003
1449C00003C00003C00003C00003C03003C03003C03003C03003C03003C03003C03003C03001
1450E06001E06000F0C0007F80001F00142C7FAB19>116 D<078000F000FF801FF000FF801F
1451F0000F8001F000078000F000078000F000078000F000078000F000078000F000078000F0
145200078000F000078000F000078000F000078000F000078000F000078000F000078000F000
1453078000F000078000F000078000F000078000F000078000F000078000F000078001F00007
14548001F000078003F000038007F00003C00EF00001F03CF80000FFF0FF80003FC0FF80211F
14557E9E25>I E end
1456%%EndProlog
1457%%BeginSetup
1458%%Feature: *Resolution 300dpi
1459TeXDict begin
1460
1461%%EndSetup
1462%%Page: 1 1
14631 0 bop 108 381 a Ft(Reference)22 b(Man)n(ual)f(of)g(the)h(Programming)
1464f(Language)g(Lua)g(2.2)99 508 y Fs(Rob)q(erto)c(Ierusalimsc)o(h)o(y)49
1465b(Luiz)17 b(Henrique)e(de)h(Figueiredo)50 b(W)l(aldemar)17
1466b(Celes)g(Filho)563 587 y Fr(roberto,lhf,celes)o(@icad)o(.puc-)o(rio.b)
1467o(r)479 694 y Fs(Departamen)o(to)g(de)f(Inform\023)-24
1468b(atica)17 b(|)f(PUC-Rio)763 795 y(No)o(v)o(em)o(b)q(er,)e(1995)842
1469963 y Fq(Abstract)72 1039 y Fp(Lua)f(is)h(an)f(extension)i(programmi)o
1470(ng)c(language)h(designed)j(to)e(b)q(e)i(used)f(as)g(a)f
1471(con\014guration)g(language)g(for)72 1089 y(an)o(y)18
1472b(program)f(that)h(needs)i(one.)31 b(This)19 b(do)q(cumen)o(t)e
1473(describ)q(es)k(v)o(ersion)d(2.2)g(of)f(the)i(Lua)f(programming)72
14741138 y(language)d(and)g(the)h(API)g(that)g(allo)o(ws)e(in)o(teraction)i
1475(b)q(et)o(w)o(een)h(Lua)e(programs)f(and)i(its)f(host)h(C)g(program.)72
14761188 y(It)e(also)f(presen)o(ts)j(some)d(examples)g(of)g(using)h(the)h
1477(main)c(features)k(of)f(the)g(system.)881 1404 y Fq(Sum\023)-24
1478b(ario)72 1471 y Fp(Lua)15 b(\023)-20 b(e)18 b(uma)d(linguagem)f(de)j
1479(extens~)-21 b(ao)18 b(pro)r(jetada)f(para)f(ser)i(usada)f(como)e
1480(linguagem)g(de)i(con\014gura\030)-18 b(c~)d(ao)72 1521
1481y(em)12 b(qualquer)g(programa)e(que)j(precise)h(de)f(uma.)j(Este)e(do)q
1482(cumen)o(to)d(descrev)o(e)k(a)d(v)o(ers~)-21 b(ao)13
1483b(2.2)e(da)h(linguagem)72 1571 y(de)18 b(programa\030)-18
1484b(c~)d(ao)16 b(Lua)i(e)g(a)g(In)o(terface)h(de)f(Programa\030)-18
1485b(c~)d(ao)16 b(que)i(p)q(ermite)g(a)f(in)o(tera\030)-18
1486b(c~)d(ao)18 b(en)o(tre)h(programas)72 1621 y(Lua)c(e)g(o)g(programa)e
1487(C)h(hosp)q(edeiro.)22 b(O)15 b(do)q(cumen)o(to)g(tam)o(b)o(\023)-20
1488b(em)12 b(apresen)o(ta)k(alguns)e(exemplos)g(de)i(uso)f(das)72
14891671 y(principais)f(caracter)-5 b(\023)-16 b(\020sticas)15
1490b(do)f(sistema.)-42 1814 y Fo(1)67 b(In)n(tro)r(duction)-42
14911915 y Fn(Lua)18 b(is)f(an)g(extension)g(programmi)o(ng)d(language)j
1492(designed)g(to)g(supp)q(ort)g(general)g(pro)q(cedural)g(programming)-42
14931972 y(features)k(with)f(data)g(description)g(facilities.)34
1494b(It)21 b(is)f(supp)q(osed)i(to)e(b)q(e)h(used)h(as)e(a)g
1495(con\014guration)g(language)-42 2028 y(for)d(an)o(y)f(program)f(that)i
1496(needs)g(one.)26 b(Its)17 b(main)e(extensions)i(are)f(related)h(to)f
1497(ob)s(ject-orien)o(ted)g(facilities,)f(and)-42 2085 y(fallbac)o(ks,)g
1498(but)h(it)f(has)h(some)f(other)h(minor)e(con)o(tributions.)21
1499b(Lua)16 b(has)g(b)q(een)h(designed)g(and)f(implemen)o(ted)e(b)o(y)-42
15002141 y(W.)h(Celes)g(F.,)f(L.)h(H.)g(de)h(Figueiredo)e(and)h(R.)h
1501(Ierusalimsc)o(h)o(y)l(.)29 2197 y(Lua)c(is)f(implemen)o(ted)f(as)h(a)g
1502(library)l(,)g(written)g(in)h(C.)f(Being)g(an)h(extension)g(language,)f
1503(Lua)h(has)f(no)h(notion)f(of)-42 2254 y(a)h(\\main")d(program:)16
1504b(it)10 b(only)h(w)o(orks)g Fm(emb)n(e)n(dde)n(d)f Fn(in)i(a)f(host)g
1505(clien)o(t,)g(called)g(the)g Fm(emb)n(e)n(dding)f Fn(program.)17
1506b(This)11 b(host)-42 2310 y(program)i(can)j(in)o(v)o(ok)o(e)e
1507(functions)h(to)f(execute)i(a)f(piece)g(of)g(co)q(de)g(in)g(Lua,)g(can)
1508h(write)e(and)h(read)g(Lua)h(v)m(ariables,)-42 2367 y(and)f(can)e
1509(register)g(C)h(functions)f(to)h(b)q(e)g(called)g(b)o(y)f(Lua)h(co)q
1510(de.)20 b(Through)14 b(the)g(use)g(of)g(C)f(functions,)h(Lua)g(can)g(b)
1511q(e)-42 2423 y(augmen)o(ted)d(to)h(cop)q(e)g(with)f(rather)h
1512(di\013eren)o(t)f(domains,)f(th)o(us)i(creating)f(customized)g
1513(programmi)o(ng)e(languages)-42 2480 y(sharing)15 b(a)g(syn)o(tactical)
1514e(framew)o(ork.)29 2536 y(Lua)f(is)e(free)i(distribution)e(soft)o(w)o
1515(are,)g(and)h(pro)o(vided)g(as)g(usual)g(with)g(no)g(guaran)o(tees.)18
1516b(The)11 b(implemen)o(tatio)o(n)-42 2593 y(describ)q(ed)17
1517b(in)e(this)f(man)o(ual)g(is)g(a)o(v)m(ailable)g(b)o(y)h(anon)o(ymous)f
1518(ftp)h(from)922 2748 y(1)p eop
1519%%Page: 2 2
15202 1 bop 30 199 a Fl(ftp.icad.puc-rio.br:/pub/lu)o(a/lua-2)o(.2.tar.)o
1521(gz)-42 293 y Fn(or)15 b(b)o(y)g(WWW)g(\(W)l(orld)f(Wide)h(W)l(eb\))g
1522(from)30 387 y Fl(http://www.inf.puc-rio.br/~)o(roberto)o(/lua.ht)o(ml)
1523-42 530 y Fo(2)67 b(En)n(vironmen)n(t)25 b(and)e(Mo)r(dules)-42
1524632 y Fn(All)10 b(statemen)o(ts)e(in)i(Lua)h(are)f(executed)h(in)g(a)f
1525Fm(glob)n(al)h(envir)n(onment)p Fn(.)17 b(This)9 b(en)o(vironmen)o(t,)h
1526(whic)o(h)g(k)o(eeps)h(all)e(global)-42 688 y(v)m(ariables)14
1527b(and)g(functions,)f(is)g(initialized)g(at)g(the)h(b)q(eginning)g(of)f
1528(the)h(em)o(b)q(edding)f(program)f(and)i(p)q(ersists)f(un)o(til)-42
1529744 y(its)i(end.)29 801 y(The)g(global)d(en)o(vironmen)o(t)h(can)h(b)q
1530(e)h(manipulated)e(b)o(y)h(Lua)h(co)q(de)g(or)e(b)o(y)h(the)h(em)o(b)q
1531(edding)f(program,)e(whic)o(h)-42 857 y(can)k(read)f(and)g(write)g
1532(global)e(v)m(ariables)i(using)g(functions)g(in)g(the)g(library)f(that)
1533h(implemen)o(ts)d(Lua.)29 914 y(Global)g(v)m(ariables)h(do)h(not)f
1534(need)h(declaration.)k(An)o(y)c(v)m(ariable)f(is)g(assumed)g(to)g(b)q
1535(e)h(global)e(unless)i(explicitly)-42 970 y(declared)20
1536b(lo)q(cal)e(\(see)h(lo)q(cal)f(declarations,)h(Section)g(4.4.5\).)30
1537b(Before)19 b(the)g(\014rst)g(assignmen)o(t,)e(the)j(v)m(alue)f(of)g(a)
1538-42 1027 y(global)14 b(v)m(ariable)h(is)g Fk(nil)p Fn(.)29
15391083 y(The)g(unit)g(of)g(execution)h(of)e(Lua)i(is)f(called)f(a)h
1540Fm(chunk)p Fn(.)20 b(The)15 b(syn)o(tax)g(for)f(c)o(h)o(unks)i(is:)1480
15411067 y Fj(1)42 1155 y Fm(chunk)50 b Fi(!)g(f)p Fm(statement)32
1542b Fi(j)16 b Fm(function)s Fi(g)-42 1227 y Fn(A)f(c)o(h)o(unk)f(ma)o(y)e
1543(con)o(tain)h(statemen)o(ts)f(and)i(function)g(de\014nitions,)g(and)g
1544(ma)o(y)e(b)q(e)j(in)f(a)g(\014le)g(or)f(in)h(a)g(string)f(inside)-42
15451284 y(the)k(host)f(program.)22 b(When)17 b(a)g(c)o(h)o(unk)g(is)f
1546(executed,)h(\014rst)g(all)e(its)h(functions)g(and)h(statemen)o(ts)e
1547(are)h(compiled,)-42 1340 y(then)d(the)e(statemen)o(ts)f(are)i
1548(executed)g(in)g(sequen)o(tial)f(order.)18 b(All)11 b(mo)q
1549(di\014cations)f(a)i(c)o(h)o(unk)g(e\013ects)f(on)h(the)g(global)-42
15501397 y(en)o(vironmen)o(t)k(p)q(ersist)h(after)f(its)g(end.)27
1551b(Those)17 b(include)g(mo)q(di\014cations)f(to)g(global)g(v)m(ariables)
1552g(and)i(de\014nitions)-42 1453 y(of)d(new)h(functions)285
15531437 y Fj(2)303 1453 y Fn(.)-42 1596 y Fo(3)67 b(T)n(yp)r(es)-42
15541698 y Fn(Lua)14 b(is)g(a)f(dynamically)f(t)o(yp)q(ed)i(language.)k(V)l
1555(ariables)13 b(do)h(not)f(ha)o(v)o(e)g(t)o(yp)q(es;)h(only)f(v)m(alues)
1556h(do.)19 b(All)13 b(v)m(alues)h(carry)-42 1754 y(their)h(o)o(wn)g(t)o
1557(yp)q(e.)20 b(Therefore,)15 b(there)g(are)g(no)g(t)o(yp)q(e)g
1558(de\014nitions)g(in)g(the)g(language.)29 1811 y(There)20
1559b(are)f(sev)o(en)h(basic)f(t)o(yp)q(es)h(in)g(Lua:)29
1560b Fm(nil)p Fn(,)19 b Fm(numb)n(er)p Fn(,)h Fm(string)p
1561Fn(,)g Fm(function)p Fn(,)g Fm(CF)m(unction)p Fn(,)e
1562Fm(user)n(data)p Fn(,)j(and)-42 1867 y Fm(table)p Fn(.)f
1563Fm(Nil)14 b Fn(is)g(the)g(t)o(yp)q(e)h(of)f(the)h(v)m(alue)g
1564Fk(nil)p Fn(,)e(whose)h(main)f(prop)q(ert)o(y)h(is)h(to)e(b)q(e)j
1565(di\013eren)o(t)d(from)g(an)o(y)h(other)h(v)m(alue.)-42
15661924 y Fm(Numb)n(er)h Fn(represen)o(ts)f(real)f(\(\015oating)g(p)q(oin)
1567o(t\))g(n)o(um)o(b)q(ers,)h(while)f Fm(string)h Fn(has)g(the)g(usual)g
1568(meaning.)29 1980 y(F)l(unctions)20 b(are)f(considered)i(\014rst-class)
1569e(v)m(alues)h(in)g(Lua.)34 b(This)19 b(means)g(that)h(functions)f(can)h
1570(b)q(e)h(stored)-42 2037 y(in)c(v)m(ariables,)g(passed)g(as)g(argumen)o
1571(ts)f(to)g(other)h(functions)g(and)g(returned)h(as)e(results.)26
1572b(When)17 b(a)g(function)g(is)-42 2093 y(de\014ned)g(in)d(Lua,)h(its)f
1573(b)q(o)q(dy)i(is)e(compiled)f(and)i(stored)g(in)f(a)h(giv)o(en)f(v)m
1574(ariable.)19 b(Lua)c(can)g(call)f(\(and)h(manipulate\))-42
15752150 y(functions)g(written)g(in)g(Lua)g(and)h(functions)f(written)f(in)
1576h(C;)f(the)i(latter)e(ha)o(v)o(e)g(t)o(yp)q(e)i Fm(CF)m(unction)s
1577Fn(.)29 2206 y(The)i(t)o(yp)q(e)f Fm(user)n(data)h Fn(is)g(pro)o(vided)
1578f(to)g(allo)o(w)f(arbitrary)f(C)j(p)q(oin)o(ters)f(to)g(b)q(e)h(stored)
1579f(in)g(Lua)h(v)m(ariables.)26 b(It)-42 2262 y(corresp)q(onds)18
1580b(to)f Fl(void*)f Fn(and)i(has)f(no)g(pre-de\014ned)j(op)q(erations)c
1581(in)h(Lua,)h(b)q(esides)g(assignmen)o(t)d(and)j(equalit)o(y)-42
15822319 y(test.)24 b(Ho)o(w)o(ev)o(er,)16 b(b)o(y)g(using)h(fallbac)o(ks,)
1583e(the)i(programmer)c(ma)o(y)i(de\014ne)j(op)q(erations)e(for)g
1584Fm(user)n(data)h Fn(v)m(alues;)g(see)-42 2375 y(Section)f(4.7.)29
15852432 y(The)c(t)o(yp)q(e)g Fm(table)g Fn(implemen)o(ts)d(asso)q(ciativ)o
1586(e)i(arra)o(ys,)g(that)g(is,)h(arra)o(ys)e(whic)o(h)i(can)g(b)q(e)h
1587(indexed)g(not)f(only)f(with)-42 2488 y(n)o(um)o(b)q(ers,)k(but)g(with)
1588g(an)o(y)g(v)m(alue)h(\(except)f Fk(nil)p Fn(\).)20 b(Therefore,)15
1589b(this)f(t)o(yp)q(e)i(ma)o(y)e(b)q(e)i(used)g(not)f(only)g(to)f
1590(represen)o(t)p -42 2530 780 2 v 10 2557 a Fh(1)28 2573
1591y Fg(As)e(usual,)i Ff(f)p Fe(a)s Ff(g)f Fg(means)h(0)f(or)g(more)g
1592Fe(a)s Fg('s,)f([)p Fe(a)s Fg(])f(means)j(an)f(optional)j
1593Fe(a)c Fg(and)i Ff(f)p Fe(a)s Ff(g)1179 2557 y Fh(+)1217
15942573 y Fg(means)f(one)h(or)f(more)g Fe(a)s Fg('s.)10
15952603 y Fh(2)28 2619 y Fg(Actually)m(,)h(a)f(function)h(de\014nition)i
1596(is)d(an)h(assignmen)o(t)h(to)d(a)h(global)j(v)n(ariable;)e(see)f
1597(Section)i(3.)922 2748 y Fn(2)p eop
1598%%Page: 3 3
15993 2 bop -42 199 a Fn(ordinary)15 b(arra)o(ys,)e(but)i(also)f(sym)o(b)q
1600(ol)g(tables,)g(sets,)g(records,)h(etc.)20 b(T)l(o)15
1601b(represen)o(t)g(records,)f(Lua)i(uses)f(the)g(\014eld)-42
1602256 y(name)k(as)f(an)h(index.)32 b(The)19 b(language)g(supp)q(orts)g
1603(this)f(represen)o(tation)g(b)o(y)i(pro)o(viding)e Fl(a.name)g
1604Fn(as)g(syn)o(tactic)-42 312 y(sugar)i(for)f Fl(a["name"])p
1605Fn(.)33 b(T)l(ables)20 b(ma)o(y)e(also)h(carry)g(metho)q(ds.)34
1606b(Because)20 b(functions)g(are)g(\014rst)f(class)h(v)m(alues,)-42
1607369 y(table)d(\014elds)g(ma)o(y)e(con)o(tain)g(functions.)25
1608b(The)16 b(form)f Fl(t:f\(x\))h Fn(is)g(syn)o(tactic)g(sugar)g(for)g
1609Fl(t.f\(t,x\))p Fn(,)g(whic)o(h)g(calls)-42 425 y(the)g(metho)q(d)e
1610Fl(f)h Fn(from)f(the)h(table)g Fl(t)g Fn(passing)f(itself)g(as)h(the)g
1611(\014rst)g(parameter.)29 482 y(It)d(is)f(imp)q(ortan)o(t)e(to)i(notice)
1612g(that)g(tables)g(are)g(ob)s(jects,)g(and)h(not)f(v)m(alues.)19
1613b(V)l(ariables)10 b(cannot)i(con)o(tain)e(tables,)-42
1614538 y(only)15 b(references)g(to)f(them.)19 b(Assignmen)o(t,)12
1615b(parameter)h(passing)i(and)f(returns)h(alw)o(a)o(ys)e(manipulate)g
1616(references)-42 594 y(to)k(tables,)f(and)i(do)f(not)f(imply)g(an)o(y)h
1617(kind)g(of)f(cop)o(y)l(.)26 b(Moreo)o(v)o(er,)16 b(tables)g(m)o(ust)f
1618(b)q(e)j(explicitly)e(created)h(b)q(efore)-42 651 y(used;)f(see)f
1619(Section)g(4.5.7.)-42 794 y Fo(4)67 b(The)23 b(Language)-42
1620895 y Fn(This)15 b(section)g(describ)q(es)h(the)f(lexis,)f(syn)o(tax)h
1621(and)g(seman)o(tics)e(of)i(Lua.)-42 1017 y Fd(4.1)56
1622b(Lexical)19 b(Con)n(v)n(en)n(tions)-42 1103 y Fn(Lua)g(is)e(a)g(case)h
1623(sensitiv)o(e)f(language.)27 b(Iden)o(ti\014ers)18 b(can)g(b)q(e)g(an)o
1624(y)f(string)g(of)g(letters,)h(digits,)e(and)i(underscores,)-42
16251159 y(not)d(b)q(eginning)h(with)e(a)h(digit.)k(The)c(follo)o(wing)e(w)
1626o(ords)i(are)f(reserv)o(ed,)h(and)h(cannot)f(b)q(e)h(used)f(as)g(iden)o
1627(ti\014ers:)173 1253 y Fl(and)143 b(do)191 b(else)142
1628b(elseif)95 b(end)173 1309 y(function)23 b(if)191 b(local)118
1629b(nil)167 b(not)173 1366 y(or)g(repeat)95 b(return)f(until)119
1630b(then)95 b(while)29 1459 y Fn(The)15 b(follo)o(wing)e(strings)i
1631(denote)g(other)g(tok)o(ens:)173 1552 y Fl(~=)48 b(<=)f(>=)h(<)71
1632b(>)h(==)47 b(=)71 b(..)48 b(+)71 b(-)h(*)f(/)173 1609
1633y(\045)h(\()f(\))h({)f(})h([)f(])g(;)h(,)f(.)29 1702
1634y Fn(Literal)17 b(strings)f(can)i(b)q(e)g(delimited)e(b)o(y)i(matc)o
1635(hing)d(single)i(or)g(double)h(quotes,)g(and)f(can)h(con)o(tain)f(the)h
1636(C-)-42 1758 y(lik)o(e)i(escap)q(e)i(sequences)g Fl('\\n')p
1637Fn(,)f Fl('\\t')f Fn(and)h Fl('\\r')p Fn(.)36 b(Literal)20
1638b(strings)g(can)g(also)g(b)q(e)i(delimited)d(b)o(y)h(matc)o(hing)-42
16391815 y Fl([[)k(...)g(]])p Fn(.)18 b(Literals)12 b(in)h(this)f(last)g
1640(form)f(ma)o(y)h(run)h(for)f(sev)o(eral)g(lines,)h(ma)o(y)e(con)o(tain)
1641h(nested)i Fl([[)23 b(...)h(]])p Fn(,)12 b(and)-42 1871
1642y(do)k(not)e(in)o(terpret)h(escap)q(e)h(sequences.)29
16431928 y(Commen)o(ts)c(start)h(an)o(ywhere)i(outside)g(a)f(string)g(with)
1644g(a)g(double)h(h)o(yphen)h(\()p Fl(--)p Fn(\))e(and)h(run)g(un)o(til)f
1645(the)g(end)i(of)-42 1984 y(the)g(line.)29 2041 y(Numerical)h(constan)o
1646(ts)g(ma)o(y)f(b)q(e)j(written)e(with)h(an)g(optional)e(decimal)h
1647(part,)h(and)g(an)g(optional)f(decimal)-42 2097 y(exp)q(onen)o(t.)k
1648(Examples)14 b(of)g(v)m(alid)h(n)o(umerical)f(constan)o(ts)g(are:)126
16492190 y Fl(4)119 b(4.)g(.4)g(4.57e-3)f(.3e12)-42 2312
1650y Fd(4.2)56 b(Co)r(ercion)-42 2398 y Fn(Lua)19 b(pro)o(vides)f(some)f
1651(automatic)f(con)o(v)o(ersions.)29 b(An)o(y)19 b(arithmetic)d(op)q
1652(eration)i(applied)g(to)g(a)g(string)f(tries)h(to)-42
16532454 y(con)o(v)o(ert)d(that)f(string)g(to)h(a)f(n)o(um)o(b)q(er,)g
1654(follo)o(wing)f(the)i(usual)g(rules.)20 b(Con)o(v)o(ersely)l(,)14
1655b(whenev)o(er)h(a)g(n)o(um)o(b)q(er)f(is)h(used)-42 2511
1656y(when)h(a)f(string)f(is)h(exp)q(ected,)h(that)e(n)o(um)o(b)q(er)h(is)g
1657(con)o(v)o(erted)g(to)f(a)h(string,)f(according)h(to)f(the)h(follo)o
1658(wing)e(rule:)20 b(if)-42 2567 y(the)13 b(n)o(um)o(b)q(er)g(is)f(an)h
1659(in)o(teger,)f(it)g(is)g(written)g(without)g(exp)q(onen)o(t)h(or)f
1660(decimal)f(p)q(oin)o(t;)i(otherwise,)f(it)g(is)h(formatted)-42
16612623 y(follo)o(wing)g(the)j(\\)p Fl(\045g)p Fn(")e(con)o(v)o(ersion)g
1662(sp)q(eci\014cation)h(of)g(the)h(standard)e Fl(printf)h
1663Fn(C)g(function.)922 2748 y(3)p eop
1664%%Page: 4 4
16654 3 bop -42 199 a Fd(4.3)56 b(Adjustmen)n(t)-42 285 y
1666Fn(F)l(unctions)14 b(in)g(Lua)h(can)f(return)g(man)o(y)f(v)m(alues.)19
1667b(Because)c(there)f(are)g(no)g(t)o(yp)q(e)h(declarations,)d(the)i
1668(system)f(do)q(es)-42 342 y(not)18 b(kno)o(w)f(ho)o(w)g(man)o(y)f(v)m
1669(alues)i(a)g(function)f(will)g(return,)g(or)h(ho)o(w)f(man)o(y)f
1670(parameters)g(it)h(needs.)28 b(Therefore,)-42 398 y(sometimes,)10
1671b(a)i(list)g(of)g(v)m(alues)h(m)o(ust)e(b)q(e)i Fm(adjuste)n(d)5
1672b Fn(,)13 b(at)f(run)g(time,)f(to)h(a)h(giv)o(en)f(length.)18
1673b(If)13 b(there)g(are)f(more)f(v)m(alues)-42 454 y(than)17
1674b(are)f(needed,)i(the)f(last)f(v)m(alues)h(are)f(thro)o(wn)g(a)o(w)o(a)
1675o(y)l(.)23 b(If)17 b(there)g(are)f(more)g(needs)h(than)g(v)m(alues,)g
1676(the)f(list)g(is)-42 511 y(extended)j(with)e(as)h(man)o(y)e
1677Fk(nil)p Fn('s)h(as)g(needed.)29 b(Adjustmen)o(t)17 b(o)q(ccurs)h(in)f
1678(m)o(ultiple)f(assignmen)o(t)g(and)i(function)-42 567
1679y(calls.)-42 689 y Fd(4.4)56 b(Statemen)n(ts)-42 775
1680y Fn(Lua)19 b(supp)q(orts)f(an)f(almost)f(con)o(v)o(en)o(tional)g(set)i
1681(of)f(statemen)o(ts.)26 b(The)18 b(con)o(v)o(en)o(tional)e(commands)f
1682(include)k(as-)-42 831 y(signmen)o(t,)d(con)o(trol)f(structures)i(and)g
1683(pro)q(cedure)h(calls.)24 b(Non-con)o(v)o(en)o(tional)16
1684b(commands)e(include)k(table)e(con-)-42 888 y(structors,)e(explained)i
1685(in)f(Section)g(4.5.7,)e(and)i(lo)q(cal)g(v)m(ariable)f(declarations.)
1686-42 1008 y Fk(4.4.1)52 b(Blo)q(c)o(ks)-42 1094 y Fn(A)15
1687b(blo)q(c)o(k)f(is)f(a)h(list)f(of)h(statemen)o(ts,)e(executed)j
1688(sequen)o(tially)l(.)k(An)o(y)14 b(statemen)o(t)e(can)j(b)q(e)g
1689(optionally)d(follo)o(w)o(ed)h(b)o(y)-42 1150 y(a)i(semicolon.)42
16901209 y Fm(blo)n(ck)49 b Fi(!)h(f)p Fm(stat)16 b(sc)s
1691Fi(g)g Fn([)p Fm(r)n(et)f(sc)s Fn(])98 1266 y Fm(sc)49
1692b Fi(!)h Fn([';'])-42 1334 y(F)l(or)13 b(syn)o(tactic)f(reasons,)g(a)h
1693(return)g(statemen)o(t)e(can)i(only)g(b)q(e)g(written)f(as)h(the)g
1694(last)f(statemen)o(t)f(of)h(a)h(blo)q(c)o(k.)19 b(This)-42
16951391 y(restriction)14 b(also)g(a)o(v)o(oids)g(some)g(\\statemen)o(t)f
1696(not)i(reac)o(hed")g(errors.)-42 1511 y Fk(4.4.2)52 b(Assignmen)o(t)-42
16971597 y Fn(The)18 b(language)e(allo)o(ws)f(m)o(ultiple)g(assignmen)o(t.)
169823 b(Therefore,)17 b(the)g(syn)o(tax)g(de\014nes)h(a)f(list)e(of)i(v)m
1699(ariables)f(on)h(the)-42 1653 y(left)h(side,)g(and)h(a)e(list)g(of)h
1700(expressions)g(on)g(the)g(righ)o(t)f(side.)29 b(Both)18
1701b(lists)f(ha)o(v)o(e)g(their)h(elemen)o(ts)f(separated)h(b)o(y)-42
17021709 y(commas.)116 1769 y Fm(stat)50 b Fi(!)g Fm(varlist1)16
1703b Fn('=')g Fm(explist1)42 1825 y(varlist1)50 b Fi(!)g
1704Fm(var)17 b Fi(f)p Fn(',')d Fm(var)5 b Fi(g)-42 1894
1705y Fn(This)15 b(statemen)o(t)d(\014rst)i(ev)m(aluates)g(all)g(v)m(alues)
1706g(on)h(the)f(righ)o(t)g(side)g(and)h(ev)o(en)o(tual)f(indices)g(on)h
1707(the)f(left)g(side,)g(and)-42 1950 y(then)i(mak)o(es)e(the)h(assignmen)
1708o(ts.)j(Therefore,)c(it)h(can)g(b)q(e)h(used)g(to)e(exc)o(hange)i(t)o
1709(w)o(o)e(v)m(alues,)h(as)f(in)30 2044 y Fl(x,)24 b(y)f(=)h(y,)g(x)-42
17102138 y Fn(Before)f(the)g(assignmen)o(t,)f(the)g(list)f(of)i(v)m(alues)f
1711(is)g Fm(adjuste)n(d)h Fn(to)f(the)h(length)f(of)g(the)h(list)e(of)h(v)
1712m(ariables;)j(see)-42 2194 y(Section)16 b(4.3.)42 2266
1713y Fm(var)50 b Fi(!)g Fm(name)-42 2338 y Fn(A)16 b(single)e(name)g(can)i
1714(denote)f(a)g(global)f(or)h(a)g(lo)q(cal)f(v)m(ariable,)g(or)h(a)g
1715(formal)d(parameter.)42 2410 y Fm(var)50 b Fi(!)g Fm(var)17
1716b Fn('[')e Fm(exp1)i Fn(']')-42 2483 y(Square)j(brac)o(k)o(ets)f(are)h
1717(used)g(to)f(index)h(a)f(table.)33 b(If)20 b Fl(var)f
1718Fn(results)g(in)g(a)h(table)f(v)m(alue,)h(the)g(\014eld)g(indexed)h(b)o
1719(y)-42 2539 y(the)c(expression)f(v)m(alue)h(gets)f(the)h(assigned)f(v)m
1720(alue.)24 b(Otherwise,)16 b(the)h(fallbac)o(k)e Fm(settable)h
1721Fn(is)g(called,)g(with)f(three)922 2748 y(4)p eop
1722%%Page: 5 5
17235 4 bop -42 199 a Fn(parameters:)31 b(the)22 b(v)m(alue)f(of)g
1724Fl(var)p Fn(,)h(the)g(v)m(alue)g(of)f(expression,)h(and)g(the)f(v)m
1725(alue)h(b)q(eing)g(assigned)f(to)g(it;)i(see)-42 256
1726y(Section)16 b(4.7.)42 328 y Fm(var)50 b Fi(!)g Fm(var)17
1727b Fn('.')j Fm(name)-42 400 y Fn(The)c(syn)o(tax)e Fl(var.NAME)g
1728Fn(is)h(just)g(syn)o(tactic)f(sugar)h(for)f Fl(var["NAME"])p
1729Fn(.)-42 520 y Fk(4.4.3)52 b(Con)o(trol)17 b(Structures)-42
1730606 y Fn(The)k(condition)e(expression)h(of)f(a)h(con)o(trol)e
1731(structure)i(can)g(return)g(an)o(y)g(v)m(alue.)34 b(All)19
1732b(v)m(alues)h(di\013eren)o(t)f(from)-42 662 y Fk(nil)f
1733Fn(are)g(considered)g(true,)h(while)f Fk(nil)f Fn(is)h(considered)h
1734(false.)28 b Fl(if)p Fn('s,)18 b Fl(while)p Fn('s)f(and)h
1735Fl(repeat)p Fn('s)f(ha)o(v)o(e)h(the)h(usual)-42 719
1736y(meaning.)70 787 y Fm(stat)50 b Fi(!)g Fk(while)15 b
1737Fm(exp1)i Fk(do)f Fm(blo)n(ck)g Fk(end)245 843 y Fi(j)32
1738b Fk(rep)q(eat)17 b Fm(blo)n(ck)f Fk(un)o(til)f Fm(exp1)245
1739900 y Fi(j)32 b Fk(if)16 b Fm(exp1)h Fk(then)g Fm(blo)n(ck)e
1740Fi(f)p Fm(elseif)8 b Fi(g)16 b Fn([)p Fk(else)f Fm(blo)n(ck)5
1741b Fn(])15 b Fk(end)42 956 y Fm(elseif)49 b Fi(!)h Fk(elseif)15
1742b Fm(exp1)i Fk(then)f Fm(blo)n(ck)29 1049 y Fn(A)g Fl(return)g
1743Fn(is)g(used)g(to)g(return)g(v)m(alues)h(from)d(a)i(function.)23
1744b(Because)17 b(a)f(function)g(ma)o(y)f(return)h(more)f(than)-42
17451106 y(one)h(v)m(alue,)f(the)g(syn)o(tax)g(for)f(a)h(return)g(statemen)
1746o(t)e(is:)42 1178 y Fm(r)n(et)50 b Fi(!)g Fk(return)16
1747b Fm(explist)-42 1370 y Fk(4.4.4)52 b(Expressions)16
1748b(as)h(Statemen)o(ts)-42 1456 y Fn(All)h(expressions)h(with)f(p)q
1749(ossible)g(side-e\013ects)h(can)f(b)q(e)i(executed)f(as)g(statemen)o
1750(ts.)28 b(These)19 b(include)g(function)-42 1512 y(calls)c(and)g(table)
1751g(constructors:)42 1572 y Fm(stat)50 b Fi(!)g Fm(functionc)n(al)r(l)42
17521628 y(stat)g Fi(!)g Fm(table)n(c)n(onstructor)-42 1697
1753y Fn(Ev)o(en)o(tual)14 b(returned)h(v)m(alues)g(are)g(thro)o(wn)f(a)o
1754(w)o(a)o(y)l(.)k(F)l(unction)c(calls)g(are)h(explained)f(in)h(Section)f
1755(4.5.8;)f(construc-)-42 1753 y(tors)i(are)g(the)g(sub)s(ject)g(of)g
1756(Section)g(4.5.7.)-42 1873 y Fk(4.4.5)52 b(Lo)q(cal)19
1757b(Declarations)-42 1959 y Fn(Lo)q(cal)e(v)m(ariables)e(can)h(b)q(e)h
1758(declared)f(an)o(ywhere)g(inside)g(a)g(blo)q(c)o(k.)22
1759b(Their)16 b(scop)q(e)h(b)q(egins)f(after)f(the)i(declaration)-42
17602015 y(and)f(lasts)e(un)o(til)g(the)i(end)f(of)g(the)g(blo)q(c)o(k.)20
1761b(The)15 b(declaration)f(ma)o(y)g(include)i(an)f(initial)e(assignmen)o
1762(t:)92 2083 y Fm(stat)50 b Fi(!)g Fk(lo)q(cal)17 b Fm(de)n(clist)e
1763Fn([)p Fm(init)t Fn(])42 2140 y Fm(de)n(clist)49 b Fi(!)h
1764Fm(name)16 b Fi(f)p Fn(',')f Fm(name)s Fi(g)96 2196 y
1765Fm(init)49 b Fi(!)h Fn('=')16 b Fm(explist1)-42 2265
1766y Fn(If)f(there)f(is)f(an)h(initial)e(assignmen)o(t,)g(it)h(has)h(the)g
1767(same)f(seman)o(tics)f(of)h(a)h(m)o(ultiple)e(assignmen)o(t.)17
1768b(Otherwise,)d(all)-42 2321 y(v)m(ariables)h(are)g(initialized)e(with)i
1769Fk(nil)p Fn(.)-42 2443 y Fd(4.5)56 b(Expressions)-42
17702529 y Fk(4.5.1)c(Simple)15 b(Expressions)-42 2614 y
1771Fn(Simple)f(expressions)h(are:)922 2748 y(5)p eop
1772%%Page: 6 6
17736 5 bop 42 193 a Fm(exp)50 b Fi(!)g Fn('\(')16 b Fm(exp)g
1774Fn('\)')42 250 y Fm(exp)50 b Fi(!)g Fk(nil)42 306 y Fm(exp)g
1775Fi(!)g Fn('n)o(um)o(b)q(er')42 362 y Fm(exp)g Fi(!)g
1776Fn('literal')42 419 y Fm(exp)g Fi(!)g Fm(var)-42 490
1777y Fn(Num)o(b)q(ers)22 b(\(n)o(umerical)f(constan)o(ts\))g(and)i(string)
1778f(literals)f(are)h(explained)h(in)f(Section)h(4.1.)41
1779b(V)l(ariables)22 b(are)-42 546 y(explained)16 b(in)f(Section)g(4.4.2.)
1780-42 665 y Fk(4.5.2)52 b(Arithmetic)15 b(Op)q(erators)-42
1781751 y Fn(Lua)21 b(supp)q(orts)g(the)g(usual)f(arithmetic)e(op)q
1782(erators.)35 b(These)21 b(op)q(erators)f(are)g(the)g(binary)h
1783Fl(+)p Fn(,)g Fl(-)p Fn(,)g Fl(*)p Fn(,)h Fl(/)e Fn(and)h
1784Fl(^)-42 808 y Fn(\(exp)q(onen)o(tiation\),)15 b(and)h(the)g(unary)g
1785Fl(-)p Fn(.)22 b(If)16 b(the)g(op)q(erands)g(are)g(n)o(um)o(b)q(ers,)f
1786(or)g(strings)g(that)g(can)h(b)q(e)h(con)o(v)o(erted)-42
1787864 y(to)d(n)o(um)o(b)q(ers,)g(according)g(to)g(the)g(rules)g(giv)o(en)
1788g(in)h(Section)f(4.2,)f(all)h(op)q(erations)f(but)i(exp)q(onen)o
1789(tiation)e(ha)o(v)o(e)h(the)-42 920 y(usual)f(meaning.)18
1790b(Otherwise,)13 b(the)g(fallbac)o(k)f(\\arith")g(is)g(called;)h(see)g
1791(Section)g(4.7.)19 b(An)13 b(exp)q(onen)o(tiation)f(alw)o(a)o(ys)-42
1792977 y(calls)k(this)f(fallbac)o(k.)22 b(The)16 b(standard)g
1793(mathematical)c(library)j(rede\014nes)j(this)d(fallbac)o(k,)g(giving)g
1794(the)h(exp)q(ected)-42 1033 y(meaning)e(to)h(exp)q(onen)o(tiation;)f
1795(see)h(Section)g(6.3.)-42 1152 y Fk(4.5.3)52 b(Relational)18
1796b(Op)q(erators)-42 1238 y Fn(Lua)e(o\013ers)e(the)i(follo)o(wing)d
1797(relational)g(op)q(erators:)126 1327 y Fl(<)71 b(>)g(<=)48
1798b(>=)f(~=)h(==)-42 1415 y Fn(All)15 b(return)g Fk(nil)f
1799Fn(as)h(false)g(and)g(1)g(as)g(true.)29 1472 y(Equalit)o(y)g(\014rst)h
1800(compares)f(the)i(t)o(yp)q(es)f(of)h(its)e(op)q(erands.)24
1801b(If)17 b(they)g(are)f(di\013eren)o(t,)g(the)g(result)g(is)g
1802Fk(nil)p Fn(.)23 b(Oth-)-42 1528 y(erwise,)18 b(their)f(v)m(alues)h
1803(are)g(compared.)26 b(Num)o(b)q(ers)17 b(and)h(strings)f(are)h
1804(compared)e(in)i(the)g(usual)f(w)o(a)o(y)l(.)27 b(T)l(ables,)-42
18051585 y(CF)l(unctions,)14 b(and)g(functions)g(are)g(compared)f(b)o(y)h
1806(reference,)h(that)e(is,)h(t)o(w)o(o)e(tables)i(are)g(considered)g
1807(equal)g(only)-42 1641 y(if)h(they)g(are)g(the)h(same)d(table.)20
1808b(The)15 b(op)q(erator)g Fl(~=)f Fn(is)h(exactly)g(the)g(negation)f(of)
1809h(equalit)o(y)f(\()p Fl(=)p Fn(\).)29 1698 y(The)19 b(other)g(op)q
1810(erators)f(w)o(ork)g(as)g(follo)o(ws.)29 b(If)19 b(b)q(oth)g(argumen)o
1811(ts)e(are)i(n)o(um)o(b)q(ers,)f(they)h(are)g(compared)f(as)-42
18121754 y(suc)o(h.)27 b(Otherwise,)17 b(if)g(b)q(oth)g(argumen)o(ts)f(can)
1813h(b)q(e)h(con)o(v)o(erted)f(to)g(strings,)f(their)h(v)m(alues)g(are)g
1814(compared)g(using)-42 1811 y(lexicographical)d(order.)20
1815b(Otherwise,)14 b(the)i(fallbac)o(k)d(\\order")i(is)g(called;)f(see)h
1816(Section)h(4.7.)-42 1930 y Fk(4.5.4)52 b(Logical)18 b(Op)q(erators)-42
18172016 y Fn(All)f(logical)f(op)q(erators,)g(lik)o(e)h(con)o(trol)f
1818(structures,)h(consider)g Fk(nil)g Fn(as)g(false)g(and)g(an)o(ything)g
1819(else)g(as)g(true.)26 b(The)-42 2072 y(logical)14 b(op)q(erators)g
1820(are:)269 2161 y Fl(and)71 b(or)g(not)-42 2249 y Fn(The)17
1821b(op)q(erators)f Fl(and)g Fn(and)h Fl(or)f Fn(use)h(short-cut)f(ev)m
1822(aluation,)g(that)g(is,)g(the)h(second)g(op)q(erand)g(is)f(ev)m
1823(aluated)h(only)-42 2306 y(if)e(necessary)l(.)-42 2425
1824y Fk(4.5.5)52 b(Concatenation)-42 2511 y Fn(Lua)18 b(o\013ers)d(a)i
1825(string)f(concatenation)g(op)q(erator,)f(denoted)j(b)o(y)e(\\)p
1826Fl(..)p Fn(".)24 b(If)17 b(op)q(erands)g(are)g(strings)e(or)i(n)o(um)o
1827(b)q(ers,)-42 2567 y(they)c(are)g(con)o(v)o(erted)f(to)g(strings)g
1828(according)g(to)g(the)h(rules)f(in)h(Section)f(4.2.)18
1829b(Otherwise,)13 b(the)g(fallbac)o(k)e(\\concat")-42 2623
1830y(is)k(called;)g(see)g(Section)g(4.7.)922 2748 y(6)p
1831eop
1832%%Page: 7 7
18337 6 bop -42 199 a Fk(4.5.6)52 b(Precedence)-42 285 y
1834Fn(Op)q(erator)15 b(precedence)i(follo)o(ws)d(the)h(table)g(b)q(elo)o
1835(w,)f(from)f(the)j(lo)o(w)o(er)d(to)i(the)g(higher)g(priorit)o(y:)269
1836379 y Fl(and)71 b(or)269 435 y(<)g(>)h(<=)47 b(>=)h(~=)f(=)269
1837492 y(..)269 548 y(+)71 b(-)269 605 y(*)g(/)269 661 y(not)47
1838b(-)24 b(\(unary\))269 718 y(^)-42 811 y Fn(All)15 b(binary)g(op)q
1839(erators)f(are)h(left)f(asso)q(ciativ)o(e,)g(except)h(for)g
1840Fl(^)p Fn(,)g(whic)o(h)g(is)f(righ)o(t)g(asso)q(ciativ)o(e.)-42
1841931 y Fk(4.5.7)52 b(T)l(able)18 b(Constructors)-42 1017
1842y Fn(T)l(able)d(constructors)f(are)h(expressions)g(that)f(create)h
1843(tables;)f(ev)o(ery)h(time)e(a)i(constructor)f(is)h(ev)m(aluated,)g(a)f
1844(new)-42 1074 y(table)f(is)g(created.)19 b(Constructors)12
1845b(can)h(b)q(e)h(used)g(to)e(create)h(empt)o(y)f(tables,)g(or)h(to)g
1846(create)g(a)f(table)h(and)g(initialize)-42 1130 y(some)h(\014elds.)29
18471187 y(The)h(general)g(syn)o(tax)g(for)f(constructors)h(is:)42
18481255 y Fm(table)n(c)n(onstructor)49 b Fi(!)i Fn(')p Fi(f)p
1849Fn(')15 b Fm(\014eld)r(list)g Fn(')p Fi(g)p Fn(')212
18501311 y Fm(\014eld)r(list)48 b Fi(!)j Fm(l\014eld)r(list)31
1851b Fi(j)16 b Fm(\016eld)r(list)31 b Fi(j)16 b Fm(l\014eld)r(list)f
1852Fn(';')g Fm(\016eld)r(list)200 1368 y(l\014eld)r(list)48
1853b Fi(!)j Fn([)p Fm(l\014eld)r(list1)6 b Fn(])197 1424
1854y Fm(\016eld)r(list)49 b Fi(!)i Fn([)p Fm(\016eld)r(list1)6
1855b Fn(])29 1517 y(The)15 b(form)f Fm(l\014eld)r(list1)g
1856Fn(is)h(used)g(to)g(initialize)e(lists.)42 1589 y Fm(l\014eld)r(list1)
185749 b Fi(!)h Fm(exp)16 b Fi(f)p Fn(',')f Fm(exp)s Fi(g)h
1858Fn([','])-42 1662 y(The)i(expressions)f(in)g(the)g(list)f(are)h
1859(assigned)g(to)g(consecutiv)o(e)g(n)o(umerical)f(indexes,)h(starting)f
1860(with)h(1.)25 b(As)18 b(an)-42 1718 y(example:)30 1812
1861y Fl(a)24 b(=)g({"v1",)f("v2",)g(34})-42 1906 y Fn(is)15
1862b(equiv)m(alen)o(t)g(to:)30 2000 y Fl(temp)23 b(=)h({})30
18632056 y(temp[1])f(=)h("v1")30 2112 y(temp[2])f(=)h("v2")30
18642169 y(temp[3])f(=)h(34)30 2225 y(a)g(=)g(temp)29 2319
1865y Fn(The)15 b(next)h(form)d(initializes)g(named)i(\014elds)g(in)g(a)g
1866(table.)42 2378 y Fm(\016eld)r(list1)50 b Fi(!)g Fm(\016eld)16
1867b Fi(f)p Fn(',')f Fm(\016eld)5 b Fi(g)15 b Fn([','])127
18682435 y Fm(\016eld)50 b Fi(!)g Fm(name)16 b Fn('=')g Fm(exp)-42
18692503 y Fn(As)g(an)f(example:)30 2597 y Fl(a)24 b(=)g({x)f(=)h(1,)f(y)h
1870(=)g(3})922 2748 y Fn(7)p eop
1871%%Page: 8 8
18728 7 bop -42 199 a Fn(is)15 b(equiv)m(alen)o(t)g(to:)30
1873293 y Fl(temp)23 b(=)h({})30 350 y(temp.x)f(=)h(1)30
1874406 y(temp.y)f(=)h(3)30 462 y(a)g(=)g(temp)-42 582 y
1875Fk(4.5.8)52 b(F)l(unction)18 b(Calls)-42 668 y Fn(A)e(function)f(call)f
1876(has)h(the)g(follo)o(wing)e(syn)o(tax:)42 740 y Fm(functionc)n(al)r(l)
187749 b Fi(!)h Fm(var)17 b(r)n(e)n(alPar)n(ams)-42 813 y
1878Fn(Here,)i Fl(var)e Fn(can)h(b)q(e)h(an)o(y)e(v)m(ariable)h(\(global,)e
1879(lo)q(cal,)i(indexed,)g(etc\).)28 b(If)18 b(its)f(t)o(yp)q(e)h(is)g
1880Fm(function)j Fn(or)c Fm(CF)m(unction)s Fn(,)-42 869
1881y(this)g(function)g(is)f(called.)25 b(Otherwise,)17 b(the)g(fallbac)o
1882(k)f(\\function")g(is)h(called,)g(ha)o(ving)f(as)g(\014rst)h(parameter)
1883e(the)-42 925 y(v)m(alue)h(of)f Fl(var)p Fn(,)f(and)h(then)h(the)f
1884(original)f(call)g(parameters.)29 982 y(The)h(form:)42
18851054 y Fm(functionc)n(al)r(l)49 b Fi(!)h Fm(var)17 b
1886Fn(':')j Fm(name)c(r)n(e)n(alPar)n(ams)-42 1126 y Fn(can)g(b)q(e)g
1887(used)f(to)g(call)f(\\metho)q(ds".)19 b(A)c(call)f Fl(var:name\(...\))g
1888Fn(is)g(syn)o(tactic)h(sugar)f(for)6 1220 y Fl(var.name\(var,)22
1889b(...\))-42 1314 y Fn(except)16 b(that)f Fl(var)f Fn(is)h(ev)m(aluated)
1890g(only)g(once.)42 1382 y Fm(r)n(e)n(alPar)n(ams)49 b
1891Fi(!)h Fn('\(')16 b([)p Fm(explist1)6 b Fn(])15 b('\)')42
18921438 y Fm(r)n(e)n(alPar)n(ams)49 b Fi(!)h Fm(table)n(c)n(onstructor)115
18931495 y(explist1)f Fi(!)h Fm(exp1)17 b Fi(f)p Fn(',')e
1894Fm(exp1)6 b Fi(g)-42 1563 y Fn(All)18 b(argumen)o(t)e(expressions)i
1895(are)g(ev)m(aluated)g(b)q(efore)g(the)h(call;)f(then)g(the)g(list)f(of)
1896h(argumen)o(ts)e(is)i(adjusted)g(to)-42 1620 y(the)j(length)f(of)f(the)
1897h(list)f(of)h(parameters)e(\(see)j(Section)f(4.3\);)h(\014nally)l(,)f
1898(this)g(list)f(is)g(assigned)h(to)g(the)g(formal)-42
18991676 y(parameters.)g(A)15 b(call)g(of)g(the)h(form)e
1900Fl(f{...})h Fn(is)g(syn)o(tactic)f(sugar)h(for)g Fl(f\({...}\))p
1901Fn(,)f(that)h(is,)g(the)h(parameter)e(list)-42 1732 y(is)h(a)g(single)g
1902(new)g(table.)29 1789 y(Because)h(a)f(function)h(can)g(return)f(an)o(y)
1903g(n)o(um)o(b)q(er)g(of)g(results)g(\(see)h(Section)f(4.4.3\),)e(the)j
1904(n)o(um)o(b)q(er)f(of)g(results)-42 1845 y(m)o(ust)c(b)q(e)i(adjusted)f
1905(b)q(efore)h(used.)19 b(If)13 b(the)f(function)g(is)g(called)f(as)h(an)
1906g(statemen)o(t)e(\(see)j(Section)f(4.4.4\),)e(its)h(return)-42
19071902 y(list)18 b(is)h(adjusted)g(to)g(0.)31 b(If)20 b(the)f(function)g
1908(is)g(called)g(in)g(a)g(place)g(that)f(needs)i(a)f(single)f(v)m(alue)i
1909(\(syn)o(tactically)-42 1958 y(denoted)f(b)o(y)f(the)g(non-terminal)e
1910Fl(exp1)p Fn(\),)h(its)g(return)h(list)f(is)g(adjusted)h(to)g(1.)27
1911b(If)18 b(the)g(function)g(is)g(called)f(in)h(a)-42 2015
1912y(place)f(that)g(can)g(hold)g(man)o(y)e(v)m(alues)i(\(syn)o(tactically)
1913e(denoted)j(b)o(y)f(the)g(non-terminal)e Fl(exp)p Fn(\),)h(no)h
1914(adjustmen)o(t)-42 2071 y(is)e(done.)-42 2193 y Fd(4.6)56
1915b(F)-5 b(unction)20 b(De\014nitions)-42 2279 y Fn(F)l(unctions)15
1916b(in)f(Lua)g(can)h(b)q(e)g(de\014ned)h(an)o(ywhere)e(in)g(the)g(global)
1917f(lev)o(el)h(of)g(a)g(mo)q(dule.)19 b(The)14 b(syn)o(tax)g(for)g
1918(function)-42 2335 y(de\014nition)i(is:)42 2407 y Fm(function)50
1919b Fi(!)g Fk(function)16 b Fm(var)h Fn('\(')e([)p Fm(p)n(arlist1)6
1920b Fn(])16 b('\)')f Fm(blo)n(ck)g Fk(end)29 2536 y Fn(When)f(Lua)g
1921(pre-compiles)f(a)g(c)o(h)o(unk,)h(all)f(its)f(function)i(b)q(o)q(dies)
1922g(are)f(pre-compiled,)g(to)q(o.)19 b(Then,)14 b(when)g(Lua)-42
19232592 y(\\executes")i(the)f(function)g(de\014nition,)g(its)f(b)q(o)q(dy)
1924i(is)f(stored,)f(with)h(t)o(yp)q(e)g Fm(function)p Fn(,)f(in)o(to)g
1925(the)i(v)m(ariable)e Fl(var)p Fn(.)922 2748 y(8)p eop
1926%%Page: 9 9
19279 8 bop 29 199 a Fn(P)o(arameters)13 b(act)i(as)f(lo)q(cal)h(v)m
1928(ariables,)f(initialized)f(with)i(the)g(argumen)o(t)f(v)m(alues.)42
1929271 y Fm(p)n(arlist1)50 b Fi(!)g Fm('name')16 b Fi(f)p
1930Fn(',')f Fm(name)s Fi(g)29 400 y Fn(Results)g(are)f(returned)h(using)f
1931(the)h Fl(return)f Fn(statemen)o(t)e(\(see)j(Section)f(4.4.3\).)k(If)d
1932(con)o(trol)e(reac)o(hes)i(the)g(end)-42 456 y(of)g(a)g(function)g
1933(without)f(a)h(return)g(instruction,)f(the)h(function)g(returns)h(with)
1934e(no)h(results.)29 513 y(There)22 b(is)f(a)g(sp)q(ecial)g(syn)o(tax)g
1935(for)g(de\014nition)h(of)f(metho)q(ds,)h(that)e(is,)j(functions)e(whic)
1936o(h)g(ha)o(v)o(e)h(an)f(extra)-42 569 y(parameter)14
1937b Fm(self)p Fn(.)42 641 y Fm(function)50 b Fi(!)g Fk(function)16
1938b Fm(var)h Fn(':')j Fm(name)c Fn('\(')f([)p Fm(p)n(arlist1)6
1939b Fn(])16 b('\)')f Fm(blo)n(ck)g Fk(end)-42 714 y Fn(A)h(declaration)e
1940(lik)o(e)-42 807 y Fl(function)23 b(v:f)h(\(...\))6 864
1941y(...)-42 920 y(end)-42 1014 y Fn(is)15 b(equiv)m(alen)o(t)g(to)-42
19421108 y Fl(function)23 b(v.f)h(\(self,)f(...\))6 1164
1943y(...)-42 1221 y(end)-42 1315 y Fn(that)16 b(is,)g(the)g(function)g
1944(gets)g(an)g(extra)f(formal)f(parameter)h(called)h Fl(self)p
1945Fn(.)22 b(Notice)16 b(that)f(the)h(v)m(ariable)g Fl(v)g
1946Fn(m)o(ust)-42 1371 y(b)q(e)g(previously)f(initialized)f(with)g(a)h
1947(table)g(v)m(alue.)-42 1493 y Fd(4.7)56 b(F)-5 b(allbac)n(ks)-42
19481579 y Fn(Lua)17 b(pro)o(vides)f(a)g(p)q(o)o(w)o(erful)g(mec)o(hanism)e
1949(to)h(extend)i(its)f(seman)o(tics,)e(called)i Fm(fal)r(lb)n(acks)p
1950Fn(.)23 b(Basically)l(,)15 b(a)h(fallbac)o(k)-42 1635
1951y(is)f(a)g(programmer)d(de\014ned)17 b(function)e(whic)o(h)g(is)f
1952(called)h(whenev)o(er)h(Lua)f(do)q(es)h(not)f(kno)o(w)f(ho)o(w)h(to)g
1953(pro)q(ceed.)29 1691 y(Lua)h(supp)q(orts)f(the)g(follo)o(wing)e
1954(fallbac)o(ks,)h(iden)o(ti\014ed)h(b)o(y)g(the)g(giv)o(en)g(strings:)
1955-42 1785 y Fk(\\arith")24 b Fn(called)17 b(when)g(an)h(arithmetic)c(op)
1956q(eration)j(is)g(applied)g(to)f(non)i(n)o(umerical)d(op)q(erands,)j(or)
1957f(when)g(the)72 1842 y(binary)f Fl(^)g Fn(op)q(eration)g(is)f(called.)
195823 b(It)17 b(receiv)o(es)f(three)g(argumen)o(ts:)k(the)d(t)o(w)o(o)e
1959(op)q(erands)h(\(the)g(second)h(one)72 1898 y(is)j(nil)g(when)h(the)g
1960(op)q(eration)e(is)h(unary)h(min)o(us\))e(and)h(one)h(of)f(the)g(follo)
1961o(wing)f(strings)g(describing)h(the)72 1955 y(o\013ended)c(op)q
1962(erator:)120 2067 y Fl(add)47 b(sub)g(mul)h(div)f(pow)g(unm)72
19632180 y Fn(Its)15 b(return)f(v)m(alue)h(is)f(the)h(\014nal)f(result)g
1964(of)g(the)h(arithmetic)d(op)q(eration.)19 b(The)c(default)f(function)g
1965(issues)h(an)72 2236 y(error.)-42 2330 y Fk(\\order")23
1966b Fn(called)15 b(when)h(an)g(order)f(comparison)e(is)i(applied)h(to)f
1967(non)g(n)o(umerical)f(or)h(non)h(string)e(op)q(erands.)21
1968b(It)72 2386 y(receiv)o(es)d(three)g(argumen)o(ts:)23
1969b(the)18 b(t)o(w)o(o)f(op)q(erands)h(and)g(one)g(of)f(the)h(follo)o
1970(wing)e(strings)h(describing)g(the)72 2443 y(o\013ended)f(op)q(erator:)
1971120 2555 y Fl(lt)23 b(gt)h(le)g(ge)922 2748 y Fn(9)p
1972eop
1973%%Page: 10 10
197410 9 bop 72 199 a Fn(Its)17 b(return)h(v)m(alue)f(is)g(the)g(\014nal)g
1975(result)g(of)g(the)g(comparison)f(op)q(eration.)25 b(The)18
1976b(default)e(function)i(issues)72 256 y(an)d(error.)-42
1977350 y Fk(\\concat")25 b Fn(called)d(when)g(a)f(concatenation)f(is)h
1978(applied)h(to)f(non)h(string)e(op)q(erands.)39 b(It)22
1979b(receiv)o(es)f(the)h(t)o(w)o(o)72 406 y(op)q(erands)d(as)f(argumen)o
1980(ts.)29 b(Its)18 b(return)h(v)m(alue)g(is)f(the)g(\014nal)h(result)f
1981(of)g(the)h(concatenation)f(op)q(eration.)72 462 y(The)e(default)e
1982(function)h(issues)g(an)h(error.)-42 556 y Fk(\\index")23
1983b Fn(called)14 b(when)i(Lua)f(tries)f(to)g(retriev)o(e)g(the)h(v)m
1984(alue)g(of)f(an)h(index)g(not)f(presen)o(t)h(in)f(a)h(table.)k(It)c
1985(receiv)o(es)72 613 y(as)20 b(argumen)o(ts)e(the)i(table)g(and)g(the)g
1986(index.)35 b(Its)20 b(return)g(v)m(alue)g(is)f(the)h(\014nal)g(result)g
1987(of)f(the)i(indexing)72 669 y(op)q(eration.)e(The)d(default)e(function)
1988h(returns)h(nil.)-42 763 y Fk(\\gettable")25 b Fn(called)17
1989b(when)i(Lua)g(tries)e(to)g(index)i(a)f(non)g(table)g(v)m(alue.)29
1990b(It)18 b(receiv)o(es)g(as)g(argumen)o(ts)e(the)i(non)72
1991819 y(table)d(v)m(alue)h(and)g(the)g(index.)22 b(Its)15
1992b(return)h(v)m(alue)g(is)f(the)h(\014nal)g(result)f(of)g(the)h
1993(indexing)g(op)q(eration.)k(The)72 876 y(default)15 b(function)g
1994(issues)g(an)g(error.)-42 970 y Fk(\\settable")24 b Fn(called)18
1995b(when)g(Lua)g(tries)f(to)h(assign)f(indexed)h(a)g(non)g(table)f(v)m
1996(alue.)28 b(It)18 b(receiv)o(es)g(as)f(argumen)o(ts)72
19971026 y(the)e(non)h(table)e(v)m(alue,)h(the)h(index,)f(and)g(the)h
1998(assigned)e(v)m(alue.)20 b(The)c(default)f(function)g(issues)g(an)g
1999(error.)-42 1120 y Fk(\\function")24 b Fn(called)16 b(when)h(Lua)g
2000(tries)f(to)g(call)f(a)h(non)h(function)f(v)m(alue.)24
2001b(It)17 b(receiv)o(es)f(as)g(argumen)o(ts)f(the)h(non)72
20021176 y(function)i(v)m(alue)h(and)g(the)f(argumen)o(ts)f(giv)o(en)h(in)g
2003(the)h(original)d(call.)29 b(Its)19 b(return)f(v)m(alues)h(are)f(the)h
2004(\014nal)72 1233 y(results)c(of)f(the)i(call)e(op)q(eration.)19
2005b(The)d(default)e(function)h(issues)g(an)h(error.)-42
20061327 y Fk(\\gc")24 b Fn(called)12 b(during)g(garbage)e(collection.)18
2007b(It)12 b(receiv)o(es)g(as)f(argumen)o(t)f(the)i(table)f(b)q(eing)h
2008(collected.)19 b(After)11 b(eac)o(h)72 1383 y(run)16
2009b(of)f(the)g(collector)f(this)h(function)g(is)g(called)g(with)g
2010(argumen)o(t)f(nil.)20 b(Because)c(this)e(function)i(op)q(erates)72
20111440 y(during)i(garbage)g(collection,)f(it)h(m)o(ust)f(b)q(e)i(used)g
2012(with)f(great)f(care,)i(and)f(programmers)d(should)k(a)o(v)o(oid)72
20131496 y(the)g(creation)g(of)g(new)g(ob)s(jects)g(\(tables)f(or)h
2014(strings\))e(in)i(this)g(function.)32 b(The)19 b(default)g(function)g
2015(do)q(es)72 1553 y(nothing.)-42 1646 y Fk(\\error")k
2016Fn(called)16 b(when)i(an)f(error)f(o)q(ccurs.)26 b(It)17
2017b(receiv)o(es)g(as)g(argumen)o(t)e(a)i(string)f(describing)h(the)g
2018(error.)25 b(The)72 1703 y(default)15 b(function)g(prin)o(ts)f(the)i
2019(message)d(on)j(the)f(standard)g(error)f(output.)29 1797
2020y(The)19 b(function)f Fl(setfallback)f Fn(is)g(used)i(to)f(c)o(hange)g
2021(a)g(fallbac)o(k)f(action.)29 b(Its)18 b(\014rst)g(argumen)o(t)f(is)g
2022(a)h(string)-42 1853 y(describing)f(the)g(fallbac)o(k,)e(and)i(the)f
2023(second)i(the)e(new)h(function)g(to)f(b)q(e)h(called.)24
2024b(It)16 b(returns)h(the)f(old)h(function)-42 1910 y(for)e(the)g(giv)o
2025(en)g(fallbac)o(k.)29 1966 y(Section)g(7.4)f(sho)o(ws)h(an)g(example)f
2026(of)h(the)g(use)h(of)e(fallbac)o(ks.)-42 2088 y Fd(4.8)56
2027b(Error)18 b(Handling)-42 2173 y Fn(Because)c(Lua)g(is)e(an)h
2028(extension)g(language,)f(all)g(Lua)i(actions)e(start)g(from)f(C)i(co)q
2029(de)h(calling)d(a)i(function)g(from)e(the)-42 2230 y(Lua)j(library)l(.)
2030k(Whenev)o(er)13 b(an)g(error)f(o)q(ccurs)i(during)f(Lua)g(compilation)
2031d(or)j(execution,)g(an)g(error)f(fallbac)o(k)g(func-)-42
20322286 y(tion)k(is)g(called,)f(and)i(then)f(the)g(corresp)q(onding)h
2033(function)f(from)e(the)i(library)f(\()p Fl(lua_dofile)p
2034Fn(,)g Fl(lua_dostring)p Fn(,)-42 2343 y Fl(lua_call)p
2035Fn(,)f(and)i Fl(lua_callfunction)p Fn(\))c(is)j(terminated)e(returning)
2036i(an)g(error)g(condition.)29 2399 y(The)21 b(only)g(argumen)o(t)e(to)h
2037(the)h(error)g(fallbac)o(k)e(function)i(is)g(a)f(string)g(describing)h
2038(the)g(error)g(and)g(some)-42 2456 y(extra)c(informations,)d(lik)o(e)h
2039(curren)o(t)i(line)g(\(when)g(the)f(error)h(is)f(at)g(compilation\))e
2040(or)i(curren)o(t)h(function)f(\(when)-42 2512 y(the)g(error)f(is)g(at)g
2041(execution\).)21 b(F)l(or)15 b(more)f(information)e(ab)q(out)k(an)f
2042(error,)g(the)g(Lua)h(program)e(can)h(include)h(the)-42
20432569 y(compilation)10 b(pragma)h Fl($debug)p Fn(.)18
2044b(This)12 b(pragma)f(m)o(ust)f(b)q(e)k(written)d(in)h(a)h(line)f(b)o(y)
2045g(itself.)18 b(When)13 b(an)f(error)g(o)q(ccurs)911 2748
2046y(10)p eop
2047%%Page: 11 11
204811 10 bop -42 199 a Fn(in)15 b(a)g(program)e(compiled)h(with)h(this)f
2049(option,)g(the)i(error)e(message)g(includes)h(extra)g(information)d
2050(sho)o(wing)i(the)-42 256 y(stac)o(k)h(of)g(calls.)29
2051312 y(The)g(standard)f(error)g(routine)g(only)g(prin)o(ts)g(the)g
2052(error)g(message)f(to)h Fl(stderr)p Fn(.)19 b(If)14 b(needed,)i(it)e
2053(is)g(p)q(ossible)g(to)-42 369 y(c)o(hange)i(the)f(error)g(fallbac)o(k)
2054e(routine;)i(see)g(Section)g(4.7.)29 425 y(Lua)e(co)q(de)g(can)f
2055(generate)g(an)g(error)g(b)o(y)g(calling)f(the)i(function)f
2056Fl(error)p Fn(.)18 b(Its)13 b(optional)d(parameter)h(is)h(a)g(string,)
2057-42 482 y(whic)o(h)k(is)e(used)i(as)f(the)g(error)g(message.)-42
2058624 y Fo(5)67 b(The)23 b(Application)h(Program)f(In)n(terface)-42
2059725 y Fn(This)13 b(section)g(describ)q(es)h(the)f(API)g(for)g(Lua,)h
2060(that)e(is,)h(the)g(set)g(of)f(C)h(functions)g(a)o(v)m(ailable)f(to)h
2061(the)g(host)g(program)-42 782 y(to)i(comm)o(unicate)e(with)h(the)h
2062(library)l(.)k(The)d(API)f(functions)g(can)h(b)q(e)f(classi\014ed)g(in)
2063g(the)h(follo)o(wing)d(categories:)14 869 y(1.)22 b(executing)15
2064b(Lua)h(co)q(de;)14 961 y(2.)22 b(con)o(v)o(erting)14
2065b(v)m(alues)i(b)q(et)o(w)o(een)f(C)g(and)g(Lua;)14 1052
2066y(3.)22 b(manipulating)13 b(\(reading)h(and)i(writing\))d(Lua)j(ob)s
2067(jects;)14 1144 y(4.)22 b(calling)14 b(Lua)i(functions;)14
20681235 y(5.)22 b(C)15 b(functions)g(to)g(b)q(e)g(called)g(b)o(y)g(Lua;)14
20691326 y(6.)22 b(lo)q(c)o(king)14 b(Lua)i(Ob)s(jects.)-42
20701414 y(All)f(API)h(functions)f(are)f(declared)i(in)f(the)g(\014le)g
2071Fl(lua.h)p Fn(.)-42 1535 y Fd(5.1)56 b(Executing)18 b(Lua)h(Co)r(de)-42
20721621 y Fn(A)i(host)g(program)d(can)j(execute)h(Lua)f(programs)d
2073(written)i(in)h(a)f(\014le)h(or)f(in)h(a)g(string,)f(using)h(the)g
2074(follo)o(wing)-42 1677 y(functions:)-42 1765 y Fl(int)286
2075b(lua_dofile)357 b(\(char)23 b(*filename\);)-42 1821
2076y(int)286 b(lua_dostring)309 b(\(char)23 b(*string\);)-42
20771909 y Fn(Both)15 b(functions)f(return)g(an)g(error)f(co)q(de:)20
2078b(0,)14 b(in)g(case)g(of)g(success;)h(non)f(zero,)g(in)g(case)h(of)e
2079(errors.)19 b(The)c(function)-42 1965 y Fl(lua_dofile)p
2080Fn(,)f(if)h(called)f(with)h(argumen)o(t)e(NULL)j(\(0\),)e(executes)i
2081(the)f(\\\014le")g Fl(stdin)p Fn(.)-42 2086 y Fd(5.2)56
2082b(Con)n(v)n(erting)20 b(V)-5 b(alues)20 b(b)r(et)n(w)n(een)e(C)h(and)h
2083(Lua)-42 2172 y Fn(Because)13 b(Lua)g(has)f(no)g(static)f(t)o(yp)q(e)h
2084(system,)f(all)h(v)m(alues)g(passed)g(b)q(et)o(w)o(een)h(Lua)f(and)h(C)
2085f(ha)o(v)o(e)g(t)o(yp)q(e)g Fl(lua)p 1739 2172 15 2 v
208617 w(Object)p Fn(,)-42 2228 y(whic)o(h)k(w)o(orks)e(lik)o(e)g(an)h
2087(abstract)f(t)o(yp)q(e)i(in)f(C)g(that)f(can)h(hold)g(an)o(y)g(Lua)h(v)
2088m(alue.)29 2285 y(Lua)11 b(has)f(automatic)e(memory)f(managemen)o(t,)i
2089(and)h(garbage)g(collection.)17 b(Because)11 b(of)f(that,)g(a)g
2090Fl(lua_Object)-42 2341 y Fn(has)18 b(a)f(limited)e(scop)q(e,)j(and)g
2091(is)f(only)g(v)m(alid)g(inside)g(the)h Fm(blo)n(ck)j
2092Fn(where)d(it)f(w)o(as)f(created.)27 b(A)17 b(C)h(function)f(called)-42
20932398 y(from)c(Lua)i(is)f(a)h(blo)q(c)o(k,)f(and)h(its)e(parameters)g
2094(are)h(v)m(alid)h(only)f(un)o(til)g(its)f(end.)21 b(A)14
2095b(go)q(o)q(d)h(programmi)o(ng)d(practice)-42 2454 y(is)i(to)f(con)o(v)o
2096(ert)g(Lua)h(ob)s(jects)f(to)g(C)h(v)m(alues)g(as)f(so)q(on)h(as)f
2097(they)h(are)g(a)o(v)m(ailable,)e(and)i(nev)o(er)g(to)f(store)g
2098Fl(lua_Object)p Fn(s)-42 2511 y(in)j(C)e(global)g(v)m(ariables.)29
20992567 y(When)f(C)g(co)q(de)h(calls)e(Lua)h(rep)q(eatedly)l(,)g(as)g(in)g
2100(a)f(lo)q(op,)h(ob)s(jects)f(returned)i(b)o(y)f(these)g(calls)f(accum)o
2101(ulate,)f(and)-42 2623 y(ma)o(y)j(create)h(a)g(memory)d(problem.)19
2102b(T)l(o)c(a)o(v)o(oid)f(this,)g(nested)i(blo)q(c)o(ks)f(can)g(b)q(e)h
2103(de\014ned)g(with)f(the)g(functions:)911 2748 y(11)p
2104eop
2105%%Page: 12 12
210612 11 bop -42 199 a Fl(void)262 b(lua_beginblock)f(\(void\);)-42
2107256 y(void)h(lua_endblock)309 b(\(void\);)-42 350 y Fn(After)15
2108b(the)h(end)f(of)g(the)g(blo)q(c)o(k,)g(all)f Fl(lua_Object)p
2109Fn('s)g(created)h(inside)g(it)f(are)h(released.)29 406
2110y(T)l(o)g(c)o(hec)o(k)g(the)h(t)o(yp)q(e)f(of)g(a)g Fl(lua_Object)p
2111Fn(,)e(the)i(follo)o(wing)e(function)i(is)g(a)o(v)m(ailable:)-42
2112500 y Fl(int)286 b(lua_type)405 b(\(lua_Object)22 b(object\);)-42
2113594 y Fn(plus)16 b(the)f(follo)o(wing)e(macros:)-42 687
2114y Fl(int)286 b(lua_isnil)381 b(\(lua_Object)22 b(object\);)-42
2115744 y(int)286 b(lua_isnumber)309 b(\(lua_Object)22 b(object\);)-42
2116800 y(int)286 b(lua_isstring)309 b(\(lua_Object)22 b(object\);)-42
2117857 y(int)286 b(lua_istable)333 b(\(lua_Object)22 b(object\);)-42
2118913 y(int)286 b(lua_iscfunction)237 b(\(lua_Object)22
2119b(object\);)-42 970 y(int)286 b(lua_isuserdata)261 b(\(lua_Object)22
2120b(object\);)-42 1064 y Fn(All)15 b(macros)e(return)j(1)e(if)h(the)g(ob)
2121s(ject)g(has)g(the)g(giv)o(en)g(t)o(yp)q(e,)g(and)g(0)g(otherwise.)29
21221120 y(The)20 b(function)g Fl(lua_type)f Fn(can)h(b)q(e)h(used)f(to)g
2123(distinguish)f(b)q(et)o(w)o(een)h(di\013eren)o(t)f(kinds)h(of)g(user)g
2124(data;)h(see)-42 1176 y(b)q(elo)o(w.)29 1233 y(T)l(o)15
2125b(translate)f(a)h(v)m(alue)g(from)f(t)o(yp)q(e)h Fl(lua_Object)f
2126Fn(to)g(a)h(sp)q(eci\014c)h(C)f(t)o(yp)q(e,)g(the)g(programmer)d(can)k
2127(use:)-42 1327 y Fl(double)214 b(lua_getnumber)285 b(\(lua_Object)22
2128b(object\);)-42 1383 y(char)239 b(*lua_getstring)284
2129b(\(lua_Object)22 b(object\);)-42 1440 y(lua_CFunction)46
2130b(lua_getcfunction)213 b(\(lua_Object)22 b(object\);)-42
21311496 y(void)239 b(*lua_getuserdata)d(\(lua_Object)22
2132b(object\);)-42 1590 y(lua_getnumber)14 b Fn(con)o(v)o(erts)g(a)g
2133Fl(lua_Object)g Fn(to)g(a)h(\015oat.)k(This)c Fl(lua_Object)e
2134Fn(m)o(ust)h(b)q(e)h(a)g(n)o(um)o(b)q(er)f(or)h(a)f(string)-42
21351646 y(con)o(v)o(ertible)h(to)f(n)o(um)o(b)q(er)h(\(see)g(Section)g
2136(4.2\);)f(otherwise,)g(the)h(function)g(returns)g(0.)29
21371703 y Fl(lua_getstring)c Fn(con)o(v)o(erts)g(a)h Fl(lua_Object)f
2138Fn(to)h(a)g(string)g(\()p Fl(char)23 b(*)p Fn(\).)18
2139b(This)12 b Fl(lua_Object)f Fn(m)o(ust)g(b)q(e)i(a)f(string)-42
21401759 y(or)k(a)f(n)o(um)o(b)q(er;)h(otherwise,)e(the)i(function)g
2141(returns)g(0)f(\(the)h(n)o(ull)f(p)q(oin)o(ter\).)21
2142b(This)16 b(function)f(do)q(es)i(not)e(create)h(a)-42
21431816 y(new)f(string,)d(but)i(returns)g(a)f(p)q(oin)o(ter)g(to)h(a)f
2144(string)g(inside)g(the)h(Lua)g(en)o(vironmen)o(t.)k(Because)d(Lua)f
2145(has)f(garbage)-42 1872 y(collection,)h(there)h(is)g(no)g(guaran)o(tee)
2146g(that)f(suc)o(h)i(p)q(oin)o(ter)e(will)g(b)q(e)i(v)m(alid)f(after)f
2147(the)i(blo)q(c)o(k)f(ends.)29 1929 y Fl(lua_getcfunction)f
2148Fn(con)o(v)o(erts)h(a)h Fl(lua_Object)f Fn(to)g(a)h(C)g(function.)23
2149b(This)15 b Fl(lua_Object)g Fn(m)o(ust)g(ha)o(v)o(e)g(t)o(yp)q(e)-42
21501985 y Fm(CF)m(unction)s Fn(;)j(otherwise,)f(the)h(function)g(returns)g
2151(0)f(\(the)h(n)o(ull)f(p)q(oin)o(ter\).)27 b(The)18 b(t)o(yp)q(e)g
2152Fl(lua_CFunction)e Fn(is)h(ex-)-42 2042 y(plained)f(in)f(Section)g
2153(5.5.)29 2098 y Fl(lua_getuserdata)10 b Fn(con)o(v)o(erts)i(a)g
2154Fl(lua_Object)e Fn(to)i Fl(void*)p Fn(.)18 b(This)12
2155b Fl(lua_Object)f Fn(m)o(ust)g(ha)o(v)o(e)h(t)o(yp)q(e)g
2156Fm(user)n(data)s Fn(;)-42 2154 y(otherwise,)j(the)g(function)g(returns)
2157g(0)g(\(the)g(n)o(ull)f(p)q(oin)o(ter\).)29 2211 y(The)j(rev)o(erse)g
2158(pro)q(cess,)h(that)e(is,)h(passing)f(a)h(sp)q(eci\014c)h(C)f(v)m(alue)
2159g(to)g(Lua,)h(is)e(done)i(b)o(y)f(using)g(the)g(follo)o(wing)-42
21602267 y(functions:)-42 2361 y Fl(void)262 b(lua_pushnumber)f(\(double)23
2161b(n\);)-42 2418 y(void)262 b(lua_pushstring)f(\(char)23
2162b(*s\);)-42 2474 y(void)262 b(lua_pushliteral)237 b(\(char)23
2163b(*s\);)-42 2531 y(void)262 b(lua_pushcfunction)189 b(\(lua_CFunction)
216422 b(f\);)-42 2587 y(void)262 b(lua_pushusertag)237 b(\(void)23
2165b(*u,)h(int)f(tag\);)911 2748 y Fn(12)p eop
2166%%Page: 13 13
216713 12 bop -42 199 a Fn(plus)16 b(the)f(macro:)-42 293
2168y Fl(void)262 b(lua_pushuserdata)213 b(\(void)23 b(*u\);)-42
2169387 y Fn(All)17 b(of)f(them)g(receiv)o(e)h(a)f(C)h(v)m(alue,)g(con)o(v)
2170o(ert)f(it)h(to)f(a)g(corresp)q(onden)o(t)i Fl(lua_Object)p
2171Fn(,)d(and)i(lea)o(v)o(e)f(the)h(result)g(on)-42 443
2172y(the)h(top)g(of)f(the)h(Lua)g(stac)o(k,)f(where)h(it)f(can)h(b)q(e)h
2173(assigned)e(to)g(a)h(Lua)g(v)m(ariable,)f(passed)h(as)g(paramen)o(ter)e
2174(to)h(a)-42 500 y(Lua)f(function,)g(etc)f(\(see)h(b)q(elo)o(w\).)21
2175b Fl(lua_pushliteral)13 b Fn(is)i(lik)o(e)g Fl(lua_pushstring)p
2176Fn(,)f(but)h(also)g(puts)h(the)f(string)-42 556 y(in)h(the)g(Lua)g
2177(literal)e(table.)21 b(This)15 b(a)o(v)o(oids)g(the)h(string)e(to)h(b)q
2178(e)i(garbage)e(collected,)g(and)h(therefore)f(has)h(a)f(b)q(etter)-42
2179613 y(o)o(v)o(erall)e(p)q(erformance.)19 b(As)14 b(a)h(rule,)f(when)h
2180(the)f(string)g(to)g(b)q(e)h(pushed)g(is)f(a)h(literal,)d
2181Fl(lua_pushliteral)g Fn(should)-42 669 y(b)q(e)k(used.)29
2182726 y(User)10 b(data)g(can)h(ha)o(v)o(e)e(di\013eren)o(t)h(tags,)g
2183(whose)g(seman)o(tics)f(are)h(de\014ned)h(b)o(y)g(the)f(host)g
2184(program.)16 b(An)o(y)10 b(p)q(ositiv)o(e)-42 782 y(in)o(teger)15
2185b(can)h(b)q(e)h(used)f(to)g(tag)e(a)i(user)g(data.)21
2186b(When)16 b(a)g(user)g(data)f(is)g(retriev)o(ed,)g(the)h(function)g
2187Fl(lua_type)e Fn(can)-42 839 y(b)q(e)i(used)g(to)f(get)f(its)h(tag.)29
2188895 y(T)l(o)g(complete)f(the)h(set,)g(the)g(v)m(alue)g
2189Fk(nil)g Fn(or)f(a)h Fl(lua_Object)f Fn(can)h(also)g(b)q(e)g(pushed)i
2190(on)o(to)d(the)h(stac)o(k,)f(with:)-42 989 y Fl(void)262
2191b(lua_pushnil)333 b(\(void\);)-42 1045 y(void)262 b(lua_pushobject)f
2192(\(lua_Object)22 b(object\);)-42 1167 y Fd(5.3)56 b(Manipulating)22
2193b(Lua)c(Ob)s(jects)-42 1253 y Fn(T)l(o)d(read)h(the)f(v)m(alue)g(of)g
2194(an)o(y)g(global)f(Lua)h(v)m(ariable,)f(one)i(can)f(use)h(the)f
2195(function:)-42 1347 y Fl(lua_Object)118 b(lua_getglobal)285
2196b(\(char)23 b(*varname\);)-42 1440 y Fn(T)l(o)15 b(store)g(a)g(v)m
2197(alue)g(previously)g(pushed)h(on)o(to)e(the)i(stac)o(k)e(in)h(a)g
2198(global)f(v)m(ariable,)g(there)h(is)g(the)g(function:)-42
21991534 y Fl(void)262 b(lua_storeglobal)237 b(\(char)23
2200b(*varname\);)29 1628 y Fn(T)l(ables)15 b(can)g(also)f(b)q(e)i
2201(manipulated)e(via)g(the)i(API.)f(The)g(function)-42
22021722 y Fl(lua_Object)118 b(lua_getsubscript)213 b(\(void\);)-42
22031816 y Fn(exp)q(ects)16 b(on)f(the)h(stac)o(k)e(a)h(table)f(and)i(an)f
2204(index,)g(and)g(returns)g(the)g(con)o(ten)o(ts)g(of)g(the)g(table)f(at)
2205h(that)f(index.)20 b(As)-42 1872 y(in)15 b(Lua,)g(if)g(the)g(\014rst)f
2206(ob)s(ject)h(is)f(not)h(a)f(table,)g(or)h(the)g(index)g(is)g(not)f
2207(presen)o(t)h(in)g(the)g(table,)f(the)h(corresp)q(onden)o(t)-42
22081929 y(fallbac)o(k)f(is)h(called.)29 1985 y(F)l(or)g(compatibilit)n(y)d
2209(with)j(previous)g(v)o(ersions)f(of)h(the)g(API,)g(the)h(follo)o(wing)d
2210(macros)g(are)i(supp)q(orted:)-42 2079 y Fl(lua_Object)118
2211b(lua_getindexed)261 b(\(lua_Object)22 b(table,)h(float)h(index\);)-42
22122135 y(lua_Object)118 b(lua_getfield)309 b(\(lua_Object)22
2213b(table,)h(char)h(*field\);)-42 2229 y Fn(The)16 b(\014rst)f(one)g(is)g
2214(used)h(for)e(n)o(umeric)g(indices,)h(while)g(the)g(second)h(can)f(b)q
2215(e)h(used)g(for)e(an)o(y)h(string)f(index.)29 2286 y(T)l(o)i(store)g(a)
2216g(v)m(alue)h(in)f(an)h(index,)g(the)f(program)e(m)o(ust)h(push)j(on)o
2217(to)d(the)i(stac)o(k)e(the)i(table,)f(the)h(index,)f(and)-42
22182342 y(the)g(v)m(alue,)f(and)g(then)h(call)e(the)h(function:)-42
22192436 y Fl(void)24 b(lua_storesubscript)d(\(void\);)-42
22202530 y Fn(Again,)15 b(the)g(corresp)q(onden)o(t)g(fallbac)o(k)f(is)h
2221(called)g(if)f(needed.)29 2586 y(Finally)l(,)g(the)h(function)911
22222748 y(13)p eop
2223%%Page: 14 14
222414 13 bop -42 199 a Fl(lua_Object)118 b(lua_createtable)237
2225b(\(void\);)-42 293 y Fn(creates)15 b(a)g(new)h(table.)29
2226349 y Fm(Ple)n(ase)22 b(Notic)n(e:)36 b Fn(Most)22 b(functions)g(from)e
2227(the)j(Lua)f(library)f(receiv)o(e)i(parameters)d(through)i(the)h(stac)o
2228(k.)-42 406 y(Because)c(other)e(functions)g(also)g(use)h(the)g(stac)o
2229(k,)f(it)g(is)g(imp)q(ortan)o(t)e(that)i(these)h(parameters)e(b)q(e)i
2230(pushed)h(just)-42 462 y(b)q(efore)d(the)f(corresp)q(onden)o(t)g(call,)
2231f(without)g(in)o(termediate)e(calls)i(to)h(the)g(Lua)g(library)l(.)k(F)
2232l(or)14 b(instance,)h(supp)q(ose)-42 519 y(the)h(user)f(w)o(an)o(ts)f
2233(the)h(v)m(alue)h(of)f Fl(a[i])p Fn(.)k(A)c(simplistic)e(solution)h(w)o
2234(ould)g(b)q(e:)6 613 y Fl(/*)24 b(Warning:)f(WRONG)g(CODE)g(*/)6
2235669 y(lua_Object)g(result;)6 725 y(lua_pushobject\(lua_getglobal)o
2236(\("a"\)\);)44 b(/*)24 b(push)f(table)g(*/)6 782 y
2237(lua_pushobject\(lua_getglobal)o(\("i"\)\);)44 b(/*)24
2238b(push)f(index)g(*/)6 838 y(result)g(=)h(lua_getsubscript\(\);)-42
2239932 y Fn(Ho)o(w)o(ev)o(er,)c(the)f(call)g Fl(lua_getglobal\("i"\))e
2240Fn(mo)q(di\014es)i(the)h(stac)o(k,)f(and)h(in)o(v)m(alidates)e(the)i
2241(previous)f(pushed)-42 989 y(v)m(alue.)i(A)15 b(correct)g(solution)f
2242(could)h(b)q(e:)6 1082 y Fl(lua_Object)23 b(result;)6
22431139 y(lua_Object)g(index)g(=)h(lua_getglobal\("i"\);)6
22441195 y(lua_pushobject\(lua_getglobal)o(\("a"\)\);)44
2245b(/*)24 b(push)f(table)g(*/)6 1252 y(lua_pushobject\(index\);)355
2246b(/*)24 b(push)f(index)g(*/)6 1308 y(result)g(=)h
2247(lua_getsubscript\(\);)-42 1430 y Fd(5.4)56 b(Calling)21
2248b(Lua)e(F)-5 b(unctions)-42 1516 y Fn(F)l(unctions)19
2249b(de\014ned)g(in)g(Lua)f(b)o(y)h(a)f(c)o(h)o(unk)g(executed)i(with)e
2250Fl(dofile)f Fn(or)h Fl(dostring)f Fn(can)i(b)q(e)g(called)f(from)e(the)
2251-42 1572 y(host)h(program.)23 b(This)16 b(is)g(done)h(using)g(the)g
2252(follo)o(wing)e(proto)q(col:)22 b(\014rst,)16 b(the)h(argumen)o(ts)e
2253(to)h(the)h(function)g(are)-42 1629 y(pushed)f(on)o(to)d(the)i(Lua)g
2254(stac)o(k)e(\(see)i(Section)f(5.2\),)f(in)h(direct)g(order,)g(i.e.,)g
2255(the)g(\014rst)g(argumen)o(t)f(is)h(pushed)h(\014rst.)-42
22561685 y(Again,)g(it)f(is)h(imp)q(ortan)o(t)e(to)h(emphasize)h(that,)f
2257(during)h(this)f(phase,)i(no)f(other)g(Lua)g(function)g(can)g(b)q(e)h
2258(called.)29 1741 y(Then,)f(the)h(function)f(is)f(called)h(using)-42
22591835 y Fl(int)286 b(lua_call)405 b(\(char)23 b(*functionname\);)-42
22601929 y Fn(or)-42 2023 y Fl(int)286 b(lua_callfunction)213
2261b(\(lua_Object)22 b(function\);)-42 2116 y Fn(Both)16
2262b(functions)g(return)f(an)h(error)f(co)q(de:)22 b(0,)15
2263b(in)h(case)g(of)f(success;)i(non)f(zero,)f(in)h(case)g(of)f(errors.)21
2264b(Finally)l(,)14 b(the)-42 2173 y(returned)i(v)m(alues)f(\(a)g(Lua)h
2265(function)f(ma)o(y)e(return)i(man)o(y)f(v)m(alues\))h(can)g(b)q(e)h
2266(retriev)o(ed)f(with)f(the)i(macro)-42 2267 y Fl(lua_Object)118
2267b(lua_getresult)309 b(\(int)23 b(number\);)-42 2360 y
2268Fn(where)18 b Fl(number)d Fn(is)i(the)g(order)f(of)h(the)g(result,)f
2269(starting)f(with)h(1.)25 b(When)17 b(called)f(with)g(a)h(n)o(um)o(b)q
2270(er)f(larger)g(than)-42 2417 y(the)g(actual)e(n)o(um)o(b)q(er)h(of)f
2271(results,)h(this)f(function)h(returns)g Fl(LUA_NOOBJECT)p
2272Fn(.)29 2473 y(Tw)o(o)j(sp)q(ecial)g(Lua)g(functions)h(ha)o(v)o(e)e
2273(exclusiv)o(e)i(in)o(terfaces:)25 b Fl(error)18 b Fn(and)g
2274Fl(setfallback)p Fn(.)28 b(A)18 b(C)h(function)-42 2530
2275y(can)d(generate)f(a)g(Lua)g(error)g(calling)f(the)h(function)-42
22762623 y Fl(void)24 b(lua_error)e(\(char)i(*message\);)911
22772748 y Fn(14)p eop
2278%%Page: 15 15
227915 14 bop -42 199 a Fn(This)18 b(function)g(nev)o(er)g(returns.)28
2280b(If)18 b(the)g(C)f(function)h(has)g(b)q(een)h(called)f(from)e(Lua,)i
2281(the)g(corresp)q(onding)g(Lua)-42 256 y(execution)f(terminates,)d(as)i
2282(if)g(an)g(error)f(had)i(o)q(ccurred)g(inside)f(Lua)h(co)q(de.)23
2283b(Otherwise,)16 b(the)h(whole)f(program)-42 312 y(terminates.)29
2284369 y(F)l(allbac)o(ks)e(can)h(b)q(e)h(c)o(hanged)g(with:)-42
2285460 y Fl(lua_Object)23 b(lua_setfallback)f(\(char)h(*name,)g
2286(lua_CFunction)f(fallback\);)-42 552 y Fn(The)12 b(\014rst)f(parameter)
2287f(is)g(the)i(fallbac)o(k)e(name,)h(and)g(the)h(second)f(a)h(CF)l
2288(unction)f(to)f(b)q(e)i(used)g(as)f(the)h(new)f(fallbac)o(k.)-42
2289608 y(This)k(function)g(returns)g(a)g Fl(lua_Object)p
2290Fn(,)f(whic)o(h)h(is)g(the)g(old)g(fallbac)o(k)f(v)m(alue,)h(or)g(nil)f
2291(on)h(fail)g(\(in)o(v)m(alid)f(fallbac)o(k)-42 665 y(name\).)19
2292b(This)c(old)g(v)m(alue)g(can)g(b)q(e)h(used)g(for)f(c)o(haining)f
2293(fallbac)o(ks.)29 721 y(An)i(example)e(of)g(C)h(co)q(de)h(calling)e(a)h
2294(Lua)g(function)h(is)e(sho)o(wn)h(in)g(Section)g(7.6.)-42
2295842 y Fd(5.5)56 b(C)19 b(F)-5 b(unctions)-42 928 y Fn(T)l(o)15
2296b(register)g(a)f(C)h(function)g(to)g(Lua,)g(there)g(is)g(the)g(follo)o
2297(wing)e(macro:)-42 1020 y Fl(#define)23 b(lua_register\(n,f\))165
2298b(\(lua_pushcfunction\(f\),)21 b(lua_storeglobal\(n\)\))-42
22991076 y(/*)j(char)f(*n;)215 b(*/)-42 1133 y(/*)24 b(lua_CFunction)e(f;)i
2300(*/)-42 1224 y Fn(whic)o(h)15 b(receiv)o(es)g(the)f(name)g(the)h
2301(function)f(will)g(ha)o(v)o(e)g(in)g(Lua,)h(and)g(a)f(p)q(oin)o(ter)g
2302(to)g(the)h(function.)20 b(This)14 b(p)q(oin)o(ter)-42
23031281 y(m)o(ust)g(ha)o(v)o(e)h(t)o(yp)q(e)g Fl(lua_CFunction)p
2304Fn(,)e(whic)o(h)i(is)g(de\014ned)i(as)-42 1372 y Fl(typedef)23
2305b(void)h(\(*lua_CFunction\))d(\(void\);)-42 1464 y Fn(that)15
2306b(is,)f(a)h(p)q(oin)o(ter)g(to)f(a)h(function)g(with)g(no)g(parameters)
2307e(and)j(no)f(results.)29 1521 y(In)g(order)e(to)h(comm)o(unicate)d
2308(prop)q(erly)j(with)f(Lua,)h(a)f(C)h(function)g(m)o(ust)e(follo)o(w)g
2309(a)i(proto)q(col,)f(whic)o(h)g(de\014nes)-42 1577 y(the)j(w)o(a)o(y)e
2310(parameters)f(and)j(results)e(are)h(passed.)29 1633 y(T)l(o)g(access)g
2311(its)g(argumen)o(ts,)e(a)i(C)g(function)g(calls:)-42
23121725 y Fl(lua_Object)118 b(lua_getparam)309 b(\(int)23
2313b(number\);)-42 1817 y Fn(where)16 b Fl(number)e Fn(starts)g(with)h(1)g
2314(to)f(get)h(the)h(\014rst)e(argumen)o(t.)19 b(When)c(called)g(with)g(a)
2315g(n)o(um)o(b)q(er)f(larger)g(than)h(the)-42 1873 y(actual)e(n)o(um)o(b)
2316q(er)f(of)g(argumen)o(ts,)f(this)i(function)f(returns)h
2317Fl(LUA)p 1029 1873 15 2 v 17 w(NOOBJECT)p Fn(.)e(In)j(this)e(w)o(a)o(y)
2318l(,)g(it)g(is)h(p)q(ossible)f(to)g(write)-42 1930 y(functions)j(that)g
2319(w)o(ork)f(with)h(a)g(v)m(ariable)f(n)o(um)o(b)q(er)h(of)f(parameters.)
232029 1986 y(T)l(o)g(return)g(v)m(alues,)g(a)g(C)g(function)g(just)f
2321(pushes)i(them)e(on)o(to)g(the)i(stac)o(k,)e(in)h(direct)g(order;)f
2322(see)i(Section)f(5.2.)-42 2042 y(Lik)o(e)i(a)e(Lua)i(function,)f(a)g(C)
2323g(function)g(called)f(b)o(y)h(Lua)h(can)f(also)g(return)g(man)o(y)e
2324(results.)29 2099 y(Section)i(7.5)f(presen)o(ts)i(an)f(example)f(of)g
2325(a)h(CF)l(unction.)-42 2220 y Fd(5.6)56 b(Lo)r(c)n(king)19
2326b(Lua)f(Ob)s(jects)-42 2306 y Fn(As)h(already)g(noted,)g
2327Fl(lua_Object)p Fn(s)f(are)h(v)o(olatile.)29 b(If)19
2328b(the)g(C)g(co)q(de)h(needs)g(to)e(k)o(eep)h(a)g Fl(lua_Object)f
2329Fn(outside)-42 2363 y(blo)q(c)o(k)d(b)q(oundaries,)h(it)e(has)h(to)g
2330Fm(lo)n(ck)f Fn(the)h(ob)s(ject.)20 b(The)15 b(routines)g(to)f
2331(manipulate)g(lo)q(c)o(king)g(are)h(the)g(follo)o(wing:)-42
23322454 y Fl(int)191 b(lua_lock)23 b(\(void\);)-42 2511
2333y(lua_Object)g(lua_getlocked)46 b(\(int)23 b(ref\);)-42
23342567 y(void)167 b(lua_pushlocked)22 b(\(int)h(ref\);)-42
23352623 y(void)167 b(lua_unlock)22 b(\(int)i(ref\);)911
23362748 y Fn(15)p eop
2337%%Page: 16 16
233816 15 bop -42 199 a Fn(The)18 b(function)e Fl(lua_lock)g
2339Fn(lo)q(c)o(ks)g(the)h(ob)s(ject)f(whic)o(h)h(is)f(on)h(the)g(top)f(of)
2340h(the)g(stac)o(k,)f(and)h(returns)f(a)h(reference)-42
2341256 y(to)e(it.)k(Whenev)o(er)c(the)f(lo)q(c)o(k)o(ed)h(ob)s(ject)f(is)g
2342(needed,)i(a)e(call)g(to)g Fl(lua_getlocked)f Fn(returns)i(a)f(handle)h
2343(to)f(it,)g(while)-42 312 y Fl(lua_pushlocked)f Fn(pushes)i(the)f
2344(handle)g(on)g(the)g(stac)o(k.)19 b(When)c(a)e(lo)q(c)o(k)o(ed)h(ob)s
2345(ject)g(is)f(no)h(longer)g(needed,)h(it)e(can)-42 369
2346y(b)q(e)j(unlo)q(c)o(k)o(ed)g(with)e(a)h(call)f(to)h
2347Fl(lua_unlock)p Fn(.)-42 512 y Fo(6)67 b(Prede\014ned)24
2348b(F)-6 b(unctions)24 b(and)f(Libraries)-42 613 y Fn(The)17
2349b(set)g(of)f(prede\014ned)i(functions)e(in)h(Lua)f(is)h(small)d(but)j
2350(p)q(o)o(w)o(erful.)23 b(Most)15 b(of)h(them)g(pro)o(vide)g(features)g
2351(that)-42 670 y(allo)o(ws)d(some)g(degree)h(of)g(re\015exivit)o(y)f(in)
2352h(the)g(language.)19 b(Man)o(y)13 b(of)h(these)h(features)e(cannot)h(b)
2353q(e)h(sim)o(ulated)d(with)-42 726 y(the)k(rest)f(of)f(the)i(Language)f
2354(nor)g(with)f(the)i(standard)e(API.)29 783 y(The)g(libraries,)e(on)i
2355(the)f(other)g(hand,)h(pro)o(vide)g(useful)f(routines)g(that)g(are)h
2356(implemen)o(ted)d(directly)i(through)-42 839 y(the)g(standard)f(API.)h
2357(Therefore,)f(they)h(are)f(not)g(necessary)h(to)f(the)g(language,)g
2358(and)h(are)f(pro)o(vided)h(as)f(separated)-42 896 y(C)j(mo)q(dules.)k
2359(Curren)o(tly)c(there)g(are)g(three)g(standard)g(libraries:)27
2360989 y Fi(\017)22 b Fn(string)14 b(manipulation;)27 1083
2361y Fi(\017)22 b Fn(mathematical)11 b(functions)k(\(sin,)g(cos,)f(etc\);)
236227 1177 y Fi(\017)22 b Fn(input)15 b(and)h(output.)-42
23631271 y(In)h(order)f(to)g(ha)o(v)o(e)g(access)g(to)g(these)g(libraries,)
2364f(the)h(host)g(program)e(m)o(ust)h(call)g(the)h(functions)g
2365Fl(strlib_open)p Fn(,)-42 1327 y Fl(mathlib_open)p Fn(,)e(and)h
2366Fl(iolib_open)p Fn(,)e(declared)j(in)f Fl(lualib.h)p
2367Fn(.)-42 1449 y Fd(6.1)56 b(Prede\014ned)18 b(F)-5 b(unctions)-42
23681535 y Fl(dofile)24 b(\(filename\))-42 1621 y Fn(This)16
2369b(function)f(receiv)o(es)g(a)g(\014le)h(name,)e(op)q(ens)i(it)f(and)h
2370(executes)g(its)f(con)o(ten)o(ts)f(as)i(a)f(Lua)h(c)o(h)o(unk.)21
2371b(It)15 b(returns)h(1)-42 1677 y(if)f(there)g(are)g(no)g(errors,)g
2372Fk(nil)f Fn(otherwise.)-42 1797 y Fl(dostring)23 b(\(string\))-42
23731883 y Fn(This)e(function)h(executes)g(a)f(giv)o(en)g(string)f(as)h(a)g
2374(Lua)h(c)o(h)o(unk.)38 b(It)22 b(returns)f(1)g(if)g(there)g(are)g(no)h
2375(errors,)f Fk(nil)-42 1939 y Fn(otherwise.)-42 2059 y
2376Fl(next)j(\(table,)f(index\))-42 2145 y Fn(This)18 b(function)f(allo)o
2377(ws)f(a)i(program)d(to)i(tra)o(v)o(erse)g(all)g(\014elds)h(of)f(a)g
2378(table.)27 b(Its)18 b(\014rst)f(argumen)o(t)f(is)i(a)f(table)g(and)-42
23792202 y(its)e(second)i(argumen)o(t)c(is)j(an)f(index)h(in)g(this)f
2380(table.)21 b(It)15 b(returns)h(the)g(next)f(index)h(of)g(the)f(table)h
2381(and)f(the)h(v)m(alue)-42 2258 y(asso)q(ciated)g(with)f(the)h(index.)23
2382b(When)17 b(called)e(with)h Fk(nil)f Fn(as)g(its)h(second)g(argumen)o
2383(t,)e(the)j(function)e(returns)h(the)-42 2315 y(\014rst)g(index)g(of)g
2384(the)g(table)g(\(and)f(its)h(asso)q(ciated)f(v)m(alue\).)22
2385b(When)17 b(called)e(with)h(the)g(last)f(index,)h(or)f(with)h
2386Fk(nil)f Fn(in)-42 2371 y(an)h(empt)o(y)e(table,)g(it)g(returns)h
2387Fk(nil)p Fn(.)29 2428 y(In)i(Lua)f(there)g(is)g(no)g(declaration)f(of)h
2388(\014elds;)g(seman)o(tically)l(,)d(there)j(is)g(no)g(di\013erence)g(b)q
2389(et)o(w)o(een)h(a)e(\014eld)i(not)-42 2484 y(presen)o(t)g(in)f(a)g
2390(table)f(or)h(a)g(\014eld)h(with)e(v)m(alue)i Fk(nil)p
2391Fn(.)22 b(Therefore,)16 b(the)g(function)g(only)g(considers)g(\014elds)
2392h(with)e(non)-42 2540 y(nil)g(v)m(alues.)20 b(The)c(order)f(the)g
2393(indices)g(are)g(en)o(umerated)f(is)h(not)g(sp)q(eci\014ed,)h
2394Fm(even)f(for)i(numeric)f(indic)n(es)p Fn(.)29 2597 y(See)g(Section)f
2395(7.1)f(for)h(an)g(example)f(of)h(the)g(use)h(of)e(this)h(function.)911
23962748 y(16)p eop
2397%%Page: 17 17
239817 16 bop -42 199 a Fl(nextvar)23 b(\(name\))-42 285
2399y Fn(This)18 b(function)g(is)g(similar)d(to)i(the)i(function)f
2400Fl(next)p Fn(,)f(but)i(it)e(iterates)g(o)o(v)o(er)g(the)h(global)f(v)m
2401(ariables.)28 b(Its)18 b(single)-42 342 y(argumen)o(t)c(is)h(the)h
2402(name)e(of)h(a)g(global)f(v)m(ariable,)g(or)h Fk(nil)g
2403Fn(to)g(get)g(a)g(\014rst)g(name.)k(Similarly)13 b(to)h
2404Fl(next)p Fn(,)h(it)g(returns)-42 398 y(the)j(name)e(of)g(another)h(v)m
2405(ariable)f(and)h(its)f(v)m(alue,)i(or)e Fk(nil)g Fn(if)g(there)h(are)g
2406(no)g(more)e(v)m(ariables.)25 b(See)18 b(Section)e(7.1)-42
2407454 y(for)f(an)g(example)f(of)h(the)g(use)h(of)f(this)f(function.)-42
2408574 y Fl(print)24 b(\(e1,)f(e2,)g(...\))-42 660 y Fn(This)18
2409b(function)g(receiv)o(es)g(an)o(y)g(n)o(um)o(b)q(er)g(of)f(argumen)o
2410(ts,)g(and)h(prin)o(ts)g(their)f(v)m(alues)i(in)f(a)g(reasonable)f
2411(format.)-42 717 y(Eac)o(h)i(v)m(alue)g(is)f(prin)o(ted)h(in)f(a)h(new)
2412g(line.)30 b(This)18 b(function)h(is)f(not)g(in)o(tended)h(for)f
2413(formatted)f(output,)i(but)g(as)-42 773 y(a)h(quic)o(k)f(w)o(a)o(y)g
2414(to)g(sho)o(w)g(a)g(v)m(alue,)i(for)e(instance)g(for)g(error)g
2415(messages)f(or)h(debugging.)34 b(See)20 b(Section)f(6.4)g(for)-42
2416830 y(functions)c(for)g(formatted)e(output.)-42 950 y
2417Fl(tonumber)23 b(\(e\))-42 1036 y Fn(This)13 b(function)f(receiv)o(es)g
2418(one)h(argumen)o(t,)e(and)h(tries)g(to)g(con)o(v)o(ert)f(it)h(to)g(a)g
2419(n)o(um)o(b)q(er.)18 b(If)13 b(the)g(argumen)o(t)d(is)i(already)-42
24201092 y(a)j(n)o(um)o(b)q(er)g(or)g(a)g(string)f(con)o(v)o(ertible)g(to)h
2421(a)g(n)o(um)o(b)q(er)f(\(see)h(Section)h(4.2\),)d(it)i(returns)g(that)f
2422(n)o(um)o(b)q(er;)h(otherwise,)-42 1148 y(it)g(returns)g
2423Fk(nil)p Fn(.)-42 1269 y Fl(type)24 b(\(v\))-42 1354
2424y Fn(This)13 b(function)h(allo)o(ws)d(Lua)j(to)e(test)h(the)g(t)o(yp)q
2425(e)h(of)f(a)g(v)m(alue.)19 b(It)13 b(receiv)o(es)h(one)f(argumen)o(t,)f
2426(and)h(returns)g(its)g(t)o(yp)q(e,)-42 1411 y(co)q(ded)21
2427b(as)e(a)g(string.)31 b(The)19 b(p)q(ossible)g(results)g(of)g(this)g
2428(function)g(are)g Fl("nil")g Fn(\(a)f(string,)h(not)g(the)h(v)m(alue)f
2429Fk(nil)p Fn(\),)-42 1467 y Fl("number")p Fn(,)g Fl("string")p
2430Fn(,)g Fl("table")p Fn(,)h Fl("function")e Fn(\(returned)h(b)q(oth)h
2431(for)f(C)g(functions)g(and)h(Lua)f(functions\),)-42 1524
2432y(and)d Fl("userdata")p Fn(.)29 1580 y(Besides)f(this)f(string,)f(the)i
2433(function)f(returns)h(a)f(second)h(result,)f(whic)o(h)g(is)g(the)h
2434Fm(tag)g Fn(of)f(the)g(v)m(alue.)20 b(This)14 b(tag)-42
24351637 y(can)g(b)q(e)h(used)f(to)f(distinguish)g(b)q(et)o(w)o(een)g(user)
2436h(data)f(with)g(di\013eren)o(t)g(tags,)g(and)h(b)q(et)o(w)o(een)f(C)h
2437(functions)f(and)h(Lua)-42 1693 y(functions.)-42 1813
2438y Fl(error)24 b(\(message\))-42 1899 y Fn(This)e(function)f(issues)g
2439(an)h(error)f(message)f(and)h(terminates)f(the)h(last)g(called)g
2440(function)g(from)f(the)i(library)-42 1955 y(\()p Fl(lua_dofile)p
2441Fn(,)14 b Fl(lua_dostring)p Fn(,)f Fc(:)8 b(:)g(:)d Fn(\).)20
2442b(It)15 b(nev)o(er)g(returns.)-42 2075 y Fl(setglobal)23
2443b(\(name,)g(value\))-42 2161 y Fn(This)18 b(function)h(assigns)e(the)i
2444(giv)o(en)f(v)m(alue)g(to)g(a)g(global)f(v)m(ariable.)29
2445b(The)19 b(string)e Fl(name)h Fn(do)q(es)h(not)f(need)h(to)f(b)q(e)-42
24462218 y(a)f(syn)o(tactically)d(v)m(alid)i(v)m(ariable)g(name.)22
2447b(Therefore,)17 b(this)f(function)g(can)g(set)h(global)e(v)m(ariables)g
2448(with)h(strange)-42 2274 y(names)f(lik)o(e)f Fl(m)24
2449b(v)f(1)15 b Fn(or)g Fl(34)p Fn(.)-42 2394 y Fl(getglobal)23
2450b(\(name\))-42 2480 y Fn(This)e(function)g(retriev)o(es)g(the)g(v)m
2451(alue)h(of)f(a)g(global)f(v)m(ariable.)37 b(The)22 b(string)e
2452Fl(name)h Fn(do)q(es)g(not)g(need)h(to)f(b)q(e)h(a)-42
24532536 y(syn)o(tactically)14 b(v)m(alid)g(v)m(ariable)h(name.)911
24542748 y(17)p eop
2455%%Page: 18 18
245618 17 bop -42 199 a Fl(setfallback)23 b(\(fallbackname,)f
2457(newfallback\))-42 285 y Fn(This)13 b(function)f(sets)g(a)h(new)f
2458(fallbac)o(k)g(function)g(to)g(the)h(giv)o(en)f(fallbac)o(k.)18
2459b(It)12 b(returns)h(the)g(old)f(fallbac)o(k)f(function.)-42
2460407 y Fd(6.2)56 b(String)19 b(Manipulation)-42 493 y
2461Fn(This)j(library)e(pro)o(vides)i(generic)f(functions)h(for)f(string)g
2462(manipulation,)f(suc)o(h)i(as)g(\014nding)g(and)g(extracting)-42
2463549 y(substrings.)29 b(When)19 b(indexing)f(a)g(string,)f(the)i
2464(\014rst)f(c)o(haracter)f(has)h(p)q(osition)g(1.)29 b(See)19
2465b(Section)f(7.2)f(for)h(some)-42 606 y(examples)c(on)i(string)e
2466(manipulation)f(in)i(Lua.)-42 726 y Fl(strfind)23 b(\(str,)h(substr,)e
2467([init,)i([end]]\))-42 811 y Fn(Receiv)o(es)c(t)o(w)o(o)e(string)h
2468(argumen)o(ts,)f(and)h(returns)g(a)g(n)o(um)o(b)q(er.)32
2469b(This)19 b(n)o(um)o(b)q(er)f(indicates)h(the)g(\014rst)g(p)q(osition)
2470-42 868 y(where)13 b(the)f(second)h(argumen)o(t)e(app)q(ears)h(in)g
2471(the)g(\014rst)g(argumen)o(t.)17 b(If)c(the)f(second)h(argumen)o(t)d
2472(is)i(not)g(a)g(substring)-42 924 y(of)j(the)g(\014rst)g(one,)f(then)i
2473Fl(strfind)e Fn(returns)h Fk(nil)p Fn(.)j(A)e(third)e(optional)g(n)o
2474(umerical)f(argumen)o(t)g(sp)q(eci\014es)j(where)f(to)-42
2475981 y(start)f(the)i(searc)o(h.)j(Another)d(optional)d(n)o(umerical)h
2476(argumen)o(t)f(sp)q(eci\014es)j(where)g(to)e(stop)h(it.)-42
24771101 y Fl(strlen)24 b(\(s\))-42 1187 y Fn(Receiv)o(es)16
2478b(a)f(string)f(and)i(returns)f(its)f(length.)-42 1307
2479y Fl(strsub)24 b(\(s,)f(i,)h([j]\))-42 1392 y Fn(Returns)17
2480b(another)f(string,)f(whic)o(h)h(is)g(a)g(substring)g(of)g
2481Fl(s)p Fn(,)g(starting)e(at)i Fl(i)g Fn(and)g(runing)g(un)o(til)g
2482Fl(j)p Fn(.)23 b(If)16 b Fl(j)g Fn(is)g(absen)o(t,)-42
24831449 y(it)f(is)g(assumed)g(to)f(b)q(e)i(equal)g(to)e(the)i(length)f(of)
2484g Fl(s)p Fn(.)20 b(P)o(articularly)l(,)13 b(the)j(call)e
2485Fl(strsub\(s,1,j\))g Fn(returns)h(a)g(pre\014x)-42 1505
2486y(of)g Fl(s)g Fn(with)g(length)g Fl(j)p Fn(,)f(while)h(the)g(call)g
2487Fl(strsub\(s,i\))e Fn(returns)i(a)g(su\016x)g(of)g Fl(s)p
2488Fn(,)g(starting)e(at)i Fl(i)p Fn(.)-42 1625 y Fl(strlower)23
2489b(\(s\))-42 1711 y Fn(Receiv)o(es)14 b(a)e(string)g(and)h(returns)f(a)h
2490(cop)o(y)f(of)h(that)f(string)f(with)h(all)g(upp)q(er)i(case)f(letters)
2491e(c)o(hanged)i(to)f(lo)o(w)o(er)g(case.)-42 1768 y(All)j(other)g(c)o
2492(haracters)f(are)h(left)g(unc)o(hanged.)-42 1888 y Fl(strupper)23
2493b(\(s\))-42 1974 y Fn(Receiv)o(es)14 b(a)e(string)g(and)h(returns)f(a)h
2494(cop)o(y)f(of)h(that)f(string)f(with)h(all)g(lo)o(w)o(er)f(case)i
2495(letters)f(c)o(hanged)h(to)f(upp)q(er)i(case.)-42 2030
2496y(All)h(other)g(c)o(haracters)f(are)h(left)g(unc)o(hanged.)-42
24972150 y Fl(ascii)24 b(\(s,)f([i]\))-42 2236 y Fn(Returns)16
2498b(the)f(ascii)g(co)q(de)h(of)e(the)i(c)o(haracter)e Fl(s[i])p
2499Fn(.)19 b(If)d Fl(i)f Fn(is)g(absen)o(t,)f(it)h(is)f(assumed)h(to)f(b)q
2500(e)i(1.)-42 2356 y Fl(int2str)23 b(\()p Fi(f)p Fl(i)p
2501Fi(g)p Fl(\))-42 2442 y Fn(Receiv)o(es)e(0)f(or)g(more)f(n)o(um)o(b)q
2502(ers.)34 b(Returns)21 b(a)f(string)f(with)h(length)g(equal)g(to)g(the)g
2503(n)o(um)o(b)q(er)g(of)g(argumen)o(ts,)-42 2498 y(wherein)c(eac)o(h)f(c)
2504o(haracter)g(has)g(ascii)f(v)m(alue)h(equal)g(to)g(its)f(corresp)q
2505(onden)o(t)i(argumen)o(t.)911 2748 y(18)p eop
2506%%Page: 19 19
250719 18 bop -42 199 a Fd(6.3)56 b(Mathematical)20 b(F)-5
2508b(unctions)-42 285 y Fn(This)13 b(library)f(is)h(an)g(in)o(terface)f
2509(to)h(some)e(functions)i(of)g(the)g(standard)g(C)g(math)e(library)l(.)
251019 b(Moreo)o(v)o(er,)11 b(it)i(registers)-42 342 y(a)i(fallbac)o(k)f
2511(for)h(the)g(binary)g(op)q(erator)f Fl(^)h Fn(whic)o(h,)g(when)h
2512(applied)f(to)f(n)o(um)o(b)q(ers)h Fl(x^y)p Fn(,)f(returns)h
2513Fc(x)1619 325 y Fb(y)1639 342 y Fn(.)29 398 y(The)g(library)f(pro)o
2514(vides)h(the)g(follo)o(wing)e(functions:)-42 492 y Fl(abs)24
2515b(acos)f(asin)h(atan)f(atan2)g(ceil)g(cos)h(floor)-42
2516548 y(log)g(log10)f(max)h(min)47 b(mod)g(sin)h(sqrt)23
2517b(tan)-42 642 y Fn(Most)17 b(of)g(them)g(are)g(only)g(in)o(terfaces)g
2518(to)g(the)g(homon)o(ymous)e(functions)j(in)f(the)h(C)f(library)l(,)g
2519(except)h(that,)f(for)-42 699 y(the)f(trigonometri)o(c)d(functions,)h
2520(all)h(angles)f(are)h(expressed)h(in)f(degrees.)29 755
2521y(The)d(function)f Fl(max)g Fn(returns)g(the)g(maxim)o(um)d(v)m(alue)j
2522(of)g(its)f(n)o(umeric)h(argumen)o(ts.)16 b(Similarly)l(,)9
2523b Fl(min)i Fn(computes)-42 811 y(the)16 b(minim)o(um)o(.)h(Both)e(can)g
2524(b)q(e)h(used)g(with)e(an)h(unlimited)f(n)o(um)o(b)q(er)g(of)h(argumen)
2525o(ts.)29 868 y(The)g(function)h Fl(mod)e Fn(is)h(equiv)m(alen)o(t)g(to)
2526f(the)i Fl(\045)f Fn(op)q(erator)f(in)h(C.)-42 990 y
2527Fd(6.4)56 b(I/O)19 b(F)-5 b(acilities)-42 1075 y Fn(All)20
2528b(I/O)g(op)q(erations)f(in)h(Lua)g(are)f(done)i(o)o(v)o(er)e(t)o(w)o(o)
2529f Fm(curr)n(ent)i Fn(\014les,)g(one)g(for)g(reading)f(and)h(one)g(for)f
2530(writing.)-42 1132 y(Initially)l(,)14 b(the)h(curren)o(t)g(input)h
2531(\014le)f(is)g Fl(stdin)p Fn(,)f(and)h(the)g(curren)o(t)g(output)g
2532(\014le)h(is)e Fl(stdout)p Fn(.)29 1188 y(Unless)h(otherwise)g(stated,)
2533f(all)g(I/O)i(functions)f(return)g(1)g(on)g(success)h(and)f
2534Fk(nil)f Fn(on)h(failure.)-42 1308 y Fl(readfrom)23 b(\(filename\))-42
25351394 y Fn(This)e(function)g(op)q(ens)g(a)g(\014le)g(named)f
2536Fl(filename)g Fn(and)h(sets)g(it)f(as)h(the)g Fm(curr)n(ent)f
2537Fn(input)h(\014le.)38 b(When)21 b(called)-42 1451 y(without)c
2538(parameters,)e(this)i(function)g(closes)f(the)i(curren)o(t)f(input)g
2539(\014le,)g(and)h(restores)e Fl(stdin)h Fn(as)f(the)i(curren)o(t)-42
25401507 y(input)e(\014le.)29 1564 y Fm(System)f(dep)n(endent:)k
2541Fn(if)13 b Fl(filename)h Fn(starts)e(with)i(a)g Fl(|)p
2542Fn(,)g(then)g(a)g(pip)q(ed)h(input)g(is)e(op)q(en,)i(via)e(function)i
2543Fl(popen)p Fn(.)-42 1684 y Fl(writeto)23 b(\(filename\))-42
25441769 y Fn(This)13 b(function)g(op)q(ens)h(a)e(\014le)i(named)e
2545Fl(filename)g Fn(and)h(sets)g(it)f(as)h(the)g Fm(curr)n(ent)g
2546Fn(output)g(\014le.)19 b(Notice)12 b(that,)h(if)f(the)-42
25471826 y(\014le)19 b(already)e(exists,)g(it)h(is)f(completely)f(erased)j
2548(with)e(this)g(op)q(eration.)28 b(When)18 b(called)g(without)f
2549(parameters,)-42 1882 y(this)e(function)g(closes)g(the)g(curren)o(t)g
2550(output)g(\014le,)g(and)h(restores)e Fl(stdout)g Fn(as)h(the)g(curren)o
2551(t)g(output)g(\014le.)29 1939 y Fm(System)e(dep)n(endent:)18
2552b Fn(if)12 b Fl(filename)f Fn(starts)g(with)h(a)g Fl(|)p
2553Fn(,)g(then)h(a)f(pip)q(ed)h(output)g(is)e(op)q(en,)j(via)d(function)i
2554Fl(popen)p Fn(.)-42 2059 y Fl(appendto)23 b(\(filename\))-42
25552145 y Fn(This)11 b(function)g(op)q(ens)h(a)f(\014le)g(named)f
2556Fl(filename)g Fn(and)i(sets)f(it)f(as)h(the)g Fm(curr)n(ent)g
2557Fn(output)g(\014le.)19 b(Unlik)o(e)10 b(the)h Fl(writeto)-42
25582201 y Fn(op)q(eration,)16 b(this)f(function)h(do)q(es)h(not)f(erase)f
2559(an)o(y)h(previous)g(con)o(ten)o(t)g(of)f(the)i(\014le.)22
2560b(This)16 b(function)g(returns)g(2)g(if)-42 2258 y(the)g(\014le)f
2561(already)f(exists,)h(1)f(if)h(it)g(creates)g(a)f(new)i(\014le,)f(and)g
2562Fk(nil)f Fn(on)h(failure.)-42 2378 y Fl(remove)24 b(\(filename\))-42
25632463 y Fn(This)15 b(function)g(deletes)h(the)f(\014le)g(with)g(the)g
2564(giv)o(en)g(name.)911 2748 y(19)p eop
2565%%Page: 20 20
256620 19 bop -42 199 a Fl(read)24 b(\([format]\))-42 285
2567y Fn(This)17 b(function)g(returns)f(a)h(v)m(alue)g(read)g(from)e(the)i
2568(curren)o(t)g(input.)25 b(An)17 b(optional)f(string)g(argumen)o(t)f(sp)
2569q(eci\014es)-42 342 y(the)h(w)o(a)o(y)e(the)h(input)g(is)g(in)o
2570(terpreted.)29 398 y(Without)d(a)h(format)d(argumen)o(t,)h
2571Fl(read)i Fn(\014rst)f(skips)h(blanks,)g(tabs)f(and)h(newlines.)19
2572b(Then)14 b(it)e(c)o(hec)o(ks)h(whether)-42 454 y(the)h(curren)o(t)f(c)
2573o(haracter)f(is)h Fl(")g Fn(or)f Fl(')p Fn(.)19 b(If)14
2574b(so,)e(it)h(reads)g(a)f(string)g(up)i(to)f(the)g(ending)g(quotation)f
2575(mark,)f(and)j(returns)-42 511 y(this)h(string,)f(without)g(the)h
2576(quotation)f(marks.)k(Otherwise)d(it)g(reads)g(up)h(to)e(a)h(blank,)g
2577(tab)f(or)h(newline.)29 567 y(The)g(format)e(string)i(can)g(ha)o(v)o(e)
2578g(the)g(follo)o(wing)e(format:)30 658 y Fl(?[n])-42 748
2579y Fn(where)j Fl(?)f Fn(can)g(b)q(e:)-42 839 y Fk('s')i(or)g('S')k
2580Fn(to)15 b(read)g(a)g(string;)-42 931 y Fk('f)5 b(')17
2581b(or)g('F')22 b Fn(to)14 b(read)h(a)g(real)g(n)o(um)o(b)q(er;)-42
25821024 y Fk('i')h(or)i('I')j Fn(to)15 b(read)g(an)g(in)o(teger.)-42
25831114 y(The)e(optional)e Fl(n)h Fn(is)g(a)g(n)o(um)o(b)q(er)g(whic)o(h)g
2584(sp)q(eci\014es)h(ho)o(w)f(man)o(y)f(c)o(haracters)h(m)o(ust)e(b)q(e)j
2585(read)g(to)e(comp)q(ose)h(the)g(input)-42 1171 y(v)m(alue.)21
2586b(P)o(articularly)l(,)12 b(the)k(format)c Fl("s1")j Fn(reads)g(a)g
2587(single)g(c)o(haracter.)-42 1290 y Fl(readuntil)23 b(\(char\))-42
25881376 y Fn(Reads)18 b(the)f(curren)o(t)g(input)g(un)o(til)f(the)g
2589(\014rst)h(o)q(currence)h(of)e(the)h(giv)o(en)f(c)o(haracter.)25
2590b(Returns)17 b(the)g(string)f(read.)-42 1432 y(The)g(c)o(haracter)e
2591(itself)h(is)f(not)h(read.)-42 1552 y Fl(write)24 b(\(value,)f
2592([format]\))-42 1637 y Fn(This)d(function)g(writes)f(the)i(v)m(alue)f
2593(of)g(its)f(\014rst)h(argumen)o(t)e(to)i(the)g(curren)o(t)g(output.)35
2594b(An)20 b(optional)f(second)-42 1694 y(argumen)o(t)13
2595b(sp)q(eci\014es)i(the)f(format)e(to)i(b)q(e)h(used.)20
2596b(This)14 b(format)e(is)i(giv)o(en)f(as)h(a)g(string,)f(comp)q(osed)h
2597(of)g(four)f(parts.)-42 1750 y(The)j(\014rst)f(part)f(is)h(the)g(only)g
2598(one)g(not)g(optional,)f(and)h(m)o(ust)f(b)q(e)i(one)f(of)g(the)g
2599(follo)o(wing)e(c)o(haracters:)-42 1841 y Fk('s')k(or)g('S')k
2600Fn(to)15 b(write)f(strings;)-42 1933 y Fk('f)5 b(')17
2601b(or)g('F')22 b Fn(to)14 b(write)g(\015oats;)-42 2026
2602y Fk('i')i(or)i('I')j Fn(to)15 b(write)f(in)o(tegers.)-42
26032116 y(These)i(c)o(haracters)e(can)i(b)q(e)g(follo)o(w)o(ed)d(b)o(y)30
26042207 y Fl([?][m][.n])-42 2297 y Fn(where:)-42 2388 y
2605Fl(?)23 b Fn(indicates)15 b(justi\014cation)f(inside)h(the)g(\014eld.)
2606100 2480 y(')p Fl(<)p Fn(')22 b(righ)o(t)14 b(justi\014cation)g
2607(\(default\);)100 2552 y(')p Fl(>)p Fn(')22 b(left)15
2608b(justi\014cation;)100 2623 y(')p Fl(|)p Fn(')22 b(cen)o(ter)15
2609b(justi\014cation.)911 2748 y(20)p eop
2610%%Page: 21 21
261121 20 bop -42 199 a Fl(m)23 b Fn(Indicates)16 b(the)f(\014eld)g(size)g
2612(in)g(c)o(haracters.)-42 293 y Fl(.n)23 b Fn(F)l(or)18
2613b(reals,)h(indicates)f(the)h(n)o(um)o(b)q(er)f(of)g(digital)f(places.)
261431 b(F)l(or)18 b(in)o(tegers,)h(it)f(is)g(the)h(minim)o(um)c(n)o(um)o
2615(b)q(er)j(of)72 350 y(digits.)h(This)c(option)f(has)h(no)g(meaning)f
2616(for)h(strings.)29 443 y(When)20 b(called)e(without)g(a)h(format)e
2617(string,)i(this)f(function)h(writes)f(n)o(um)o(b)q(ers)h(using)f(the)i
2618Fl(\045g)e Fn(format)f(and)-42 500 y(strings)e(with)f
2619Fl(\045s)p Fn(.)-42 643 y Fo(7)67 b(Some)22 b(Examples)-42
2620744 y Fn(This)17 b(section)f(giv)o(es)g(examples)g(sho)o(wing)g(some)g
2621(features)g(of)h(Lua.)25 b(It)17 b(do)q(es)g(not)g(in)o(tend)f(to)h(co)
2622o(v)o(er)f(the)h(whole)-42 801 y(language,)e(but)g(only)g(to)f
2623(illustrate)f(some)h(in)o(teresting)g(uses)i(of)e(the)i(system.)-42
2624923 y Fd(7.1)56 b(The)18 b(F)-5 b(unctions)21 b Fa(next)c
2625Fd(and)i Fa(nextvar)-42 1008 y Fn(This)f(example)f(sho)o(ws)g(ho)o(w)h
2626(to)f(use)i(the)f(function)g Fl(next)f Fn(to)h(iterate)f(o)o(v)o(er)g
2627(the)h(\014elds)g(of)g(a)g(table.)28 b(F)l(unction)-42
26281065 y Fm(clone)15 b Fn(receiv)o(es)g(an)o(y)g(table)f(and)i(returns)f
2629(a)g(clone)g(of)g(it.)-42 1159 y Fl(function)23 b(clone)g(\(t\))263
2630b(--)23 b(t)h(is)f(a)h(table)6 1215 y(local)f(new_t)h(=)f({})263
2631b(--)23 b(creates)g(a)h(new)f(table)6 1272 y(local)g(i,)h(v)g(=)f
2632(next\(t,)g(nil\))48 b(--)23 b(i)h(is)f(an)h(index)f(of)h(t,)f(v)h(=)g
2633(t[i])6 1328 y(while)f(i)h(do)54 1385 y(new_t[i])f(=)g(v)54
26341441 y(i,)h(v)f(=)h(next\(t,)f(i\))191 b(--)23 b(get)h(next)f(index)6
26351497 y(end)6 1554 y(return)g(new_t)-42 1610 y(end)29
26361704 y Fn(The)15 b(next)h(example)e(prin)o(ts)g(the)i(names)e(of)g(all)
2637h(global)e(v)m(ariables)i(in)g(the)g(system)f(with)h(non)g(nil)g(v)m
2638(alues:)-42 1798 y Fl(function)23 b(printGlobalVariables)e(\(\))6
26391854 y(local)i(i,)h(v)g(=)f(nextvar\(nil\))6 1911 y(while)g(i)h(do)54
26401967 y(print\(i\))54 2024 y(i,)g(v)f(=)h(nextvar\(i\))6
26412080 y(end)-42 2137 y(end)-42 2258 y Fd(7.2)56 b(String)19
2642b(Manipulation)-42 2344 y Fn(The)d(\014rst)f(example)f(is)g(a)h
2643(function)g(to)g(trim)e(extra)i(blanks)g(at)f(the)h(b)q(eginning)h(and)
2644f(end)h(of)f(a)g(string.)-42 2438 y Fl(function)23 b(trim\(s\))6
26452495 y(local)g(l)h(=)g(1)6 2551 y(while)f(strsub\(s,l,l\))f(==)i(')g(')
2646g(do)54 2607 y(l)g(=)f(l+1)911 2748 y Fn(21)p eop
2647%%Page: 22 22
264822 21 bop 6 199 a Fl(end)6 256 y(local)23 b(r)h(=)g(strlen\(s\))6
2649312 y(while)f(strsub\(s,r,r\))f(==)i(')g(')g(do)54 369
2650y(r)g(=)f(r-1)6 425 y(end)6 482 y(return)g(strsub\(s,l,r\))-42
2651538 y(end)29 631 y Fn(The)15 b(second)h(example)e(sho)o(ws)h(a)g
2652(function)g(that)f(eliminates)f(all)h(blanks)h(of)g(a)g(string.)-42
2653723 y Fl(function)23 b(remove_blanks)f(\(s\))6 780 y(local)h(b)h(=)g
2654(strfind\(s,)e(')i('\))6 836 y(while)f(b)h(do)54 893
2655y(s)g(=)f(strsub\(s,)g(1,)h(b-1\))f(..)h(strsub\(s,)e(b+1\))54
2656949 y(b)i(=)f(strfind\(s,)g(')h('\))6 1006 y(end)6 1062
2657y(return)f(s)-42 1118 y(end)-42 1240 y Fd(7.3)56 b(P)n(ersistence)-42
26581326 y Fn(Because)21 b(of)e(its)g(re\015exiv)o(e)g(facilities,)g(p)q
2659(ersistence)h(in)f(Lua)h(can)g(b)q(e)g(ac)o(hiev)o(ed)g(within)f(the)g
2660(language.)33 b(This)-42 1382 y(section)12 b(sho)o(ws)f(some)g(w)o(a)o
2661(ys)g(to)g(store)g(and)h(retriev)o(e)f(v)m(alues)i(in)e(Lua,)i(using)f
2662(a)f(text)h(\014le)g(written)e(in)i(the)g(language)-42
26631439 y(itself)j(as)f(the)i(storage)e(media.)29 1495 y(T)l(o)h(store)f
2664(a)h(single)g(v)m(alue)g(with)g(a)g(name,)f(the)h(follo)o(wing)e(co)q
2665(de)j(is)e(enough:)-42 1588 y Fl(function)23 b(store)g(\(name,)g
2666(value\))6 1644 y(write\('\\n')g(..)g(name)h(..)f('='\))6
26671701 y(write_value\(value\))-42 1757 y(end)-42 1862 y(function)g
2668(write_value)g(\(value\))6 1918 y(local)g(t)h(=)g(type\(value\))102
26691975 y(if)f(t)h(==)g('nil')94 b(then)24 b(write\('nil'\))6
26702031 y(elseif)f(t)h(==)g('number')e(then)i(write\(value\))6
26712088 y(elseif)f(t)h(==)g('string')e(then)i(write\('[[')e(..)i(value)f
2672(..)h(']]'\))6 2144 y(end)-42 2200 y(end)-42 2305 y Fn(In)16
2673b(order)f(to)g(restore)f(this)h(v)m(alue,)g(a)g Fl(lua_dofile)f
2674Fn(su\016ces.)29 2361 y(Storing)i(tables)h(is)g(a)g(little)e(more)h
2675(complex.)25 b(Assuming)16 b(that)g(the)h(table)g(is)g(a)g(tree,)g(and)
2676g(all)f(indices)i(are)-42 2418 y(iden)o(ti\014ers)13
2677b(\(that)e(is,)i(the)g(tables)f(are)g(b)q(eing)h(used)g(as)g
2678(records\),)f(its)g(v)m(alue)h(can)g(b)q(e)g(written)f(directly)g(with)
2679g(table)-42 2474 y(constructors.)19 b(First,)14 b(the)h(function)g
2680Fl(write_value)f Fn(is)h(c)o(hanged)g(to)-42 2567 y Fl(function)23
2681b(write_value)g(\(value\))6 2623 y(local)g(t)h(=)g(type\(value\))911
26822748 y Fn(22)p eop
2683%%Page: 23 23
268423 22 bop 102 199 a Fl(if)23 b(t)h(==)g('nil')94 b(then)24
2685b(write\('nil'\))6 256 y(elseif)f(t)h(==)g('number')e(then)i
2686(write\(value\))6 312 y(elseif)f(t)h(==)g('string')e(then)i(write\('"')
2687e(..)i(value)f(..)h('"'\))6 369 y(elseif)f(t)h(==)g('table')46
2688b(then)24 b(write_record\(value\))6 425 y(end)-42 482
2689y(end)-42 575 y Fn(The)16 b(function)f Fl(write_record)e
2690Fn(is:)-42 669 y Fl(function)23 b(write_record\(t\))6
2691726 y(local)g(i,)h(v)g(=)f(next\(t,)g(nil\))6 782 y(write\('{'\))47
2692b(--)23 b(starts)g(constructor)6 839 y(while)g(i)h(do)54
2693895 y(store\(i,)f(v\))54 951 y(write\(',)g('\))54 1008
2694y(i,)h(v)f(=)h(next\(t,)f(i\))6 1064 y(end)6 1121 y(write\('}'\))47
2695b(--)23 b(closes)g(constructor)-42 1177 y(end)-42 1299
2696y Fd(7.4)56 b(Inheritance)-42 1385 y Fn(The)15 b(fallbac)o(k)f(for)g
2697(absen)o(t)g(indices)h(can)g(b)q(e)g(used)g(to)f(implemen)o(t)e(man)o
2698(y)h(kinds)i(of)f(inheritance)g(in)h(Lua.)20 b(As)15
2699b(an)-42 1441 y(example,)f(the)h(follo)o(wing)e(co)q(de)j(implemen)o
2700(ts)d(single)h(inheritance:)-42 1535 y Fl(function)23
2701b(Index)g(\(t,f\))6 1592 y(if)h(f)g(==)f('parent')g(then)47
2702b(--)24 b(to)f(avoid)g(loop)54 1648 y(return)g(OldIndex\(t,f\))6
27031704 y(end)6 1761 y(local)g(p)h(=)g(t.parent)6 1817 y(if)g(type\(p\))f
2704(==)g('table')g(then)54 1874 y(return)g(p[f])6 1930 y(else)54
27051987 y(return)g(OldIndex\(t,f\))6 2043 y(end)-42 2100
2706y(end)-42 2213 y(OldIndex)g(=)h(setfallback\("index",)d(Index\))-42
27072306 y Fn(Whenev)o(er)15 b(Lua)g(attempts)d(to)i(access)h(an)f(absen)o
2708(t)g(\014eld)h(in)f(a)g(table,)g(it)g(calls)f(the)i(fallbac)o(k)e
2709(function)h Fl(Index)p Fn(.)19 b(If)-42 2363 y(the)14
2710b(table)e(has)h(a)g(\014eld)h Fl(parent)e Fn(with)h(a)g(table)f(v)m
2711(alue,)i(then)f(Lua)h(attempts)d(to)h(access)i(the)f(desired)g(\014eld)
2712h(in)f(this)-42 2419 y(paren)o(t)i(ob)s(ject.)k(This)c(pro)q(cess)g(is)
2713f(rep)q(eated)h(\\up)o(w)o(ards")f(un)o(til)g(a)h(v)m(alue)g(for)f(the)
2714h(\014eld)g(is)g(found)g(or)f(the)h(ob)s(ject)-42 2476
2715y(has)h(no)f(paren)o(t.)k(In)d(the)f(latter)f(case,)h(the)g(previous)g
2716(fallbac)o(k)f(is)h(called)g(to)f(supply)i(a)e(v)m(alue)i(for)e(the)i
2717(\014eld.)29 2532 y(When)e(b)q(etter)g(p)q(erformance)f(is)g(needed,)i
2718(the)f(same)e(fallbac)o(k)h(ma)o(y)f(b)q(e)i(implemen)o(ted)e(in)i(C,)f
2719(as)g(illustrated)-42 2589 y(in)j(Figure)e(1.)20 b(This)14
2720b(co)q(de)i(m)o(ust)e(b)q(e)i(registered)e(with:)911
27212748 y(23)p eop
2722%%Page: 24 24
272324 23 bop -42 317 1950 6 v -42 411 a Fl(int)24 b(lockedParentName;)45
2724b(/*)24 b(stores)f(the)g(lock)h(index)f(for)g(the)h(string)f("parent")g
2725(*/)-42 467 y(int)h(lockedOldIndex;)93 b(/*)24 b(previous)f(fallback)f
2726(function)h(*/)-42 580 y(void)h(callOldFallback)e(\(lua_Object)g
2727(table,)h(lua_Object)g(index\))-42 637 y({)6 693 y(lua_Object)g
2728(oldIndex)f(=)i(lua_getlocked\(lockedOldIndex)o(\);)6
2729750 y(lua_pushobject\(table\);)6 806 y(lua_pushobject\(index\);)6
2730863 y(lua_callfunction\(oldIndex\);)-42 919 y(})-42 1032
2731y(void)g(Index)f(\(void\))-42 1088 y({)6 1145 y(lua_Object)g(table)g(=)
2732h(lua_getparam\(1\);)6 1201 y(lua_Object)f(index)g(=)h
2733(lua_getparam\(2\);)6 1258 y(lua_Object)f(parent;)6 1314
2734y(if)h(\(lua_isstring\(index\))d(&&)j(strcmp\(lua_getstring\(in)o
2735(dex\),)d("parent"\))h(==)i(0\))6 1371 y({)54 1427 y
2736(callOldFallback\(table,)d(index\);)54 1484 y(return;)6
27371540 y(})6 1597 y(lua_pushobject\(table\);)6 1653 y
2738(lua_pushlocked\(lockedParentN)o(ame\);)6 1709 y(parent)i(=)h
2739(lua_getsubscript\(\);)6 1766 y(if)g(\(lua_istable\(parent\)\))6
27401822 y({)54 1879 y(lua_pushobject\(parent\);)54 1935
2741y(lua_pushobject\(index\);)54 1992 y(/*)g(return)f(result)g(from)g
2742(getsubscript)f(*/)54 2048 y(lua_pushobject\(lua_getsubs)o(cript\(\))o
2743(\);)6 2105 y(})6 2161 y(else)54 2218 y(callOldFallback\(table,)f
2744(index\);)-42 2274 y(})665 2409 y Fn(Figure)15 b(1:)k(Inheritance)d(in)
2745f(C.)p -42 2466 V 911 2748 a(24)p eop
2746%%Page: 25 25
274725 24 bop -42 159 1950 6 v -42 253 a Fl(void)24 b(math_max)f(\(void\))
2748-42 310 y({)-18 366 y(int)h(i=1;)71 b(/*)23 b(number)g(of)h(arguments)f
2749(*/)-18 423 y(double)g(d,)h(dmax;)-18 479 y(lua_Object)f(o;)-18
2750536 y(/*)h(the)f(function)g(must)g(get)h(at)g(least)f(one)g(argument)g
2751(*/)-18 592 y(if)h(\(\(o)f(=)h(lua_getparam\(i++\)\))e(==)h
2752(LUA_NOOBJECT\))30 648 y(lua_error)g(\("too)g(few)g(arguments)g(to)h
2753(function)e(`max'"\);)-18 705 y(/*)i(and)f(this)h(argument)e(must)i(be)
2754f(a)h(number)f(*/)-18 761 y(if)h(\(!lua_isnumber\(o\)\))30
2755818 y(lua_error)f(\("incorrect)f(argument)h(to)g(function)g(`max'"\);)
2756-18 874 y(dmax)h(=)f(lua_getnumber)f(\(o\);)-18 931 y(/*)i(loops)f
2757(until)g(there)g(is)h(no)g(more)f(arguments)g(*/)-18
2758987 y(while)h(\(\(o)f(=)h(lua_getparam\(i++\)\))d(!=)j(LUA_NOOBJECT\))
2759-18 1044 y({)6 1100 y(if)g(\(!lua_isnumber\(o\)\))54
27601157 y(lua_error)f(\("incorrect)f(argument)h(to)g(function)g(`max'"\);)
27616 1213 y(d)h(=)g(lua_getnumber)e(\(o\);)6 1270 y(if)i(\(d)f(>)h(dmax\))
2762f(dmax)h(=)f(d;)-18 1326 y(})-18 1382 y(/*)h(push)f(the)h(result)f(to)g
2763(be)h(returned)f(*/)-18 1439 y(lua_pushnumber)f(\(dmax\);)-42
27641495 y(})623 1631 y Fn(Figure)14 b(2:)20 b(C)15 b(function)g
2765Fl(math)p 1147 1631 15 2 v 16 w(max)p Fn(.)p -42 1687
27661950 6 v 6 1815 a Fl(lua_pushliteral\("parent"\);)6 1871
2767y(lockedParentName)22 b(=)i(lua_lock\(\);)6 1928 y
2768(lua_pushobject\(lua_setfallba)o(ck\("ind)o(ex",)d(Index\)\);)6
27691984 y(lockedOldIndex)h(=)i(lua_lock\(\);)-42 2076 y
2770Fn(Notice)15 b(ho)o(w)g(the)g(string)f Fl("parent")g
2771Fn(is)h(k)o(ept)g(lo)q(c)o(k)o(ed)g(in)g(Lua)h(for)e(optimal)f(p)q
2772(erformance.)-42 2198 y Fd(7.5)56 b(A)19 b(CF)-5 b(unction)-42
27732284 y Fn(A)18 b(CF)l(unction)f(to)f(compute)h(the)g(maxim)o(um)c(of)k
2774(a)g(v)m(ariable)g(n)o(um)o(b)q(er)f(of)h(argumen)o(ts)f(is)h(sho)o(wn)
2775g(in)g(Figure)f(2.)-42 2340 y(After)f(registered)g(with)-42
27762432 y Fl(lua_register)23 b(\("max",)g(math_max\);)-42
27772525 y Fn(this)15 b(function)g(is)g(a)o(v)m(ailable)f(in)h(Lua,)g(as)g
2778(follo)o(ws:)-42 2617 y Fl(i)24 b(=)g(max\(4,)f(5,)h(10,)f(-34\))47
2779b(--)24 b(i)g(receives)e(10)911 2748 y Fn(25)p eop
2780%%Page: 26 26
278126 25 bop -42 199 a Fd(7.6)56 b(Calling)21 b(Lua)e(F)-5
2782b(unctions)-42 285 y Fn(This)17 b(example)e(illustrates)f(ho)o(w)i(a)h
2783(C)f(function)g(can)h(call)e(the)i(Lua)g(function)f Fl(remove_blanks)f
2784Fn(presen)o(ted)i(in)-42 342 y(Section)f(7.2.)-42 435
2785y Fl(void)24 b(remove_blanks)e(\(char)h(*s\))-42 492
2786y({)6 548 y(lua_pushstring\(s\);)45 b(/*)24 b(prepare)f(parameter)g(*/)
27876 605 y(lua_call\("remove_blanks"\);)44 b(/*)24 b(call)f(Lua)h
2788(function)f(*/)6 661 y(strcpy\(s,)g(lua_getstring\(lua_getresu)o
2789(lt\(1\)\)\))o(;)45 b(/*)24 b(copy)f(result)g(back)g(to)h('s')f(*/)-42
2790718 y(})-42 861 y Fo(Ac)n(kno)n(wledgmen)n(ts)-42 962
2791y Fn(The)18 b(authors)f(w)o(ould)g(lik)o(e)f(to)h(thank)h(CENPES/PETR)o
2792(OBR)1073 951 y(\023)1067 962 y(AS)g(whic)o(h,)g(join)o(tly)d(with)i(T)
2793l(eCGraf,)g(used)h(ex-)-42 1019 y(tensiv)o(ely)13 b(early)h(v)o
2794(ersions)f(of)g(this)g(system)g(and)h(ga)o(v)o(e)e(v)m(aluable)i
2795(commen)o(ts.)j(The)d(authors)f(w)o(ould)g(also)g(lik)o(e)g(to)-42
27961075 y(thank)j(Carlos)d(Henrique)j(Levy)l(,)f(who)g(found)h(the)f(name)
2797f(of)h(the)h(game)1204 1059 y Fj(3)1221 1075 y Fn(.)-42
27981218 y Fo(A)68 b(Incompatibiliti)q(es)24 b(with)f(Previous)h(V)-6
2799b(ersions)-42 1320 y Fn(Although)15 b(great)f(care)h(has)g(b)q(een)h
2800(tak)o(en)f(to)f(a)o(v)o(oid)g(incompatibiliti)o(es)e(with)j(the)g
2801(previous)g(public)g(v)o(ersions)f(of)-42 1376 y(Lua,)i(some)e
2802(di\013erences)h(had)g(to)g(b)q(e)h(in)o(tro)q(duced.)k(Here)15
2803b(is)g(a)g(list)f(of)h(all)f(these)h(di\013erences.)-42
28041498 y Fd(Incompatibilities)21 b(with)f(v)n(ersion)f(2.1)27
28051584 y Fi(\017)j Fn(The)16 b(function)g Fl(type)f Fn(no)o(w)h(returns)g
2806(the)g(string)f Fl(function)f Fn(b)q(oth)i(for)g(C)g(and)g(Lua)g
2807(functions.)22 b(Because)72 1640 y(Lua)c(functions)g(and)g(C)g
2808(functions)f(are)h(compatible,)e(this)i(b)q(eha)o(vior)f(is)g(usually)h
2809(more)e(useful.)28 b(When)72 1697 y(needed,)20 b(the)e(second)g(result)
2810g(of)f(function)h Fl(type)f Fn(ma)o(y)f(b)q(e)j(used)g(to)e
2811(distinguish)g(b)q(et)o(w)o(een)h(Lua)h(and)f(C)72 1753
2812y(functions.)27 1847 y Fi(\017)k Fn(A)15 b(function)g(de\014nition)g
2813(only)g(assigns)f(the)h(function)g(v)m(alue)g(to)g(the)g(giv)o(en)f(v)m
2814(ariable)h(at)f(execution)h(time.)-42 1969 y Fd(Incompatibilities)21
2815b(with)f(v)n(ersion)f(1.1)27 2055 y Fi(\017)j Fn(The)16
2816b(equalit)o(y)e(test)g(op)q(erator)h(no)o(w)f(is)h(denoted)h(b)o(y)f
2817Fl(==)p Fn(,)f(instead)h(of)g Fl(=)p Fn(.)27 2148 y Fi(\017)22
2818b Fn(The)13 b(syn)o(tax)f(for)g(table)g(construction)g(has)h(b)q(een)h
2819(greatly)d(simpli\014ed.)18 b(The)13 b(old)f Fl(@\(size\))g
2820Fn(has)g(b)q(een)i(sub-)72 2205 y(stituted)h(b)o(y)h
2821Fl({})p Fn(.)21 b(The)16 b(list)e(constructor)h(\(formerly)e
2822Fl(@[...])p Fn(\))i(and)h(the)f(record)h(constructor)f(\(formerly)72
28232261 y Fl(@{...})p Fn(\))f(no)o(w)g(are)h(b)q(oth)f(co)q(ded)i(lik)o(e)
2824e Fl({...})p Fn(.)19 b(When)c(the)g(construction)f(in)o(v)o(olv)o(es)g
2825(a)g(function)h(call,)e(lik)o(e)72 2318 y(in)i Fl(@func{...})p
2826Fn(,)e(the)i(new)g(syn)o(tax)f(do)q(es)i(not)e(use)h(the)g
2827Fl(@)p Fn(.)20 b(More)14 b(imp)q(ortan)o(t,)e Fm(a)17
2828b(c)n(onstruction)e(function)72 2374 y(must)i(now)f(explicitly)g(r)n
2829(eturn)g(the)g(c)n(onstructe)n(d)g(table)p Fn(.)27 2468
2830y Fi(\017)22 b Fn(The)16 b(function)f Fl(lua_call)f Fn(no)h(longer)f
2831(has)h(the)h(parameter)d Fl(nparam)p Fn(.)p -42 2509
2832780 2 v 10 2536 a Fh(3)28 2552 y Fg(BTW,)f(Lua)i(means)f
2833Fe(mo)n(on)f Fg(in)i(P)o(ortuguese.)911 2748 y Fn(26)p
2834eop
2835%%Page: 27 27
283627 26 bop 27 199 a Fi(\017)22 b Fn(The)g(function)f Fl(lua_pop)g
2837Fn(is)g(no)h(longer)e(a)o(v)m(ailable,)i(since)g(it)f(could)g(lead)g
2838(to)g(strange)g(b)q(eha)o(vior.)39 b(In)72 256 y(particular,)18
2839b(to)h(access)g(results)g(returned)g(from)f(a)g(Lua)i(function,)f(the)h
2840(new)f(macro)e Fl(lua_getresult)72 312 y Fn(should)e(b)q(e)h(used.)27
2841406 y Fi(\017)22 b Fn(The)16 b(old)e(functions)h Fl(lua_storefield)f
2842Fn(and)h Fl(lua_storeindexed)e Fn(ha)o(v)o(e)i(b)q(een)h(replaced)f(b)o
2843(y)72 518 y Fl(int)24 b(lua_storesubscript)d(\(void\);)72
2844631 y Fn(with)15 b(the)g(parameters)e(explicitly)h(pushed)j(on)e(the)g
2845(stac)o(k.)27 725 y Fi(\017)22 b Fn(The)12 b(functionalit)o(y)e(of)i
2846(the)g(function)f Fl(lua_errorfunction)f Fn(has)h(b)q(een)i(replaced)f
2847(b)o(y)g(the)g Fm(fal)r(lb)n(ack)f Fn(mec)o(h-)72 781
2848y(anism;)i(see)j(Section)f(4.8.)27 875 y Fi(\017)22 b
2849Fn(When)16 b(calling)e(a)h(function)h(from)d(the)j(Lua)g(library)l(,)e
2850(parameters)g(passed)h(through)h(the)f(stac)o(k)g(m)o(ust)f(b)q(e)72
2851932 y(pushed)20 b(just)f(b)q(efore)g(the)g(corresp)q(onden)o(t)g(call,)
2852f(with)g(no)h(in)o(termediate)e(calls)g(to)i(Lua.)31
2853b(Sp)q(ecial)19 b(care)72 988 y(should)c(b)q(e)h(tak)o(en)f(with)f
2854(macros)g(lik)o(e)g Fl(lua_getindexed)f Fn(and)j Fl(lua_getfield)p
2855Fn(.)911 2748 y(27)p eop
2856%%Trailer
2857end
2858userdict /end-hook known{end-hook}if
2859%%EOF
doc/refman.ps+3562−0
@@ -0,0 +1,3562 @@
1%!PS-Adobe-2.0
2%%Creator: dvips 5.58 Copyright 1986, 1994 Radical Eye Software
3%%Title: manual.dvi
4%%CreationDate: Tue May 14 15:22:07 1996
5%%Pages: 38
6%%PageOrder: Ascend
7%%BoundingBox: 0 0 612 792
8%%EndComments
9%DVIPSCommandLine: _dvips -o manual.ps manual.dvi
10%DVIPSParameters: dpi=300, comments removed
11%DVIPSSource: TeX output 1996.05.14:1521
12%%BeginProcSet: tex.pro
13/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N
14/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72
15mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1}
16ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
17isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div
18hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul
19TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if}
20forall round exch round exch]setmatrix}N /@landscape{/isls true N}B
21/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B
22/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{
23/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N
24string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N
25end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{
26/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]
27N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup
28length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{
29128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub
30get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data
31dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N
32/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup
33/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx
340 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff
35setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff
36.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]}
37if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup
38length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{
39cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin
400 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul
41add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict
42/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook
43known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X
44/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for
4565781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0
460]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V
47{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7
48getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false}
49ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false
50RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1
51false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform
52round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg
53rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail
54{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M}
55B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{
564 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{
57p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p
58a}B /bos{/SS save N}B /eos{SS restore}B end
59%%EndProcSet
60TeXDict begin 40258431 52099146 1000 300 300
61(/home/lhf/w/lua/distr/lua/doc/manual.dvi) @start /Fa
627 115 df<000FE0007FFC01FFFE03F03E07C00E0F80041F00001F00003E00003E00007C
6300007C00007C0000F80000F80000F80000F80000F80000F80000F80000F800007C00007C
6400007C00003E00003E00001F00001F00010F800307C00703F01F01FFFE007FF8000FE018
65227EA01D>67 D<001FF0007FFC01FFFF03F03F07C00F0F80021F00001F00003E00003C00
66007C00007C0000780000F80000F80000F80000F80000F80000F80000F801FFF801FF7801
67FF7C000F7C000F3C000F3E000F1F000F1F000F0F800F07C00F03F01F01FFFF007FFC001F
68E018227EA01E>71 D<FFFFFFC0FFFFFFC0FFFFFFC0001F0000001F0000001F0000001F00
6900001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F00
7000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F00
7100001F0000001F0000001F0000001F0000001F0000001F0000001F00001A207E9F1F>84
72D<07E03FF87FFC783E601F400F000F000F01FF0FFF3FFF7F0FF80FF00FF00FF00FF83F7F
73FF3FFF1F8F10147E9316>97 D<03F0000FFC001FFE003E1F007C0700780700700380FFFF
7480FFFF80FFFF80F00000F00000F000007000007800003C00803E07801FFF8007FF0001F8
750011147F9314>101 D<007E01FE03FE078207000F000F000F000F000F000F000F00FFF0
76FFF0FFF00F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F00
770F000F20809F0E>I<F0E0F3E0F7E0FFE0FF00FC00F800F800F000F000F000F000F000F0
7800F000F000F000F000F000F0000B147D9310>114 D E /Fb 7 121
79df<07F8001FFE003FFF803E07C03E03C01C01E00001E0003FE003FFE00FFFE03FC1E07C
8001E07801E0F001E0F001E0F001E07803E07C07E03FFFFE1FFEFE03F87E17157E941A>97
81D<01F80007FF000FFF801F07C03C03C07801E07801E0F000F0F000F0FFFFF0FFFFF0FFFF
82F0F000007000007800007C00F03E00F01F03F00FFFE003FFC000FE0014157D941A>101
83D<7F0F8000FF7FE0007FFFF0000FF0F0000FC078000F8078000F0078000F0078000F0078
84000F0078000F0078000F0078000F0078000F0078000F0078000F0078000F0078000F0078
85007FE1FF00FFF3FF807FE1FF00191580941A>110 D<7FC1F8FFC7FC7FDFFE03FE1E03F8
860C03F00003E00003E00003C00003C00003C00003C00003C00003C00003C00003C00003C0
870003C0007FFF80FFFF807FFF8017157F941A>114 D<01C00003C00003C00003C00003C0
880003C00003C0007FFFE0FFFFE0FFFFE003C00003C00003C00003C00003C00003C00003C0
890003C00003C00003C00003C0F003C0F003C0F003C0F001E1E001FFE000FF80003F00141C
907F9B1A>116 D<7FC7FCFFC7FE7FC7FC0F01E00F01E00F01E00F83E00783C00783C00783
91C003C78003C78003C78001C70001EF0001EF0001EF0000FE0000FE0000FE00007C001715
927F941A>118 D<7FC7F87FCFFC7FC7F80787C007C78003EF8001FF0000FE0000FC00007C
9300007C00007C0000FE0001EF0003EF0003C7800783C00F83E07FC7FCFFC7FE7FC7FC1715
947F941A>120 D E /Fc 1 122 df<1E0180370380670380670380C707000E07000E07000E
9507001C0E001C0E001C0E000C1E000E3C0003DC00001C0038380078380078700030C0001F
9600001114808D11>121 D E /Fd 3 121 df<70F8F8F878181818183030606040050E7C84
970D>59 D<0E07E0001F8FF00033F8780063F0380063E03C0063C03C00C780780007807800
9807807800078078000F00F0000F00F0000F00F0000F01E1801E01E3001E03C3001E03C600
991E01CE003C01FC001800F00019147F931B>110 D<07C3C00FE7E0187C603078F06079F0
1006079F0C0F1E000F1C000F00000F00001E00001E00039E00079E030FBC060FBC060F3C0C0
101E7E3807CFF00383C0014147E931A>120 D E /Fe 51 121 df<0007F800007FFE0001FC
1020F0003F01F0007E03F800FC03F800FC03F800FC03F800FC01F000FC004000FC000000FC0
10300000FC00000FFFFFF80FFFFFF80FFFFFF800FC01F800FC01F800FC01F800FC01F800FC0
1041F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC0
1051F800FC01F800FC01F807FF8FFF07FF8FFF07FF8FFF01C237FA21F>12
106D<3C7EFFFFFFFF7E3C08087C8710>46 D<0000180000380000380000700000700000E000
10700E00000E00001C00001C0000380000380000380000700000700000700000E00000E0000
1081C00001C00001C0000380000380000700000700000700000E00000E00001C00001C00001
109C0000380000380000700000700000700000E00000E00000E00001C00001C000038000038
1100000380000700000700000E00000E00000C0000015317DA41C>I<00FE0007FFC00F83E0
1111F01F03E00F83E00F87C007C7C007C7C007CFC007CFC007EFC007EFC007EFC007EFC007E
112FC007EFC007EFC007EFC007EFC007EFC007EFC007EFC007E7C007C7C007C7C007C3E00F8
1133E00F81F01F00F83E007FFC000FE0017207E9F1C>I<00180000780003F800FFF800FFF8
11400FDF80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8
1150001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8
116007FFFE07FFFE07FFFE013207C9F1C>I<03FC000FFF003FFFC0783FE07C0FF0FE07F0FE
11703F8FE03F8FE03F87C03F83803F80003F80003F00007F00007E0000FC0001F80001F0000
1183C0000780000F00001E03803C0380700380600380C00781FFFF03FFFF07FFFF0FFFFF0FF
119FFF0FFFFF015207D9F1C>I<01FE0007FF800FFFE01E07F03F03F03F03F83F83F83F03F8
1201F03F80C03F80003F00007E00007C0001F8001FE0001FF000007E00003F00001F80001FC
1210001FE0001FE7C01FE7C01FEFE01FEFE01FCFE01FC7C03F87C07F03FFFE00FFFC003FE00
12217207E9F1C>I<0000E00001E00003E00007E0000FE0000FE0001FE0003FE00077E000E7
123E000E7E001C7E00387E00707E00E07E00E07E01C07E03807E07007E0E007E0FFFFFFFFFF
124FFFFFFFF0007E00007E00007E00007E00007E00007E000FFFF00FFFF00FFFF18207E9F1C
125>I<2000603C01E03FFFC03FFFC03FFF803FFE003FFC003FF00038000038000038000038
126000039FC003FFF003E0FC03807E03003F00003F00003F00003F80003F83803F87C03F8FC
12703F8FC03F8FC03F0F803F07007E03C0FC03FFF800FFF0003F80015207D9F1C>I<001F80
12800FFE003FFF007F0F00FC1F81F81F83F01F83F01F87E00F07E00007E0000FE0800FE7FC0
129FEFFE0FF81F0FF00F8FF00FCFF00FCFE00FEFE00FEFE00FEFE00FE7E00FE7E00FE7E00FE
1303E00FC3E00FC1F00F80F83F007FFE003FFC000FF0017207E9F1C>I<7000007C00007FFF
131FE7FFFFE7FFFFE7FFFFC7FFFF87FFFF0F00070E000E0E001C0E00380E00700000E00000E
13200001C00003C0000380000780000780000F80000F00001F00001F00001F00001F00003F0
1330003F00003F00003F00003F00003F00003F00001E00017227DA11C>I<00FE0003FFC007
134FFE00F83F01E01F01E00F83E00F83E00F83F00F83F80F83FE1F01FF9E01FFFC00FFF8007
135FFC003FFE00FFFF01F7FF83E1FFC7C07FC7C01FEF800FEF8007EF8003EF8003EF8003E7C
136003C7E00783F01F81FFFF00FFFC001FF0017207E9F1C>I<00FE0007FF800FFFE01F83F0
1373F01F07E00F87E00F8FE00FCFE00FCFE00FCFE00FEFE00FEFE00FEFE00FE7E01FE7E01FE
1383E01FE1F03FE0FFEFE07FCFE0020FE0000FC0000FC1E00FC3F01F83F01F83F01F03F03E0
1391E0FC01FFF800FFE0003F80017207E9F1C>I<00007000000000F800000000F800000000
140F800000001FC00000001FC00000003FE00000003FE00000003FE000000077F000000077F
1410000000F7F8000000E3F8000000E3F8000001C1FC000001C1FC000003C1FE00000380FE0
1420000380FE00000700FF000007007F00000F007F80000FFFFF80000FFFFF80001FFFFFC00
14301C001FC0001C001FC00038000FE00038000FE00078000FF000700007F00FFF007FFF8FF
144F007FFF8FFF007FFF825227EA12A>65 D<0003FE0180001FFF838000FFFFE78001FF00FF
1458003F8003F8007F0001F800FE0000F801FC0000F803F800007803F800007807F80000380
1467F000003807F00000380FF00000000FF00000000FF00000000FF00000000FF00000000FF
14700000000FF00000000FF000000007F000000007F000003807F800003803F800003803F80
1480007801FC00007000FE0000F0007F0001E0003F8003C0001FF00F80000FFFFF000001FFF
149C0000003FE000021227DA128>67 D<FFFFFF8000FFFFFFF000FFFFFFFC0007F003FE0007
150F0007F0007F0003F8007F0001FC007F0000FE007F0000FE007F0000FF007F00007F007F0
1510007F007F00007F007F00007F807F00007F807F00007F807F00007F807F00007F807F000
15207F807F00007F807F00007F807F00007F807F00007F007F00007F007F00007F007F0000F
153E007F0000FE007F0001FC007F0003F8007F0007F0007F003FE00FFFFFFFC00FFFFFFF000
154FFFFFF800025227EA12B>I<FFFFFFFCFFFFFFFCFFFFFFFC07F001FC07F0007C07F0003C
15507F0001C07F0001E07F0001E07F01C0E07F01C0E07F01C0E07F01C0E07F03C0007F07C00
15607FFFC0007FFFC0007FFFC0007F07C0007F03C0007F01C0707F01C0707F01C0707F01C0E
15707F0000E07F0000E07F0001E07F0001E07F0003E07F0007E07F001FCFFFFFFFCFFFFFFFC
158FFFFFFFC20227EA125>I<FFFFFFF8FFFFFFF8FFFFFFF807F003F807F000F807F0007807
159F0003807F0003C07F0003C07F01C1C07F01C1C07F01C1C07F01C1C07F03C0007F07C0007
160FFFC0007FFFC0007FFFC0007F07C0007F03C0007F01C0007F01C0007F01C0007F01C0007
161F0000007F0000007F0000007F0000007F0000007F0000007F00000FFFFC000FFFFC000FF
162FFC0001E227EA123>I<FFFF83FFFEFFFF83FFFEFFFF83FFFE07F0001FC007F0001FC007
163F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0
164001FC007F0001FC007F0001FC007FFFFFFC007FFFFFFC007FFFFFFC007F0001FC007F000
1651FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001F
166C007F0001FC007F0001FC007F0001FC007F0001FC0FFFF83FFFEFFFF83FFFEFFFF83FFFE
16727227EA12C>72 D<FFFF80FFFF80FFFF8007F00007F00007F00007F00007F00007F00007
168F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007
169F00007F00007F00007F00007F00007F00007F00007F00007F00007F000FFFF80FFFF80FF
170FF8011227EA115>I<FFFFC000FFFFC000FFFFC00007F0000007F0000007F0000007F000
1710007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000
1720007F0000007F0000007F0000007F0000007F0003807F0003807F0003807F0003807F000
1737807F0007807F0007807F000F007F001F007F003F007F00FF0FFFFFFF0FFFFFFF0FFFFFF
174F01D227EA122>76 D<FFF800001FFFFFF800001FFFFFFC00003FFF07FC00003FE007FC00
175003FE0077E000077E0077E000077E0073F0000E7E0073F0000E7E0071F8001C7E0071F80
17601C7E0071F8001C7E0070FC00387E0070FC00387E00707E00707E00707E00707E00703F0
1770E07E00703F00E07E00703F00E07E00701F81C07E00701F81C07E00700FC3807E00700FC
1783807E007007E7007E007007E7007E007007E7007E007003FE007E007003FE007E007001F
179C007E007001FC007E007000F8007E0FFF80F80FFFFFFF80F80FFFFFFF80700FFFF30227E
180A135>I<0007FC0000003FFF800000FE0FE00003F803F80007E000FC000FC0007E001FC0
181007F001F80003F003F80003F803F80003F807F00001FC07F00001FC07F00001FC0FF0000
1821FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001F
183E0FF00001FE07F00001FC07F80003FC07F80003FC03F80003F803FC0007F801FC0007F00
1840FE000FE0007F001FC0003F803F80000FE0FE000003FFF80000007FC000023227DA12A>
18579 D<FFFFFF00FFFFFFE0FFFFFFF007F007F807F001FC07F001FE07F000FE07F000FF07
186F000FF07F000FF07F000FF07F000FF07F000FF07F000FE07F001FE07F001FC07F007F807
187FFFFF007FFFFC007F0000007F0000007F0000007F0000007F0000007F0000007F0000007
188F0000007F0000007F0000007F0000007F00000FFFF8000FFFF8000FFFF800020227EA126
189>I<FFFFFE0000FFFFFFC000FFFFFFF00007F007F80007F001FC0007F001FE0007F000FE
1900007F000FF0007F000FF0007F000FF0007F000FF0007F000FF0007F000FE0007F001FE00
19107F001FC0007F007F00007FFFFC00007FFFF000007F00FC00007F007E00007F007F00007
192F003F00007F003F80007F003F80007F003F80007F003F80007F003FC0007F003FC0007F0
19303FC0007F003FC0E07F001FE0EFFFF81FF1CFFFF80FFF8FFFF801FF027227EA12A>82
194D<01FE0607FF8E1FFFFE3F01FE7C007E78003E78001EF8001EF8000EF8000EFC0000FF00
19500FFE0007FFF007FFFC03FFFF01FFFF80FFFFC03FFFE003FFE0003FE00007F00003F0000
1961FE0001FE0001FE0001FF0001EF0003EFC003CFF00FCFFFFF8E7FFE0C0FF8018227DA11F
197>I<7FFFFFFF807FFFFFFF807FFFFFFF807E03F81F807C03F807807803F807807003F803
19880F003F803C0F003F803C0E003F801C0E003F801C0E003F801C0E003F801C00003F80000
1990003F800000003F800000003F800000003F800000003F800000003F800000003F8000000
20003F800000003F800000003F800000003F800000003F800000003F800000003F800000003
201F800000003F800000003F8000001FFFFF00001FFFFF00001FFFFF00022227EA127>I<FF
202FF001FFEFFFF001FFEFFFF001FFE07F00001C007F80003C003F800038003FC00078001FC
20300070001FC00070000FE000E0000FE000E0000FF001E00007F001C00007F803C00003F80
2043800003F803800001FC07000001FC07000001FE0F000000FE0E000000FF0E0000007F1C0
205000007F1C0000007FBC0000003FB80000003FF80000001FF00000001FF00000000FE0000
2060000FE00000000FE000000007C000000007C0000000038000027227FA12A>86
207D<0FFE003FFF807E07E07E03F07E01F07E01F83C01F80001F80001F800FFF807FFF81FE1
208F83F01F87E01F8FC01F8FC01F8FC01F8FC01F87E03F87E0EFF1FFCFF07F03F18167E951B
209>97 D<FF800000FF800000FF8000001F8000001F8000001F8000001F8000001F8000001F
2108000001F8000001F8000001F8000001F8000001F8FE0001FFFF8001FF07C001FC03E001F
211801F001F800F801F800F801F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F
212800FC01F800FC01F800F801F801F801F801F001FC03E001FE07C001E7FF8001C0FC0001A
213237EA21F>I<00FF8007FFE00F83F01F03F03E03F07E03F07C01E07C0000FC0000FC0000
214FC0000FC0000FC0000FC00007C00007E00007E00003E00381F00700FC0F007FFC000FF00
21515167E9519>I<0001FF000001FF000001FF0000003F0000003F0000003F0000003F0000
216003F0000003F0000003F0000003F0000003F0000003F0001FE3F0007FFBF000F81FF001F
217007F003E003F007E003F007C003F00FC003F00FC003F00FC003F00FC003F00FC003F00FC
218003F00FC003F00FC003F007C003F007C003F003E003F001F00FF000F83FFE007FFBFE001
219FC3FE01B237EA21F>I<00FE0007FF800F87C01E01E03E01F07C00F07C00F8FC00F8FC00
220F8FFFFF8FFFFF8FC0000FC0000FC00007C00007C00007E00003E00381F00700FC0F003FF
221C000FF0015167E951A>I<001F8000FFE001F1F003E3F007E3F00FC3F00FC1E00FC0000F
222C0000FC0000FC0000FC0000FC000FFFE00FFFE00FFFE000FC0000FC0000FC0000FC0000F
223C0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0007F
224FC007FFC007FFC00142380A211>I<01FE1F0007FFFF800F87E7801F03E7801E01E7003E
22501F0003E01F0003E01F0003E01F0003E01F0001E01E0001F03E0000F87C0000FFF800019
226FE0000180000001C0000001C0000001FFFE0001FFFF8000FFFFE000FFFFF003FFFFF007C
227003F80F8001F80F8000F80F8000F80F8000F807C001F007E003F001F80FC000FFFF80001
228FFC00019217F951C>I<FF800000FF800000FF8000001F8000001F8000001F8000001F80
22900001F8000001F8000001F8000001F8000001F8000001F8000001F87E0001F9FF8001FB8
230FC001FE07C001FC07E001FC07E001F807E001F807E001F807E001F807E001F807E001F80
2317E001F807E001F807E001F807E001F807E001F807E001F807E001F807E00FFF1FFC0FFF1
232FFC0FFF1FFC01A237EA21F>I<1E003F007F807F807F807F803F001E0000000000000000
2330000000000FF80FF80FF801F801F801F801F801F801F801F801F801F801F801F801F801F
234801F801F801F80FFF0FFF0FFF00C247FA30F>I<003C007E00FF00FF00FF00FF007E003C
23500000000000000000000000003FF03FF03FF003F003F003F003F003F003F003F003F003F
236003F003F003F003F003F003F003F003F003F003F003F003F003F783FFC3FFC3EFC7E78FC
2377FF01FC0102E83A311>I<FF800000FF800000FF8000001F8000001F8000001F8000001F
2388000001F8000001F8000001F8000001F8000001F8000001F8000001F83FF801F83FF801F
23983FF801F80F0001F83E0001F8780001F8F00001F9E00001FBE00001FFE00001FFF00001F
240FF80001FCFC0001F8FC0001F87E0001F83F0001F83F0001F81F8001F80FC00FFF1FFC0FF
241F1FFC0FFF1FFC01A237EA21E>I<FF80FF80FF801F801F801F801F801F801F801F801F80
2421F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F80
2431F801F801F80FFF0FFF0FFF00C237FA20F>I<FF87F00FE000FF9FFC3FF800FFB87E70FC
244001FE03EC07C001FC03F807E001FC03F807E001F803F007E001F803F007E001F803F007E
245001F803F007E001F803F007E001F803F007E001F803F007E001F803F007E001F803F007E
246001F803F007E001F803F007E001F803F007E001F803F007E00FFF1FFE3FFC0FFF1FFE3FF
247C0FFF1FFE3FFC02A167E952F>I<FF87E000FF9FF800FFB8FC001FE07C001FC07E001FC0
2487E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F80
2497E001F807E001F807E001F807E001F807E00FFF1FFC0FFF1FFC0FFF1FFC01A167E951F>
250I<00FE0007FFC00F83E01E00F03E00F87C007C7C007C7C007CFC007EFC007EFC007EFC00
2517EFC007EFC007EFC007E7C007C7C007C3E00F81F01F00F83E007FFC000FE0017167E951C
252>I<FF8FE000FFFFF800FFF07C001FC03E001F801F001F801F801F801F801F800FC01F80
2530FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F801F801F801F801F80
2543F001FC03E001FE0FC001FFFF8001F8FC0001F8000001F8000001F8000001F8000001F80
25500001F8000001F800000FFF00000FFF00000FFF000001A207E951F>I<FF0F80FF1FE0FF
25633F01F63F01FC3F01FC3F01FC1E01F80001F80001F80001F80001F80001F80001F80001F
25780001F80001F80001F80001F8000FFF800FFF800FFF80014167F9517>114
258D<07F3001FFF00781F00700F00F00700F00700F80000FF0000FFF0007FFC003FFE001FFF
2590007FF00003F80E00F80E00780F00780F00780F80700FC1E00FFFC00C7F00011167E9516
260>I<01C00001C00001C00001C00003C00003C00003C00007C00007C0000FC0003FFF00FF
261FF00FFFF000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000F
262C3800FC3800FC3800FC3800FC3800FC30007E70003FE0000FC0011207F9F16>I<FF83FE
26300FF83FE00FF83FE001F807E001F807E001F807E001F807E001F807E001F807E001F807E
264001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F80FE001F80FE
265000F83FFC007FF7FC001FC7FC01A167E951F>I<FFF03FE0FFF03FE0FFF03FE00FC00E00
2660FE01E0007E01C0007E01C0003F0380003F0380003F8780001F8700001FCF00000FCE000
26700FCE000007FC000007FC000007FC000003F8000003F8000001F0000001F0000000E0000
2681B167F951E>I<FFE3FF8FF8FFE3FF8FF8FFE3FF8FF81FC07C03C00FC0FE03800FC0FE03
269800FE0FF078007E1FF070007E1DF070003F1DF8E0003F38F8E0003F38F8E0001FB8FDC00
27001FF07DC0001FF07FC0000FF07F80000FE03F80000FE03F800007E03F000007C01F00000
2713C01E000003800E00025167F9528>I<FFF0FFE0FFF0FFE0FFF0FFE007E0780007F0F000
27203F8F00001F9E00000FFC00000FF8000007F0000003F0000001F8000003FC000007FE000
27300F7F00001E3F00001C1F80003C0FC000780FE00FFC1FFE0FFC1FFE0FFC1FFE01B167F95
2741E>I E /Ff 1 98 df<03CC0E2E183C381C301C701CE038E038E038E038C073C073C0F3
27560F263361E1C10107C8F14>97 D E /Fg 2 104 df<003C00E001C00380038003800380
27603800380038003800380038003800380038007001E00F8001E0007000380038003800380
27703800380038003800380038003800380038001C000E0003C0E257E9B13>102
278D<F8001E000700038003800380038003800380038003800380038003800380038001C000
279E0003C00E001C0038003800380038003800380038003800380038003800380038007001E
28000F8000E257E9B13>I E /Fh 30 122 df<00FC000383000603800E07801C07801C0300
2811C00001C00001C00001C0000FFFF80FFFF801C03801C03801C03801C03801C03801C0380
2821C03801C03801C03801C03801C03801C0380FF8FF0FF8FF0141A809915>12
283D<70F8FCFC7404040808102040060C7D990B>39 D<70F0F8F87808081010102040050C7D
284840B>44 D<70F8F8F87005057D840B>46 D<07E01C38381C381C700E700E700EF00FF00F
285F00FF00FF00FF00FF00FF00FF00FF00F700E700E700E381C381C1C3807E010187F9713>
28648 D<07E01FF8383C781C781E781E301E001E001C0038007007E00038001C000E000F00
2870F700FF80FF80EF01E703C3FF80FE010187F9713>51 D<70F8F8F87000000000000070F0
288F8F8780808101010204005177D8F0B>59 D<000C0000001E0000001E0000001E0000003F
2890000003F0000003F000000678000006780000067800000C3C00000C3C00000C3C0000181
290E0000181E0000181E0000300F00003FFF00007FFF80006007800060078000E007C000C00
2913C001E003C00FF81FFC0FF81FFC01A1A7F991D>65 D<07C21FF6383E701E600EE006E006
292E006F000F8007F803FF01FF80FFC01FE001E000F0007C007C007C007E006F00EFC1CDFF8
29387E0101A7E9915>83 D<FEFEC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0
294C0C0C0C0C0C0C0C0C0FEFE07257D9B0B>91 D<FEFE060606060606060606060606060606
295060606060606060606060606060606060606FEFE0725809B0B>93
296D<1FC000707000783800781C00301C00001C0003FC001F1C003C1C00781C00F01C00F01D
29780F01D80F03D80785D801F8F0011107F8F13>97 D<FC0000FC00001C00001C00001C0000
2981C00001C00001C00001C00001C00001CFC001F07001E03801C03C01C01C01C01E01C01E0
2991C01E01C01E01C01E01C01E01C01C01C03801E03001F060018F800131A809915>I<07F0
3001C1C383C783C7018F000F000F000F000F000F0007000780C380C1C3807E00E107F8F11>
301I<003F00003F0000070000070000070000070000070000070000070000070003E7000C1F
30200180F00380700700700F00700F00700F00700F00700F00700F00700700700780700380F
303001C3FE007E7E0131A7F9915>I<07C01C7038387038701CF01CFFFCF000F000F000F000
3047000780C38081C3807E00E107F8F11>I<01F007180E3C0C3C1C181C001C001C001C001C
30500FFC0FFC01C001C001C001C001C001C001C001C001C001C001C001C00FF80FF800E1A80
306990C>I<0FC700387B80703B80F03C00F03C00F03C00F03C007038003870006FC0004000
307004000006000007FF0003FFC003FFE00600F00C00300C00300C00300C00300600600381C
3080007E00011187F8F13>I<387C7C7C380000000000FCFC1C1C1C1C1C1C1C1C1C1C1C1CFF
309FF081A80990A>105 D<FC00FC001C001C001C001C001C001C001C001C001C001C001C00
3101C001C001C001C001C001C001C001C001C001C001C00FF80FF80091A80990A>108
311D<FC7C1F00FD8E63801E0781C01E0781C01C0701C01C0701C01C0701C01C0701C01C0701
312C01C0701C01C0701C01C0701C01C0701C01C0701C0FF9FE7F8FF9FE7F81D107F8F20>I<
313FC7C00FD87001E03801E03801C03801C03801C03801C03801C03801C03801C03801C0380
3141C03801C0380FF9FF0FF9FF01410808F15>I<07E01C38381C700E700EF00FF00FF00FF0
3150FF00FF00F700E700E381C1C3807E010107F8F13>I<FCFC00FF07001E03801C03C01C03
316C01C01E01C01E01C01E01C01E01C01E01C01E01C03C01C03801E07001F0E001CF8001C00
317001C00001C00001C00001C0000FF8000FF80001317808F15>I<FCF0FD1C1E3C1E3C1C18
3181C001C001C001C001C001C001C001C001C00FF80FF800E10808F0F>114
319D<1F2060E04060C060C060F0007F003FC01FE000F0C070C030E030E020F0408F800C107F
3208F0F>I<18001800180018001800180038007FC0FFC03800380038003800380038003800
321386038603860386038601CC007800B177F960F>I<FC1F80FC1F801C03801C03801C0380
3221C03801C03801C03801C03801C03801C03801C03801C07800C07800E0BF003F3F0141080
3238F15>I<FE3F80FE3F803C0E001C0C001C0C000E18000E18000E18000730000730000770
3240003E00003E00001C00001C00001C00011107F8F14>I<FE3F80FE3F803C0E001C0C001C
3250C000E18000E18000E180007300007300007700003E00003E00001C00001C00001C00001
3268000018000618000F30000F30000E6000078000011177F8F14>121
327D E /Fi 3 51 df<00C00000C00000C00000C00000C00000C00000C00000C00000C000FF
328FF80FFFF8000C00000C00000C00000C00000C00000C00000C00000C00000C00011147E8F
32917>43 D<0C007C009C001C001C001C001C001C001C001C001C001C001C001C001C00FF80
33009107E8F0F>49 D<1F006180C0C0E0E0E0E000E000C001C0018003000400082010203FC0
3317FC0FFC00B107F8F0F>I E /Fj 5 107 df<03F0000FFC001FFE003FFF007FFF807FFF80
332FFFFC0FFFFC0FFFFC0FFFFC0FFFFC0FFFFC07FFF807FFF803FFF001FFE000FFC0003F000
33312127E9317>15 D<00000006000000000600000000060000000003000000000300000000
3340380000000018000000000C0000000006000000000700000000018FFFFFFFFFFFFFFFFFF
335FF00000000180000000070000000006000000000C0000000018000000003800000000300
336000000030000000006000000000600000000060028187E962D>33
337D<001F007F00F801E003C003C003C003C003C003C003C003C003C003C003C003C003C003
338C003C007800F00FE00F800FE000F00078003C003C003C003C003C003C003C003C003C003
339C003C003C003C003C003C001E000F8007F001F102D7DA117>102
340D<F800FE001F00078003C003C003C003C003C003C003C003C003C003C003C003C003C003
341C003C001E000F0007F001F007F00F001E003C003C003C003C003C003C003C003C003C003
342C003C003C003C003C003C007801F00FE00F800102D7DA117>I<C0C0C0C0C0C0C0C0C0C0
343C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C002
3442D7BA10D>106 D E /Fk 2 51 df<06001E00FE00EE000E000E000E000E000E000E000E
345000E000E000E000E000E000E000E000E00FFE0FFE00B157D9412>49
346D<1F803FE070F0F870F878F838703800780070007000E001C00180030006000C18101820
347387FF0FFF0FFF00D157E9412>I E /Fl 52 122 df<000FF000007FF80001F81C0003E0
3483E0007E07E000FC07E000FC07E000FC07E000FC03C000FC000000FC000000FC1FF00FFFF
349FF00FFFFFF00FFFFFF000FC03F000FC03F000FC03F000FC03F000FC03F000FC03F000FC0
3503F000FC03F000FC03F000FC03F000FC03F000FC03F000FC03F000FC03F007FF9FFE07FF9
351FFE07FF9FFE01B20809F1D>12 D<3C03C07E07E0FF0FF0FF8FF8FF8FF8FF8FF87F87F83D
35283D80180180380380300300300300600600E00E01C01C038038030030015117E9F1B>34
353D<3C007E00FF00FF80FF80FF807F803D80018003800300030006000E001C003800300009
354117D9F0F>39 D<3C7EFFFFFFFF7E3C08087D870F>46 D<00380000F80007F800FFF800FF
355F800F9F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001
356F80001F80001F80001F80001F80001F80001F80001F80001F80001F8007FFFE07FFFE07F
357FFE0131D7D9C1A>49 D<03FC001FFF803FFFC07C1FE0FE07F0FE03F0FE03F8FE01F87C01
358F83801F80003F80003F00007E00007E0000FC0001F00003E00007C0000F00001E0380380
359380700380E00781FFFF83FFFF07FFFF0FFFFF0FFFFF0FFFFF0151D7E9C1A>I<03FC000F
360FF801FFFC03C0FE07E07F07E03F07E03F07E03F03C07F00007E0000FC0001F8003FE0003
361FC00000F800007E00003F00003F00003F83803F87C03F8FE03F8FE03F8FE03F0FC07F07C
3620FE03FFFC01FFF0003FC00151D7E9C1A>I<0001E00003E00003E00007E0000FE0001FE0
363003BE00073E000F3E001E3E001C3E00383E00703E00E03E01C03E03803E07803E0F003E0
364FFFFFEFFFFFEFFFFFE0007E00007E00007E00007E00007E000FFFE00FFFE00FFFE171D7F
3659C1A>I<3800E03FFFE03FFFC03FFF803FFF003FFC003FC0003800003800003800003800
3660039FC003FFF803E07C03803E01003F00003F00003F80003F87803F8FC03F8FC03F8FC03
367F8FC03F07807E07C0FE03FFFC00FFF0003F800151D7E9C1A>I<003F0001FFC007FFE00F
368C1E01F03F01E03F03E03F07E03F07C01E07C0000FC1000FCFF00FDFFC0FF03E0FE01F0FE
36901F0FC01F8FC01F8FC01F8FC01F87C01F87C01F87C01F83C01F03E01F01F03E00FFFC007
370FF8001FC00151D7E9C1A>I<7000007FFFF87FFFF87FFFF87FFFF07FFFE0FFFFC0F00380
371E00700E00E00E00E00001C0000380000780000700000F00000F00001F00001E00003E000
37203E00003E00007E00007E00007E00007E00007E00007E00003C000018000151E7D9D1A>
373I<01FE0007FF801FFFC03E07E03C03F07C01F07C01F07E01F07F81F07FE3E03FF3C03FFF
374801FFF000FFF8007FFC01FFFE03E7FF07C1FF87807F8F803F8F801F8F800F8F800F8F800
375F07C01F07F03E03FFFC00FFF8003FC00151D7E9C1A>I<0000E000000001F000000001F0
37600000003F800000003F800000003F800000007FC00000007FC0000000FFE0000000EFE00
37700000EFE0000001C7F0000001C7F0000003C7F800000383F800000383F800000701FC000
37800701FC00000F01FE00000E00FE00000FFFFE00001FFFFF00001FFFFF00003C007F80003
3798003F800038003F800070001FC00070001FC00FFF01FFFE0FFF01FFFE0FFF01FFFE0231F
3807E9E28>65 D<FFFFFE00FFFFFFC0FFFFFFE007E007F007E003F807E001FC07E001FC07E0
38101FC07E001FC07E001FC07E001FC07E001F807E003F007E00FE007FFFF8007FFFFE007E0
38203F007E001F807E000FC07E000FC07E000FE07E000FE07E000FE07E000FE07E000FE07E0
38301FC07E001FC07E007F8FFFFFFF0FFFFFFE0FFFFFF001F1F7E9E25>I<0007F806007FFF
3840E01FFFFDE03FE03FE07F000FE0FC0007E1F80003E3F80001E3F00001E7F00000E7E0000
3850E7E00000EFE000000FE000000FE000000FE000000FE000000FE000000FE0000007E0000
386007E00000E7F00000E3F00000E3F80001C1F80001C0FC0003807F0007803FE03F001FFFF
387C0007FFF800007FC001F1F7D9E26>I<FFFFFE0000FFFFFFC000FFFFFFF00007F007F800
38807F001FC0007F000FE0007F0007F0007F0003F0007F0003F8007F0001F8007F0001F8007
389F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0001FC007F0
390001FC007F0001FC007F0001F8007F0001F8007F0003F8007F0003F0007F0007F0007F000
3917E0007F001FC0007F007F800FFFFFFF000FFFFFFC000FFFFFE0000221F7E9E28>I<FFFF
392FFE0FFFFFFE0FFFFFFE007F007E007F003E007F001E007F000F007F000F007F0707007F0
393707007F0707007F0707007F1F00007FFF00007FFF00007FFF00007F1F00007F0700007F0
394701C07F0701C07F0701C07F0003807F0003807F0003807F0007807F0007807F001F807F0
39507F8FFFFFFF0FFFFFFF0FFFFFFF01E1F7E9E22>I<FFFFFFE0FFFFFFE0FFFFFFE007F007
396E007F003E007F001E007F000F007F000F007F0007007F0707007F0707007F0707007F070
3970007F1F00007FFF00007FFF00007FFF00007F1F00007F0700007F0700007F0700007F070
3980007F0000007F0000007F0000007F0000007F0000007F00000FFFFC000FFFFC000FFFFC0
399001C1F7E9E21>I<FFFF80FFFF80FFFF8007F00007F00007F00007F00007F00007F00007
400F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007
401F00007F00007F00007F00007F00007F00007F000FFFF80FFFF80FFFF80111F7F9E14>73
402D<FFFFC000FFFFC000FFFFC00007F0000007F0000007F0000007F0000007F0000007F000
4030007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000
4040007F001C007F001C007F001C007F001C007F003C007F003C007F0078007F0078007F00F
4058007F03F80FFFFFF80FFFFFF80FFFFFF801A1F7E9E1F>76 D<001FF80000FFFF0001F81F
4068007E007E00FC003F01F8001F81F0000F83F0000FC7F0000FE7E00007E7E00007EFE0000
4077FFE00007FFE00007FFE00007FFE00007FFE00007FFE00007FFE00007FFE00007F7E0000
4087E7F0000FE7F0000FE3F0000FC3F8001FC1F8001F80FC003F007E007E001F81F8000FFFF
40900001FF800201F7D9E27>79 D<FFFFFE00FFFFFF80FFFFFFE007F00FF007F003F807F001
410F807F001FC07F001FC07F001FC07F001FC07F001FC07F001FC07F001F807F003F007F00F
411F007FFFFC007FFFF0007F0000007F0000007F0000007F0000007F0000007F0000007F000
4120007F0000007F0000007F0000007F00000FFFF8000FFFF8000FFFF80001E1F7E9E24>I<
413001FF80000FFFF0001F81F8007E007E00FC003F01F8001F81F8001F83F0000FC7F0000FE
4147F0000FE7E00007EFE00007FFE00007FFE00007FFE00007FFE00007FFE00007FFE00007F
415FE00007FFE00007F7E00007E7E00007E7F0000FE3F0000FC3F87C1FC1F8FE1F80FD833F0
41607F81FE001F81F8000FFFF00001FFE0300000E0300000F0700000FFF000007FF000007FE
417000007FE000003FC000001F8000000F020287D9E27>I<FFFFF80000FFFFFF8000FFFFFF
418C00007F00FF00007F003F80007F001F80007F001FC0007F001FC0007F001FC0007F001FC
4190007F001FC0007F001F80007F003F00007F00FE00007FFFF800007FFFF000007F03F8000
42007F00FC00007F00FE00007F007F00007F007F00007F007F00007F007F00007F007F00007
421F007F00007F007F02007F007F07007F003F070FFFF81F8E0FFFF80FFC0FFFF803F80241F
4227E9E27>I<03FC180FFF381FFFF83E03F87C00F8780078F80078F80038F80038FC0000FF
4230000FFF8007FFF007FFFC03FFFE01FFFF00FFFF803FFF8001FFC0001FC0000FC00007CE0
424007CE0007CE0007CF00078F800F8FE01F0FFFFE0EFFFC0C1FF00161F7D9E1D>I<7FFFFF
425FC7FFFFFFC7FFFFFFC7E0FE0FC780FE03C700FE01CF00FE01EF00FE01EE00FE00EE00FE0
4260EE00FE00EE00FE00E000FE000000FE000000FE000000FE000000FE000000FE000000FE0
42700000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE00007FFFF
428C007FFFFC007FFFFC01F1E7E9D24>I<FFFF007FF8FFFF007FF8FFFF007FF807F0000700
42907F8000F0003F8000E0003FC000E0001FC001C0001FC001C0001FE003C0000FE00380000
430FF007800007F007000007F807000003F80E000003F80E000001FC1C000001FC1C000001F
431E3C000000FE38000000FF780000007F700000007FF00000003FE00000003FE00000003FE
43200000001FC00000001FC00000000F800000000F800000000700000251F7F9E28>86
433D<0600600E00E01C01C0380380300300600600600600E00E00C00C00DE0DE0FF0FF0FF8F
434F8FF8FF8FF8FF87F87F83F03F01E01E015117D9F1B>92 D<07FC001FFF803F0FC03F07E0
4353F03F03F03F00C03F00003F001FFF00FFFF01F83F07E03F07C03F0F803F0F803F0F803F0
436FC07F07E0DFE3FF8FE07E07E17147F9319>97 D<FF800000FF800000FF8000001F800000
4371F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8FE000
4381FFFF8001FF07C001FC03E001F803F001F801F001F801F001F801F801F801F801F801F80
4391F801F801F801F801F801F801F801F001F801F001F803E001FC03E001FE0FC001E7FF000
4401C1FC00019207F9F1D>I<01FE0007FF801F0FC03E0FC03E0FC07C0FC07C0300FC0000FC
4410000FC0000FC0000FC0000FC00007C00007E00003E00E03F01C01F83C007FF8001FC0013
442147E9317>I<0007FC000007FC000007FC000000FC000000FC000000FC000000FC000000
443FC000000FC000000FC000000FC000000FC0001FCFC000FFFFC001F83FC003E00FC007E00
444FC007C00FC007C00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC007C00
445FC007C00FC007E00FC003E01FC001F07FF800FFFFF8003F8FF8019207E9F1D>I<01FE00
44607FF800F83C01E01E03E00F07C00F07C00F8FC00F8FFFFF8FFFFF8FC0000FC0000FC0000
4477C00007C00003E00381E00380F80F007FFE000FF8015147F9318>I<003F8000FFC003F3
448E007E7E007C7E00FC7E00FC3C00FC0000FC0000FC0000FC0000FC000FFFC00FFFC00FFFC
449000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0
450000FC0000FC0007FFC007FFC007FFC0013207F9F10>I<03FC7C0FFFFE1E07DE3C03DE7C
45103EC7C03E07C03E07C03E07C03E03C03C01E07801FFF0033FC003000007000007800007F
452FF803FFFF03FFFF81FFFFC3FFFFC7C00FEF8003EF8003EF8003EF8003E7C007C3F01F80F
453FFE003FF80171E7F931A>I<FF800000FF800000FF8000001F8000001F8000001F800000
4541F8000001F8000001F8000001F8000001F8000001F8000001F87F0001F9FF8001FB8FC00
4551FE07E001FC07E001FC07E001F807E001F807E001F807E001F807E001F807E001F807E00
4561F807E001F807E001F807E001F807E001F807E00FFF3FFC0FFF3FFC0FFF3FFC01A207E9F
4571D>I<1E003F007F807F807F807F803F001E0000000000000000000000FF80FF80FF801F
458801F801F801F801F801F801F801F801F801F801F801F801F801F80FFF0FFF0FFF00C217E
459A00F>I<FF800000FF800000FF8000001F8000001F8000001F8000001F8000001F800000
4601F8000001F8000001F8000001F8000001F83FF001F83FF001F83FF001F81E0001F83C000
4611F8780001F9E00001FBC00001FFE00001FFF00001FDF00001F9F80001F0FC0001F07E000
4621F03E0001F03F0001F01F800FFE3FF80FFE3FF80FFE3FF8019207F9F1C>107
463D<FF80FF80FF801F801F801F801F801F801F801F801F801F801F801F801F801F801F801F
464801F801F801F801F801F801F801F801F801F801F801F80FFF0FFF0FFF00C207E9F0F>I<
465FF07F00FE000FF1FFC3FF800FF387E70FC001F603FC07E001FC03F807E001FC03F807E00
4661F803F007E001F803F007E001F803F007E001F803F007E001F803F007E001F803F007E00
4671F803F007E001F803F007E001F803F007E001F803F007E001F803F007E00FFF1FFE3FFC0
468FFF1FFE3FFC0FFF1FFE3FFC02A147E932D>I<FF07F000FF1FF800FF38FC001F607E001F
469C07E001FC07E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F
470807E001F807E001F807E001F807E00FFF3FFC0FFF3FFC0FFF3FFC01A147E931D>I<01FF
4710007FFC01F83F03E00F83E00F87C007C7C007CFC007EFC007EFC007EFC007EFC007EFC00
4727E7C007C7C007C3E00F83E00F81F83F007FFC001FF0017147F931A>I<FF8FE000FFFFF8
47300FFF0FC001FC07E001F803F001F803F001F801F001F801F801F801F801F801F801F801F
474801F801F801F801F801F801F001F803F001F803E001FC07E001FE0FC001FFFF0001F9FC0
475001F8000001F8000001F8000001F8000001F8000001F800000FFF00000FFF00000FFF000
47600191D7F931D>I<01F81C0007FE3C001F87FC003F01FC003E00FC007E00FC007C00FC00
477FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC007C00FC007E00FC007E00FC00
4783F01FC001F87FC000FFEFC0003F8FC000000FC000000FC000000FC000000FC000000FC00
4790000FC000007FF800007FF800007FF80191D7E931C>I<FF1F00FF3FC0FF67E01FC7E01F
480C7E01FC7E01F81801F80001F80001F80001F80001F80001F80001F80001F80001F80001F
4818000FFF800FFF800FFF80013147F9316>I<0FE63FFE783E700EF00EF00EFE00FFE07FF8
4823FFC1FFE0FFF007FE01FE00FF00FF00EFC1EFFFCC7F010147E9315>I<03800380038003
483800780078007800F801F803FFCFFFCFFFC1F801F801F801F801F801F801F801F801F801F
4848E1F8E1F8E1F8E1F8E0F9C07F803F00F1D7F9C14>I<FF83FE00FF83FE00FF83FE001F80
4857E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F807E001F80
4867E001F807E001F807E001F80FE001F80FE000F83FFC007FF7FC001FC7FC01A147E931D>
487I<FFF0FF80FFF0FF80FFF0FF800FC038000FC038000FE0780007E0700007F0F00003F0E0
4880003F9E00001F9C00001F9C00000FF800000FF800000FF8000007F0000007F0000003E00
48900003E0000001C000019147F931C>I<FFE7FF3FE0FFE7FF3FE0FFE7FF3FE01F80FC0700
4900FC1FC0E000FC1FC0E000FC3FE1E0007E3BE1C0007E3BE1C0007F7BF3C0003F71F380003
491F71FB80001FE0FF00001FE0FF00001FE0FF00000FC07E00000FC07E00000FC07E0000078
49203C000007803C00023147F9326>I<FFF3FF00FFF3FF00FFF3FF000FE0E00007E1E00003
493F3C00001FF800000FF000000FE0000007E0000003F0000007F800000FFC00001EFE00003
494C7E0000383F0000781F800FFC3FF80FFC3FF80FFC3FF8019147F931C>I<FFF0FF80FFF0
495FF80FFF0FF800FC038000FC038000FE0780007E0700007F0F00003F0E00003F9E00001F9
496C00001F9C00000FF800000FF800000FF8000007F0000007F0000003E0000003E0000001C
4970000001C00000038000078380000FC780000FC700000E0E00000F1E000007F8000001E00
4980000191D7F931C>I E /Fm 86 127 df<70F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F87000
4990000000070F8F8F870051C779B18>33 D<2008701CF83EF83EF83EF83EF83EF83E701C70
5001C701C701C701C30180F0E7C9C18>I<030600078F00078F00078F00078F00078F00078F
501007FFFC0FFFFE0FFFFE07FFFC00F1E000F1E000F1E000F1E000F1E000F1E007FFFC0FFFF
502E0FFFFE07FFFC01E3C001E3C001E3C001E3C001E3C001E3C000C1800131C7E9B18>I<00
503C00001C00001C00001C00003F0000FFC003FFE007DDF0071CF00E1C780E1CF80E1CF80E1
504CF80F1C70079C0007FC0003FF0001FFC0007FE0001FF0001CF0021C78071C380F9C380F9
505C380F1C380F1C70079C7007DDE003FFC001FF80007E00001C00001C00001C00000C00011
506247D9F18>I<3803007C07807C0780EE0F80EE0F00EE0F00EE1F00EE1E00EE1E00EE3E00
5077C3C007C3C00387C0000780000780000F80000F00001F00001E00001E00003E00003C000
50803C00007C0000783800787C00F87C00F0EE00F0EE01F0EE01E0EE01E0EE03E0EE03C07C0
5093C07C018038013247E9F18>I<01C00007E0000FF0000E70001C38001C38001C38001C38
510001C73F81CF3F81CE3F80FC1C00FC3800F83800F03801F07003F87007B8E0071CE00F1FC
51100F0FC00F07C00F07870F0787078FE707FFFE03FC7E00F03C0151C7F9B18>I<387C7C7E
5123E0E0E0E1C1C38F8F0C0070E789B18>I<007000F001E003C007800F001E001E003C003C
513007800780078007000F000F000F000F000F000F000F000F00070007800780078003C003C
514001E001E000F00078003C001F000F000700C24799F18>I<6000F00078003C001E000F00
5150780078003C003C001E001E001E000E000F000F000F000F000F000F000F000F000E001E0
51601E001E003C003C0078007800F001E003C007800F00060000C247C9F18>I<01C00001C0
5170001C00001C00061C300F9CF80FDDF807FFF003FFE000FF8000FF8003FFE007FFF00FDDF
51880F9CF8061C30001C00001C00001C00001C00011147D9718>I<00600000F00000F00000
519F00000F00000F00000F00000F0007FFFC0FFFFE0FFFFE07FFFC000F00000F00000F00000
520F00000F00000F00000F00000600013147E9718>I<1C3E7E7F3F1F070E1E7CF860080C78
5218518>I<7FFFC0FFFFE0FFFFE07FFFC013047E8F18>I<3078FCFC78300606778518>I<00
5220300000780000780000F80000F00001F00001E00001E00003E00003C00007C0000780000
523780000F80000F00001F00001E00003E00003C00003C00007C0000780000F80000F00000F
52400001F00001E00003E00003C00003C00007C0000780000F80000F00000F0000060000011
525247D9F18>I<01F00007FC000FFE001F1F001E0F003C07807803C07803C07803C0F001E0
526F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F803E07803C07803C07C07C0
5273C07801E0F001F1F000FFE0007FC0001F000131C7E9B18>I<01C001C003C007C007C01F
528C0FFC0FBC063C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003
529C003C07FFEFFFF7FFE101C7C9B18>I<03F0001FFE003FFF007C0F807807C0F003C0F801
530E0F801E07001E00001E00001E00003C00003C0000780000780000F00001E00003C0000F8
5310001F00003E00007C0000F80001E01E03C01E07FFFE0FFFFE07FFFE0131C7E9B18>I<03
532F8001FFE003FFF003C0F807C07C07C03C07C03C01003C0000380000780000F0003FE0003
533FE0003FF00000F800007C00003C00001E00001E00001E07001E0F801E0F803C0F007C07C
5340F807FFF001FFE0007F000131C7E9B18>I<001F00003F00007F0000770000F70001E700
53501C70003C7000787000707000E07001E07003C0700380700780700F00700FFFFF8FFFFF8
536FFFFF8000700000700000700000700000700000700007FF0007FF0007FF0151C7F9B18>
537I<3FFF807FFF807FFF807800007800007800007800007800007800007800007800007BF8
538007FFE007FFF007C0F803003C00003C00001E00001E07001E0F801E0F801E0F803C07807
539C07C0F803FFF001FFC0003F000131C7E9B18>I<F00000FFFFE0FFFFE0FFFFE0F007C0F0
5400F80000F00001E00003C00003C0000780000780000F00000F00001E00001E00001E00003
541C00003C00003C00003C00007800007800007800007800007800007800007800003000013
5421D7E9C18>55 D<3078FCFC783000000000000000003078FCFC78300614779318>58
543D<183C7E7E3C180000000000000000183C7E7E3E1E0E1C3C78F060071A789318>I<0000
544C00003E00007E0001FC0003F8000FE0001FC0007F0000FE0003F80007F0000FC0000FC00
545007F00003F80000FE00007F00001FC0000FE00003F80001FC00007E00003E00000C01318
5467E9918>I<7FFFC0FFFFE0FFFFE07FFFC00000000000000000000000007FFFC0FFFFE0FF
547FFE07FFFC0130C7E9318>I<600000F80000FC00007F00003F80000FE00007F00001FC00
54800FE00003F80001FC00007E00007E0001FC0003F8000FE0001FC0007F0000FE0003F8000
5497F0000FC0000F8000060000013187E9918>I<0FF0003FFC007FFF00781F00F80780F807
55080F80780201F00007E0000FC0001F00001E00003C00003C00003C00003C00003C0000380
5510000000000000000000000000000000003800007C00007C00007C000038000111C7D9B18
552>I<007C0001FE0007FF000F87801E03C03C1DC0387FC070FFE071E3E071C1E0E1C1E0E3
55380E0E380E0E380E0E380E0E380E0E380E0E1C1C071C1C071E3C070FF80387F003C1C001E
55401E00F83E007FFC001FF80007E00131C7E9B18>I<00F80000F80000F80001FC0001DC00
55501DC0001DC0003DE0003DE0003DE0003DE00038E00078F00078F00078F00078F00078F00
5560F07800FFF800FFF800FFF800F07801E03C01E03C01E03C07F8FF0FF8FF87F8FF0151C7F
5579B18>I<7FFE00FFFF007FFF801E07C01E03C01E01E01E01E01E01E01E01E01E01E01E03
558C01E07C01FFF801FFF001FFFC01E03E01E01E01E00F01E00F01E00F01E00F01E00F01E00
559F01E01E01E03E07FFFC0FFFF807FFE00141C7F9B18>I<00F8E003FFE007FFE00F07E01E
56003E03C03E03C01E07801E07801E0700000F00000F00000F00000F00000F00000F00000F0
5610000F000007000007801E07801E03C01E03C01E01E03C00F07C007FF8003FE0000F80013
5621C7E9B18>I<7FFC00FFFF007FFF801E07C01E03E01E01E01E01F01E00F01E00F01E00F8
5631E00781E00781E00781E00781E00781E00781E00781E00781E00781E00F01E00F01E01F0
5641E01E01E03E01E07C07FFF80FFFF007FFC00151C809B18>I<FFFFF0FFFFF0FFFFF01E00
565F01E00F01E00F01E00F01E00001E00001E0F001E0F001E0F001FFF001FFF001FFF001E0F
566001E0F001E0F001E00001E00001E00781E00781E00781E00781E0078FFFFF8FFFFF8FFFF
567F8151C7F9B18>I<FFFFF8FFFFF8FFFFF81E00781E00781E00781E00781E00001E00001E
5680F001E0F001E0F001FFF001FFF001FFF001E0F001E0F001E0F001E00001E00001E00001E
56900001E00001E00001E0000FFE000FFE000FFE000151C7F9B18>I<01F1C007FFC00FFFC0
5701F0FC01E07C03C03C03803C07803C07803C0700000F00000F00000F00000F00000F00000
571F01FF0F03FF0F01FF07003C07803C07803C03807C03C07C01E0FC01F0FC00FFFC007FFC0
57201F3C0141C7E9B18>I<7F8FF0FFDFF87F8FF01E03C01E03C01E03C01E03C01E03C01E03
573C01E03C01E03C01E03C01FFFC01FFFC01FFFC01E03C01E03C01E03C01E03C01E03C01E03
574C01E03C01E03C01E03C01E03C07F8FF0FFDFF87F8FF0151C7F9B18>I<7FFF80FFFFC07F
575FF8001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001
576E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E0007FFF80FF
577FFC07FFF80121C7D9B18>I<01FFE001FFE001FFE0000F00000F00000F00000F00000F00
578000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00
579000F00700F00F80F00F80F00F83E007FFC003FF8000FE000131C7E9B18>I<FFE000FFE0
58000FFE0001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00
581001E00001E00001E00001E00001E00001E00001E00F01E00F01E00F01E00F01E00F0FFFF
582F0FFFFF0FFFFF0141C7F9B18>76 D<FC01F8FE03F8FE03F83F07E03B06E03B06E03B06E0
5833B8EE03B8EE0398CE0398CE039DCE039DCE039DCE038D8E038F8E038F8E03870E03870E0
5843800E03800E03800E03800E03800E03800E0FE03F8FE03F8FE03F8151C7F9B18>I<7E07
585F0FF0FF87F07F01F81C01D81C01D81C01DC1C01CC1C01CC1C01CE1C01CE1C01CE1C01C61
586C01C71C01C71C01C31C01C39C01C39C01C39C01C19C01C19C01C1DC01C0DC01C0DC01C0F
587C07F07C0FF87C07F03C0151C7F9B18>I<0FFE003FFF807FFFC07C07C07803C0F803E0F0
58801E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F0
58901E0F001E0F001E0F001E0F803E07803C07C07C07FFFC03FFF800FFE00131C7E9B18>I<
590FFFE00FFFF80FFFFC01E07C01E03E01E01E01E00F01E00F01E00F01E00F01E00F01E01E0
5911E03E01E07C01FFFC01FFF801FFE001E00001E00001E00001E00001E00001E00001E0000
5921E0000FFC000FFC000FFC000141C7F9B18>I<7FF800FFFE007FFF001E1F801E07801E07
593C01E03C01E03C01E03C01E07C01E07801E1F801FFF001FFE001FFE001E0F001E0F001E07
594801E07801E07801E07801E07801E07BC1E07BC1E07BC7F83F8FFC1F87F80F0161C7F9B18
595>82 D<7FFFF8FFFFF8FFFFF8F07878F07878F07878F07878007800007800007800007800
596007800007800007800007800007800007800007800007800007800007800007800007800
59700780000780007FF8007FF8007FF80151C7F9B18>84 D<FFC7FEFFC7FEFFC7FE1E00F01E
59800F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E
59900F01E00F01E00F01E00F01E00F01E00F00F01E00F01E007C7C003FF8001FF00007C0017
6001C809B18>I<FF07F8FF8FF8FF07F83C01E01E03C01E03C01E03C01E03C00F07800F0780
6010F07800F07800F0780078F00078F00078F00078F00038E00038E0003DE0003DE0001DC00
60201DC0001DC0001FC0001FC0000F80000F800151C7F9B18>I<FE03F8FE03F8FE03F87000
603707000707000703800E03800E03800E03800E03800E038F8E039FCE039DCE039DCE019DC
604C019DCC019DCC0198CC0198CC01D8DC01D8DC01D8DC01D05C00F07800F07800F07800E03
60580151C7F9B18>I<7F8FE07F9FE07F8FE00F0F800F8F00079F0007DE0003FE0003FC0001
606FC0001F80000F80000F00000F00000F80001F80001FC0003FC0003DE00079E00078F0007
6078F000F07800F07801E07C07F8FF0FF8FF87F8FF0151C7F9B18>I<FFFCFFFCFFFCF000F0
60800F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F0
60900F000F000F000F000F000F000F000F000F000F000FFFCFFFCFFFC0E24789F18>91
610D<600000F00000F00000F800007800007C00003C00003C00003E00001E00001F00000F00
611000F00000F800007800007C00003C00003C00003E00001E00001F00000F00000F8000078
61200007800007C00003C00003E00001E00001E00001F00000F00000F800007800007800003
6130011247D9F18>I<FFFCFFFCFFFC003C003C003C003C003C003C003C003C003C003C003C
614003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C
615003CFFFCFFFCFFFC0E247F9F18>I<03800FE03FF8FFFEFC7EF01E40040F077C9B18>I<7F
616FFC0FFFFE0FFFFE07FFFC013047E7F18>I<061E3E387070E0E0E0F8FC7C7C38070E789E
61718>I<0FF0003FFC007FFE007C1F007C0F0038078000078000FF8007FF801FFF807F8780
6187C0780F00780F00780F00780F807807C1F803FFFF81FFBF807E1F815147E9318>I<7F00
61900FF00007F00000F00000F00000F00000F00000F00000F3E000FFF800FFFE00FC1F00F80
620F00F00780F00780F003C0F003C0F003C0F003C0F003C0F003C0F00780F80780F80F00FC1
621F00FFFE00FFF80073E00161C809B18>I<01FC0007FF001FFF803E0F803C0F8078070078
6220000F00000F00000F00000F00000F00000F000007800007803C03C03C03E07C01FFF8007
623FF0001FC0012147D9318>I<001FC0003FC0001FC00003C00003C00003C00003C00003C0
62401F3C007FFC01FFFC03E0FC03C07C07803C07803C0F003C0F003C0F003C0F003C0F003C0
625F003C07803C07807C03C07C03E1FC01FFFF807FBFC01F3F8161C7F9B18>I<01F80007FE
626000FFF001F0F803C03C07803C07801C0F001E0F001E0FFFFE0FFFFE0FFFFE0F000007800
627007801E03C01E01F03E00FFFC007FF8000FE0013147E9318>I<001F80007FC000FFE000
628F3E001E3E001E08001E00001E0007FFFC0FFFFC0FFFFC001E00001E00001E00001E00001
629E00001E00001E00001E00001E00001E00001E00001E00001E00001E0007FFF807FFF807F
630FF80131C7F9B18>I<03F1E00FFFF01FFFF83E1F783C0F30780780780780780780780780
6317807803C0F003E1F003FFE003FFC003BF0003800003800001FFE001FFFC03FFFE07801F0
632700070E00038E00038E00038E000387800F07E03F01FFFC00FFF8001FC00151F7F9318>
633I<7F0000FF00007F00000F00000F00000F00000F00000F00000F1F000F7F800FFFC00FE1
634C00FC1E00F81E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01
635E00F01E07FE3FCFFF3FE7FE3FC171C809B18>I<01C00003E00003E00003E00001C00000
63600000000000000000000007FE000FFE0007FE00001E00001E00001E00001E00001E00001
637E00001E00001E00001E00001E00001E00001E00001E00001E000FFFF80FFFF80FFFF8011
6381D7D9C18>I<001C003E003E003E001C00000000000000000FFE0FFE0FFE001E001E001E
639001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E
640701CF83CF878FFF87FF01FC00F277E9C18>I<7E0000FE00007E00000E00000E00000E00
641000E00000E00000E3FF00E3FF00E3FF00E07800E0F000E1E000E3C000E78000EF0000FF8
642000FFC000F9C000F0E000E0F000E07000E03800E03C07FC7F8FFC7F87FC7F8151C7F9B18
643>I<FFE000FFE000FFE00001E00001E00001E00001E00001E00001E00001E00001E00001
644E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001
645E00001E000FFFFC0FFFFC0FFFFC0121C7D9B18>I<F9C1C0FFF7F0FFFFF03E3E383C3C38
6463C3C38383838383838383838383838383838383838383838383838383838383838383838
647FE3E3EFE7E7EFE3E3E1714809318>I<7F1F00FF7F807FFFC00FE1C00FC1E00F81E00F01
648E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E07FE3FCFFF3
649FE7FE3FC1714809318>I<01F0000FFE001FFF003E0F803C07807803C07803C0F001E0F0
65001E0F001E0F001E0F001E0F001E07803C07803C03C07803F1F801FFF000FFE0001F00013
651147E9318>I<7F3E00FFFF807FFFE00FC1F00F80F00F00780F00780F003C0F003C0F003C
6520F003C0F003C0F003C0F00780F80780F80F00FC1F00FFFE00FFF800F3E000F00000F0000
6530F00000F00000F00000F00000F00007FE000FFF0007FE000161E809318>I<01F9E007FD
654E00FFFE01F0FE03C07E07803E07801E0F001E0F001E0F001E0F001E0F001E0F001E07801
655E07803E03C07E03E0FE01FFFE007FDE001F1E00001E00001E00001E00001E00001E00001
656E00001E0000FFC001FFE000FFC171E7F9318>I<FF87E0FF9FF0FFBFF807F87807F03007
657E00007C00007C000078000078000078000078000078000078000078000078000078000FF
658FE00FFFF00FFFE0015147F9318>I<07FF003FFF007FFF00700F00E00F00E00F00F00000
6597E00007FF0001FFC0007FF00003F00700780F00380F00380F80380FC0F00FFFF00FFFC00
660E7F00011147D9318>I<0380000780000780000780000780007FFFC0FFFFC0FFFFC00780
661000780000780000780000780000780000780000780000780000780C00781E00781E00781
662E003C3C003FFC001FF00007E0013197F9818>I<7F0FE0FF1FE07F0FE00F01E00F01E00F
66301E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F03E00F07E007
664FFFC03FFFE01F9FC1714809318>I<7F8FF0FF8FF87F8FF01C01C00E03800E03800E0380
665070700070700070700078F00038E00038E0003DE0001DC0001DC0001DC0000F80000F800
66600700015147F9318>I<FF07F8FF8FF8FF07F83800E03800E03800E03800E01C01C01C71
667C01CF9C01CF9C01CF9C01DDDC00DDD800DDD800DDD800F8F800F8F800F8F800707001514
6687F9318>I<7F8FF07F9FF07F8FF00F0700078E00039E0001DC0001F80000F80000700000
669F00000F80001DC00039E00038E000707000E07807F8FF0FF8FF87F8FF015147F9318>I<
6707F8FF0FF8FF87F8FF00E01C00E03800E0380070380070700070700038700038700038E00
67101CE0001CE0001CC0000DC0000FC0000780000780000780000700000700000700000F000
6727CE0007DE00073C0007F80003F00001E0000151E7F9318>I<3FFFF07FFFF07FFFF07803
673E07807C0780F80001F00003E00007C0000F80001F00003E00007C0000F80F01F00F03E00
674F07C00F0FFFFF0FFFFF0FFFFF014147F9318>I<0007E0001FE0007FE0007C0000F00000
675F00000F00000F00000F00000F00000F00000F00000F00000F00000F00001F0007FE000FF
676C000FFC0007FE00001F00000F00000F00000F00000F00000F00000F00000F00000F00000
677F00000F00000F000007C00007FE0001FE00007E013247E9F18>I<60F0F0F0F0F0F0F0F0
678F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0600424769F18>I<7E00
67900FF8000FFE00003E00000F00000F00000F00000F00000F00000F00000F00000F00000F0
6800000F00000F00000F800007FC0003FE0003FE0007FC000F80000F00000F00000F00000F0
6810000F00000F00000F00000F00000F00000F00000F00003E000FFE000FF80007E00001324
6827E9F18>I<0E0C1F1E3FBEFBF8F1F060E00F067C9B18>I E /Fn 39
683122 df<00001FE000007FF00001C0380001807800038078000700300007000000070000
68400070000000E0000000E0000000E000000FFFFE000FFFFE0001C01C0001C01C0001C01C0
685001C01C0001C038000380380003803800038038000380700003807000078070000700718
68600700E3000700E3000700E3000600E6000E007E000E003C000E0000000E0000001C00000
68701C00000318000007B800000F30000007E0000003C0000001D29829F1A>12
688D<00003FC0FF800000FFE3FFC00001C1E700E0000381EE01E0000380DC01E00007001C00
689C0000700180000000700380000000700380000000E00380000000E00380000000E007000
6900000FFFFFFFF8000FFFFFFFF80000E00700700001C00700700001C00700700001C00E007
69100001C00E00E00001C00E00E00003800E00E00003800E00E00003801C01C00003801C01C
69200003801C01C00007001C01C60007001C038C00070038038C00070038038C00070038039
6938000E003801F8000E003000F0000E00700000000E00700000001C00700000001C00E0000
6940031860E000000798F1C000000F31E380000007E0FF00000003C07C00000002B29829F28
695>14 D<00E001F001F003E003E003E003C003C003C00780078007800700070007000E000E
696000E000C000C001C0018001800000000000000000000007000F800F800F000E0000C217B
697A00E>33 D<1C1C3E3E7E7E7E7E3E3E06060C0C0C0C1818181830306060C0C080800F0E78
6989F17>I<70F8F8F0E005057B840E>46 D<000200060006000E003C00FC03DC031C003800
6993800380038007000700070007000E000E000E000E001C001C001C001C003800380038003
70080FFF8FFF80F1E7B9D17>49 D<0007C0001FE000386000E0E001C1E001C1E00380C00700
701000F00000E00001E10001E7C001DFE003F07003E07003C07807C07807807807807807807
70280700F00700F00F00F00F00E00F01E00701C0070380070380038F0001FC0000F8000131F
7037B9D17>54 D<001F00007F8000E1C001C0E00380E00700E00700E00700E00F01C00F01C0
7040F838007C70007EE0003F80001F80003FC000E7E001C3F00381F00700F00700700E00700
705E00700E00700E00E00E00E00E01C00E0380070F0003FE0001F8000131F7B9D17>56
706D<070F1F1F0E0000000000000000000070F8F8F0E008147B930E>58
707D<0000FE020007FF06001F818C003E00DC0078007C00F0007C01E0003803C00038078000
708380F8000381F0000301F0000303E0000303E0000007C0000007C0000007C0000007C0000
70900F8000000F8000000F8000000F80000C0F80001807800018078000300780003003C0006
710003C000C001E0018000F00300007C0E00003FF800000FE00001F217A9F21>67
711D<01FFFFFC01FFFFF8001E0078001E0038001E0038003C0018003C0018003C0018003C00
7123000780C3000780C3000780C0000781C0000F0380000FFF80000FFF80000F0380001E030
7130001E0300001E0300001E0300003C0000003C0000003C0000003C0000007800000078000
714000780000007800000FFFC0000FFF800001E1F7D9E1E>70 D<00FF007FE001FF00FFC000
7151F001E00001F800C00001F800C0000378018000033C018000033C018000033C018000063
716C030000061E030000061E030000061E0300000C0F0600000C0F0600000C0F0600000C078
7176000018078C000018078C00001803CC00001803CC00003003D800003001F800003001F80
7180003001F800006000F000006000F000006000F00000E000F0000FFC0060000FFC0060000
719231F7D9E22>78 D<01FFFF8001FFFFE0001E01F0001E0078001E0078003C007C003C007C
720003C007C003C007C007800F8007800F8007800F0007801E000F003C000F00F8000FFFF00
72100FFF80001E0000001E0000001E0000001E0000003C0000003C0000003C0000003C00000
72207800000078000000780000007800000FFF80000FFF000001E1F7D9E1F>80
723D<0007E040001FF8C0003C1D8000700F8000E0078001C007800180030003800300038003
7240003800300038000000380000003C0000003F8000001FF800001FFE000007FF000001FF0
725000001F80000007800000038000000380000003800300038003000380030003000700070
72600700060007800E0007801C000EE078000C7FE000081F800001A217D9F1A>83
727D<06060E0E1C1C1818303060606060C0C0C0C0F0F0F8F8F8F8F8F870700F0E749F17>92
728D<00F18003FDC0078F800E07801C07803C07803C0700780700780700780700F00E00F00E
72900F00E00F00E30F01C60F03C60707C6078FCC03FCFC00F070014147C9317>97
730D<07803F803F000700070007000E000E000E000E001C001C001CF01FFC3F1E3E0E3C0F38
7310F700F700F700F700FE01EE01EE01EE03CE03CE038607071E03FC01F0010207B9F15>I<
732007E0001FF000383800F07801E07801C07003C0200780000780000780000F00000F00000
733F00000F00000F00000700200700700381E001FF80007E00011147C9315>I<0000780003
734F80003F00000700000700000700000E00000E00000E00000E00001C00001C000F1C003FD
735C0078F800E07801C07803C07803C0700780700780700780700F00E00F00E00F00E00F00E
73630F01C60F03C60707C6078FCC03FCFC00F070015207C9F17>I<007C0001FF000783000F
73701801E01803C01803C0300780E007FFC007FE000F00000F00000F00000F0000070000070
73802007807003C1E001FF80007E00011147C9315>I<0000F80001FC0003BC00033C000718
739000700000700000E00000E00000E00000E00000E0000FFE001FFE0001C00001C00001C00
74000380000380000380000380000380000700000700000700000700000700000E00000E000
74100E00000E00000E00001C00001C00001C0000180003380007B8000F300007E00003C0000
7421629829F0E>I<003C6000FF7001E3E00381E00701E00F01E00F01C01E01C01E01C01E01
743C03C03803C03803C03803C03803C07003C0F001C1F001E3F000FFE0003CE00000E00000E
74400001C00001C00301C00783800F0F0007FE0003F8000141D7E9315>I<01E0000FE0000F
745C00001C00001C00001C000038000038000038000038000070000070000073E00077F000E
746C3800F81C00F01C00E01C01E03801C03801C03801C0380380700380700380700380E1870
7470E30700E30701C60700C60E00FC060078015207D9F17>I<006000F000F000E000000000
748000000000000000000000F001F80318031C063806380C3800700070007000E000E000E00
7491C301C601C6038C018C01F800F000C1F7D9E0E>I<0001800003C00003C0000380000000
750000000000000000000000000000000000000003C00007E0000C700018700030700030700
751060E00000E00000E00000E00001C00001C00001C00001C00003800003800003800003800
75200700000700000700000700000E00000E00030E00079C000F380007F00003C0000122882
7539E0E>I<01E0000FE0000FC00001C00001C00001C0000380000380000380000380000700
754000700000703C00707E00E0C600E18E00E31E00E61E01CC1C01F80001F00001FC00039E0
755003870003870003838607070C07070C07070C0703980E03F00601E0013207D9F15>I<03
756C01FC01F8003800380038007000700070007000E000E000E000E001C001C001C001C0038
757003800380038007000700070007180E300E300E300E6007E003C000A207C9F0C>I<1E07
758C0F8003F1FE1FC0033B8730E0063E076070063C03C07006380380700C780780E00070070
7590E000700700E000700700E000E00E01C000E00E01C000E00E01C000E00E038601C01C038
760C01C01C038C01C01C071801C01C031803803803F001801801E0023147D9325>I<1E07C0
7613F1FE033B87063E07063C038638038C780700700700700700700700E00E00E00E00E00E0
7620E01C31C01C61C01C61C038C1C018C3801F81800F018147D931A>I<007C0001FF000383
763800F01C01E01C01C01E03C01E07801E07801E07801E0F003C0F003C0F003C0F00780F007
76400700F00701E003838001FF00007C00013147C9317>I<01C1E007E7F8067E3C0C7C1C0C
765781E0C701E18E01E00E01E00E01E00E01E01C03C01C03C01C03C01C07803C07803C07003
766C0E003E3C0077F80071E000700000700000E00000E00000E00000E00001C0000FFC000FF
7678000171D809317>I<0E0F003F3F8033F1C063C1C063C3C06383C0C78380070000070000
7680700000E00000E00000E00000E00001C00001C00001C00001C000038000018000012147D
7699313>114 D<00FC03FE07070E0F0E0F0E0E1E000F800FF007F803FC003E001E701EF01C
770F01CE03860703FE01F8010147D9313>I<018001C0038003800380038007000700FFF0FF
771F00E000E000E000E001C001C001C001C0038003800380038307060706070C071803F001E
772000C1C7C9B0F>I<0F00601F80703180E031C0E06380E06380E0C381C00701C00701C007
77301C00E03800E03800E03800E038C0E07180E07180E0F180E1F3007F3F003E1C016147D93
77418>I<0F01C01F83C03183E031C1E06380E06380E0C380C00700C00700C00700C00E0180
7750E01800E01800E03000E03000E06000E06000F0C0007F80001E00013147D9315>I<0F00
77660E01F8071E03180E1F031C0E0F06380E0706380E070C381C0600701C0600701C0600701
777C0600E0380C00E0380C00E0380C00E0381800E0381800E0781800E078300070F860007F9
778FC0001F0F8001C147D931E>I<0787800FCFC018F8E03070E06071E06071E0C0E1C000E0
7790000E00000E00001C00001C00001C00071C060F380C0F380C0E38180C7C3007CFE00387C
7800013147D9315>I<0F00601F80703180E031C0E06380E06380E0C381C00701C00701C007
78101C00E03800E03800E03800E03800E07000E07000E0F000E1F0007FE0003EE00000E0000
7820E00001C00781C0078380070700060E0003FC0001F0000141D7D9316>I
783E /Fo 77 123 df<001FC1F0007FF7F801F07E7C03C0FC7C0780FC7C0F00F8380F007800
7840F0078000F0078000F0078000F0078000F007800FFFFFF80FFFFFF800F0078000F007800
7850F0078000F0078000F0078000F0078000F0078000F0078000F0078000F0078000F007800
7860F0078000F0078000F0078000F0078000F0078007FE3FF807FE3FF801E20809F1B>11
787D<001F8000FFC001E0E003C0F00781F00F01F00F00E00F00000F00000F00000F00000F00
78800FFFFF0FFFFF00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00
789F00F00F00F00F00F00F00F00F00F00F00F00F07FC3FE7FC3FE1720809F19>I<001FB000
790FFF001E1F003C1F00781F00F00F00F00F00F00F00F00F00F00F00F00F00F00F0FFFFF0FF
791FFF00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F
79200F00F00F00F00F00F00F00F00F07FE7FE7FE7FE1720809F19>I<001FC0FC00007FE7FE
7930001F07F070003C0FE07800780FC0F800F00F80F800F007807000F007800000F00780000
7940F007800000F007800000F00780000FFFFFFFF80FFFFFFFF800F007807800F007807800F
795007807800F007807800F007807800F007807800F007807800F007807800F007807800F00
7967807800F007807800F007807800F007807800F007807800F007807800F007807807FE3FF
7973FF07FE3FF3FF02420809F26>I<070F1F1E3C78F0E0400809779F17>19
798D<7038F87CFC7EFC7E7C3E0C060C060C06180C180C381C3018603040200F0E7F9F17>34
799D<70F8FCFC7C0C0C0C181838306040060E7C9F0D>39 D<006000C001800380070006000E
800001C001C003C003800380078007000700070007000F000F000F000F000F000F000F000F0
80100F000F000F000F00070007000700070007800380038003C001C001C000E000600070003
80280018000C000600B2E7CA112>I<C0006000300038001C000C000E000700070007800380
803038003C001C001C001C001C001E001E001E001E001E001E001E001E001E001E001E001E0
80401C001C001C001C003C0038003800780070007000E000C001C00380030006000C0000B2E
8057EA112>I<00030000000300000003000000030000000300000003000000030000000300
8060000030000000300000003000000030000000300000003000000030000FFFFFFFCFFFFFF
807FC0003000000030000000300000003000000030000000300000003000000030000000300
808000003000000030000000300000003000000030000000300001E207E9A23>43
809D<70F8F8F878181818183030606040050E7C840D>I<FFF0FFF0FFF00C03808B0F>I<70F8
810F8F87005057C840D>I<0000400000C00001800001800001800003000003000003000006
81100000600000C00000C00000C000018000018000018000030000030000060000060000060
8120000C00000C00000C0000180000180000180000300000300000600000600000600000C00
813000C00000C0000180000180000300000300000300000600000600000600000C00000C000
81400122D7EA117>I<03F0000FFC001E1E001C0E00380700780780700380700380700380F0
81503C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F0
81603C07003807003807003807807803807001C0E001E1E000FFC0003F000121F7E9D17>I<
81700C001C00FC0FFC0F3C003C003C003C003C003C003C003C003C003C003C003C003C003C0
81803C003C003C003C003C003C003C003C003C003C07FFF7FFF101E7D9D17>I<07F0000FFC
81900383E00700F00600F80F80780FC07C0FC07C0FC03C07803C03003C00007C00007800007
82080000F00001E00001C0000380000700000E00001C0000380000300C00600C00C00C01801
821C03FFF807FFF80FFFF80FFFF80121E7E9D17>I<03F0000FFC001C1E00300F00780F807C
8220F807C07807C0F803C0F80000F00000F00001E00007C0007F00007F000003C00000E0000
8230F000007800007800007C03007C07807C0FC07C0FC07C0FC0780780F80700F003C1E001F
824FC0007F000121F7E9D17>I<000700000700000F00001F00001F00003F00007F0000EF00
82500CF0001CF00038F00030F00070F000E0F000C0F00180F00380F00300F00600F00E00F00
826FFFFF0FFFFF0000F00000F00000F00000F00000F00000F0000FFF000FFF0141E7F9D17>
827I<3003003FFF003FFE003FF8003FE00030000030000030000030000030000030000031F0
8280037FC003E1E00380F00380F003007800007800007C00007C00007C07807C0F807C0F807
829C0F80780F00780600F00700E00383C001FF80007E000121F7E9D17>I<007C0001FE0007
83083000E07800C0F801C0F80380700380000780000700000700000F1F800F3FE00F40E00F8
8310700F80380F80380F003C0F003C0F003C0F003C0F003C07003C07003C070038038038038
83207001C07000E1E0007FC0001F000121F7E9D17>I<6000007FFFE07FFFE07FFFC07FFFC0
833E00180C00300C00300C00600000C0000180000180000300000700000600000E00000E000
83401E00001C00001C00003C00003C00003C00003C00007C00007C00007C00007C00007C000
83507C000038000131F7E9D17>I<03F0000FFC001C1E003807003007007003807003807003
836807803807C07007F07003F8E001FFC000FF80007FC0007FE001EFF00387F80701F80700F
837C0E003C0E003C0E001C0E001C0E001C0F001807003803807001E0E000FFC0003F000121F
8387E9D17>I<03F00007F8001E1C00380E00380700700700700380F00380F00380F003C0F0
83903C0F003C0F003C0F003C07007C07007C03807C01C0BC01FF3C007E3C000038000038000
84007800007003807007C0E007C0E00781C003078001FF0000FC000121F7E9D17>I<70F8F8
841F8700000000000000000000070F8F8F87005147C930D>I<70F8F8F87000000000000000
84200000070F8F8F878181818183030606040051D7C930D>I<FFFFFFFCFFFFFFFC00000000
84300000000000000000000000000000000000000000000000000000000FFFFFFFCFFFFFFFC
8441E0C7E9023>61 D<0003800000038000000380000007C0000007C0000007C000000FE000
845000FE000000FE0000019F0000019F0000019F0000030F8000030F8000030F80000607C00
84600607C0000607C0000C03E0000C03E0000C03E0001FFFF0001FFFF0001801F0003000F80
84703000F8003000F80060007C0060007C01F0007E0FFC03FFEFFC03FFE1F207F9F22>65
848D<FFFFE000FFFFF8000F803E000F801E000F801F000F800F800F800F800F800F800F800F
849800F800F800F800F000F801F000F803E000F807C000FFFF8000FFFFC000F801F000F800F
850800F8007C00F8003C00F8003E00F8003E00F8003E00F8003E00F8003E00F8007C00F8007
851C00F800F800F803F00FFFFFE00FFFFF8001B1F7E9E20>I<000FE010007FF83000F80E70
85203E00370078001F00F0000F01F0000F01E0000703C0000703C0000707C00003078000030
853F8000030F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000
854780000307C0000303C0000303C0000301E0000601F0000600F0000C00780018003E00300
85500F80E00007FFC00000FE0001C217E9F21>I<FFFFF800FFFFFE0007C01F8007C007C007
856C001E007C000F007C000F007C0007807C0007807C0007C07C0003C07C0003C07C0003E07
857C0003E07C0003E07C0003E07C0003E07C0003E07C0003E07C0003E07C0003C07C0003C07
858C0007C07C0007807C000F807C000F007C001E007C007C007C01F80FFFFFE00FFFFF8001F
8591F7F9E23>I<FFFFFF80FFFFFF800F800F800F8003800F8003800F8001800F8001C00F80
86000C00F8000C00F80C0C00F80C0C00F80C0000F80C0000F81C0000FFFC0000FFFC0000F81
861C0000F80C0000F80C0000F80C0600F80C0600F8000600F8000C00F8000C00F8000C00F80
86201C00F8001C00F8003C00F800F80FFFFFF80FFFFFF801B1F7E9E1F>I<FFFFFF80FFFFFF
8638007C00F8007C0038007C0018007C0018007C001C007C000C007C000C007C060C007C060
864C007C0600007C0600007C0E00007FFE00007FFE00007C0E00007C0600007C0600007C060
8650007C0600007C0000007C0000007C0000007C0000007C0000007C0000007C0000007C000
86600FFFF0000FFFF00001A1F7F9E1E>I<000FE010007FF83000F80E7003E00370078001F0
8670F0000F01F0000F01E0000703C0000703C0000707C00003078000030F8000030F8000000
868F8000000F8000000F8000000F8000000F8000000F8007FFEF8007FFE780001F07C0001F0
8693C0001F03C0001F01E0001F01F0001F00F0001F007C001F003E003F000FC0E70007FFC10
870000FF0001F217E9F24>I<FFF8FFF8FFF8FFF80F800F800F800F800F800F800F800F800F
871800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800FFFFF800F
872FFFF800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F
873800F800F800F800F800F800F800F800F800F80FFF8FFF8FFF8FFF81D1F7E9E22>I<FFF8
874FFF80F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F800F80
8750F800F800F800F800F800F800F800F800F800F80FFF8FFF80D1F7F9E10>I<07FFE007FF
876E0001F00001F00001F00001F00001F00001F00001F00001F00001F00001F00001F00001F
87700001F00001F00001F00001F00001F00001F00001F00001F00001F00781F00FC1F00FC1F
87800FC1F00F83E00703E00387C001FF0000FC0001320809E17>I<FFFC00FFFC000F80000F
87980000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F
88080000F80000F80000F80000F80060F80060F80060F80060F800E0F800E0F800C0F801C0F
881803C0F80FCFFFFFCFFFFFC171F7E9E1C>76 D<FFC0000FFEFFE0001FFE07E0001FC007E0
882001FC006F00037C006F00037C006F00037C006780067C006780067C006780067C0063C00
883C7C0063C00C7C0063C00C7C0061E0187C0061E0187C0060F0307C0060F0307C0060F0307
884C006078607C006078607C006078607C00603CC07C00603CC07C00603CC07C00601F807C0
8850601F807C00601F807C00600F007C00F00F007C0FFF0F0FFFEFFF060FFFE271F7F9E2A>
886I<FF801FF8FFC01FF80FE003C00FE001800DF001800DF001800CF801800CFC01800C7C01
887800C3E01800C3F01800C1F01800C0F81800C0FC1800C07C1800C07E1800C03E1800C01F1
888800C01F9800C00F9800C007D800C007F800C003F800C001F800C001F800C000F800C000F
889800C0007801E000380FFC00380FFC001801D1F7E9E22>I<001FE000007FF80001F03E00
89003C00F00078007800F0003C01E0001E03E0001F03C0000F07C0000F87C0000F878000078
891F800007CF800007CF800007CF800007CF800007CF800007CF800007CF800007CF800007C
8927C0000F87C0000F87C0000F83C0000F03E0001F01E0001E00F0003C00780078003C00F00
89301F03E00007FF800001FE0001E217E9F23>I<FFFFE000FFFFF8000F803E000F801F000F
894800F800F8007800F8007C00F8007C00F8007C00F8007C00F8007C00F8007800F800F800F
895801F000F803E000FFFF8000FFFE0000F8000000F8000000F8000000F8000000F8000000F
8968000000F8000000F8000000F8000000F8000000F8000000F800000FFF80000FFF800001A
8971F7E9E1F>I<FFFF8000FFFFF0000F807C000F803E000F801F000F800F000F800F800F80
8980F800F800F800F800F800F800F000F801F000F803E000F807C000FFFF0000FFFE0000F81
899F8000F807C000F807C000F803E000F803E000F803E000F803E000F803E000F803E000F80
9003E000F803E0C0F803E0C0F801F0CFFF80F18FFF807F8000001F01E207E9E21>82
901D<03F0400FFCC01E0FC03807C07803C07001C0F001C0F000C0F000C0F000C0F80000FC00
902007F00007FF0003FFE001FFF000FFF8003FFC0007FE00007E00003F00001F00000F0C000
903F0C000F0C000F0E000E0E000E0F001E0F801C0FE0780C7FF0081FC0014217E9F19>I<7F
904FFFFE07FFFFFE07C0F81E0700F80E0600F8060600F8060E00F8070C00F8030C00F8030C0
9050F8030C00F8030000F8000000F8000000F8000000F8000000F8000000F8000000F800000
9060F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000
9070F8000000F800003FFFE0003FFFE001C1F7E9E21>I<FFF81FF8FFF81FF80F8003C00F80
90801800F8001800F8001800F8001800F8001800F8001800F8001800F8001800F8001800F80
90901800F8001800F8001800F8001800F8001800F8001800F8001800F8001800F8001800F80
91001800F8001800F800180078003000780030003C0030003C0060001E00C0000F83800003F
911F000000FC0001D207E9E22>I<FFF807FEFFF807FE0F8000F00F8000E007C000C007C000
912C007C000C003E0018003E0018003F0018001F0030001F0030001F8070000F8060000F806
9130000FC0E00007C0C00007C0C00003E1800003E1800003E1800001F3000001F3000001FB0
91400000FE000000FE000000FE0000007C0000007C0000003800000038000000380001F207F
9159E22>I<FFF8FFF83FF0FFF8FFF83FF01F800F8007800F800F8003000F8007C003000FC0
91607C0070007C007C0060007C00FE0060007E00FE00E0003E00FE00C0003E01FF00C0003E0
91719F00C0001F019F0180001F019F0180001F030F8180000F830F8300000F830F8300000F8
918607C3000007C607C6000007C607C6000007CC03E6000007EC03EE000003EC03EC000003F
919C03FC000003F801FC000001F801F8000001F801F8000001F000F8000000F000F0000000F
920000F0000000E000700000006000600002C207F9E2F>I<FFFFC0C0C0C0C0C0C0C0C0C0C0
921C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0FFFF082D7CA1
9220D>91 D<0804180C3018703860306030C060C060C060F87CFC7EFC7E7C3E381C0F0E7A9F
92317>I<FFFF03030303030303030303030303030303030303030303030303030303030303
92403030303030303030303FFFF082D80A10D>I<0FE0003FF8007C3C007C1E007C0F00380F
92500000F00000F0001FF000FCF003E0F00780F00780F00F00F30F00F30F00F30F01F30783F
926F03FC7E00F83C014147E9317>97 D<1E0000FE0000FE00001E00001E00001E00001E0000
9271E00001E00001E00001E00001E00001E3F001EFFC01FC1E01F00F01E00701E00781E0038
9281E003C1E003C1E003C1E003C1E003C1E003C1E00381E00781E00701F00F01D83E01CFF80
929183E0016207F9F19>I<01F80007FE001E1F003C1F00381F00780E00700000F00000F000
93000F00000F00000F00000F000007800007800003C01803C03801F070007FE0001F8001114
9317F9314>I<0001E0000FE0000FE00001E00001E00001E00001E00001E00001E00001E000
93201E00001E003F1E007FDE01F07E03C03E03801E07801E07001E0F001E0F001E0F001E0F0
93301E0F001E0F001E07001E07801E03801E03C03E01E0FE00FFDFC03F1FC16207F9F19>I<
93403F0000FFC001E1E003C0F00380700780700700380F00380FFFF80FFFF80F00000F00000
935F000007000007800003801803C03801F070007FE0001F80011147F9314>I<003E0000FF
9360003CF80078F80078F800F07000F00000F00000F00000F00000F00000F0000FFF000FFF0
937000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00
938000F00000F00000F00000F00007FF0007FF0001120809F0E>I<0000E003E3F00FFE701C
9391C70380E60780F00780F00780F00780F00780F00380E001C1C001FF80033E00020000030
94000003000003FFE003FFF801FFFC01FFFE07001E06000F0E00070E00070E000707000E078
94101E03E07C00FFF0003FC00141F7F9417>I<1E0000FE0000FE00001E00001E00001E0000
9421E00001E00001E00001E00001E00001E00001E1F001E7F801EC3C01F81E01F01E01E01E0
9431E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E0
944FFC7FCFFC7FC16207F9F19>I<1C003E003E003E001C000000000000000000000000001E
94500FE00FE001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E00FF
946C0FFC00A1F7F9E0D>I<007000F800F800F80070000000000000000000000000007807F8
94707F800F80078007800780078007800780078007800780078007800780078007800780078
9480078007800787078F878F8F0F9E07FC03F000D28839E0E>I<1E0000FE0000FE00001E00
949001E00001E00001E00001E00001E00001E00001E00001E00001E1FF01E1FF01E0F801E0E
950001E0C001E18001E30001E70001EF0001FF8001F78001E3C001E3E001E1E001E1F001E0F
951801E07801E07C0FFCFF8FFCFF815207F9F18>I<1E00FE00FE001E001E001E001E001E00
9521E001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E00
9531E001E001E001E00FFC0FFC00A207F9F0D>I<1E1F80FC00FE7FC3FE00FEC1E60F001F80
954FC07801F00F807801E00F007801E00F007801E00F007801E00F007801E00F007801E00F0
95507801E00F007801E00F007801E00F007801E00F007801E00F007801E00F007801E00F007
95680FFC7FE3FF0FFC7FE3FF024147F9327>I<1E1F00FE7F80FEC3C01F81E01F01E01E01E0
9571E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E0
958FFC7FCFFC7FC16147F9319>I<01F80007FE001E07803C03C03801C07000E07000E0F000
959F0F000F0F000F0F000F0F000F0F000F07000E07801E03801C03C03C01E078007FE0001F8
9600014147F9317>I<1E3F00FEFFC0FFC3E01F00F01E00701E00781E00781E003C1E003C1E
961003C1E003C1E003C1E003C1E00781E00781E00F01F00F01F83E01EFF801E3E001E00001E
96200001E00001E00001E00001E00001E0000FFC000FFC000161D7F9319>I<01F06007FCE0
9631F0EE03C03E03C03E07801E07801E0F001E0F001E0F001E0F001E0F001E0F001E07801E0
9647801E03803E03C03E01F0FE00FFDE003F1E00001E00001E00001E00001E00001E00001E0
9650001E0000FFC000FFC161D7F9318>I<1E78FEFCFF9E1F1E1F0C1F001E001E001E001E00
9661E001E001E001E001E001E001E001E00FFE0FFE00F147F9312>I<0FC83FF870386018E0
96718E018F000FF807FE03FF81FFC01FC003EC00EC00EE00EE00CF83CDFF887E00F147F9312
968>I<06000600060006000E000E001E003E00FFF8FFF81E001E001E001E001E001E001E00
9691E001E001E001E0C1E0C1E0C1E0C1E0C0F1807F003E00E1C7F9B12>I<1E01E0FE0FE0FE
9700FE01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E
97101E01E03E01E03E00E0DE007F9FC03F1FC16147F9319>I<FFC7F8FFC7F81E01E01F01C0
9720F01800F018007830007830007830003C60003C60003C60001EC0001EC0001FC0000F800
97300F80000700000700000700015147F9318>I<FF9FF3FCFF9FF3FC1E03C0F01E03C0601F
97403C0E00F07C0C00F07E0C00F87E1C0078CE180078CF18007CCF38003D8730003D87B0003
975F87F0001F03E0001F03E0001F03E0000E01C0000E01C0000E01C001E147F9321>I<7FE7
976FC7FE7FC0F83E007838003C30003E70001EE0000FC00007800007800003C00007E0000FE
9770001CF000187800387800703C00F03E0FF87FEFF87FE1714809318>I<FFC7F8FFC7F81E
97801E01F01C00F01800F018007830007830007830003C60003C60003C60001EC0001EC0001
979FC0000F80000F80000700000700000700000600000600000600070C000F8C000C18000E3
98080007F00003C0000151D7F9318>I<7FFF7FFF781E703E603C607860F861F001E003E007
981C007830F831F031E073C067C06781EFFFEFFFE10147F9314>I E
982/Fp 43 122 df<0001FF0000001FFFC000007F81E00000FC01E00001F807F00003F807F0
9830007F007F00007F007F00007F007F00007F007F00007F001C00007F000000007F0000000
98407F000000007F03FF800FFFFFFF800FFFFFFF800FFFFFFF80007F003F80007F003F80007
985F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F0
98603F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003
987F80007F003F80007F003F80007F003F80007F003F8007FFF3FFF807FFF3FFF807FFF3FFF
98880212A7FA925>12 D<000E00001E00007E0007FE00FFFE00FFFE00F8FE0000FE0000FE00
98900FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00
99000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00
99100FE0000FE0000FE00FFFFFEFFFFFEFFFFFE17277BA622>49 D<00FF800007FFF0001FFF
992FC003E07FE007E01FF807F007F80FF807FC0FF803FC0FF803FE0FF801FE0FF801FE07F00
9931FE03E003FE000003FE000003FC000003FC000007F8000007F000000FE000000FC000001
994F8000003F0000007C000000F8000001F0000003C0000007800E0007000E000E000E001C0
99501C0030001C0060001C00FFFFFC01FFFFFC03FFFFFC07FFFFFC0FFFFFF80FFFFFF80FFFF
996FF801B277DA622>I<007F800003FFF00007FFFC000F81FE001F00FF001F80FF003FC07F
997803FC07F803FC07F803FC07F801FC07F800F80FF000000FF000000FE000001FC000003F8
998000007F00000FF800000FFC0000001F8000000FE0000007F0000007F8000003FC000003F
999C000003FE01C003FE07F003FE07F003FE0FF803FE0FF803FE0FF803FC0FF803FC07F007F
1000807E00FF003F01FE001FFFFC0007FFF00000FF80001B277DA622>I<00000F0000000F00
100100001F0000003F0000007F000000FF000001FF000001FF000003BF0000073F00000E3F00
1002001C3F00003C3F0000383F0000703F0000E03F0001C03F0003803F0007803F0007003F00
10030E003F001C003F0038003F0070003F00F0003F00FFFFFFF8FFFFFFF8FFFFFFF800007F00
100400007F0000007F0000007F0000007F0000007F0000007F0000007F00001FFFF8001FFFF8
1005001FFFF81D277EA622>I<180003001F801F001FFFFE001FFFFC001FFFF8001FFFF0001F
1006FFE0001FFF80001FFE00001C0000001C0000001C0000001C0000001C0000001C0000001C
10077FC0001DFFF8001F80FC001E003F0008003F0000001F8000001FC000001FC000001FE000
1008001FE03C001FE07E001FE0FF001FE0FF001FE0FF001FE0FF001FC0FE001FC07C003F8078
1009003F803C007F001F01FE000FFFFC0003FFF00000FF80001B277DA622>I<0007F800003F
1010FE0000FFFF0001FC0F8003F00F8007E01FC00FC03FC01F803FC01F803FC03F803FC03F00
10111F807F000F007F0000007F000000FF020000FF1FF000FF3FFC00FF603E00FFC03F00FF80
10121F80FF801FC0FF801FC0FF001FC0FF001FE0FF001FE0FF001FE07F001FE07F001FE07F00
10131FE07F001FE03F001FE03F001FC01F801FC01F801F800FC03F0007E07E0003FFFC0001FF
1014F800003FC0001B277DA622>I<380000003E0000003FFFFFF03FFFFFF03FFFFFF07FFFFF
1015E07FFFFFC07FFFFF807FFFFF0070000E0070000E0070001C00E0003800E0007000E000E0
1016000001C0000001C0000003800000078000000F8000000F0000001F0000001F0000003F00
101700003F0000007E0000007E0000007E000000FE000000FE000000FE000000FE000001FE00
10180001FE000001FE000001FE000001FE000001FE000001FE000000FC0000007800001C297C
1019A822>I<003FC00001FFF00003FFFC0007C07E000F003F001E001F001E000F803E000F80
10203E000F803F000F803F800F803FC00F003FF01F001FFC1E001FFE3C000FFFF80007FFE000
102103FFF00001FFFC0001FFFE0007FFFF000F0FFF801E07FFC03E01FFC07C007FE07C001FE0
1022F8000FE0F80007E0F80003E0F80003E0F80003E0F80003C07C0003C07E0007803F000F00
10231FC03F000FFFFC0003FFF800007FC0001B277DA622>I<00000780000000000780000000
1024000FC0000000000FC0000000000FC0000000001FE0000000001FE0000000003FF0000000
1025003FF0000000003FF00000000077F80000000077F800000000F7FC00000000E3FC000000
102600E3FC00000001C1FE00000001C1FE00000003C1FF0000000380FF0000000380FF000000
102707007F80000007007F8000000F007FC000000E003FC000000E003FC000001C001FE00000
10281C001FE000003FFFFFF000003FFFFFF000003FFFFFF00000700007F80000700007F80000
1029F00007FC0000E00003FC0001E00003FE0001C00001FE0001C00001FE0003C00001FF00FF
1030FE003FFFFCFFFE003FFFFCFFFE003FFFFC2E297EA833>65 D<00007FE0030003FFFC0700
10311FFFFF0F007FF00FDF00FF8001FF01FE0000FF03FC00007F07F000003F0FF000001F1FE0
103200001F1FE000000F3FC000000F3FC00000077FC00000077F800000077F80000000FF8000
10330000FF80000000FF80000000FF80000000FF80000000FF80000000FF80000000FF800000
103400FF800000007F800000007F800000007FC00000073FC00000073FC00000071FE0000007
10351FE000000E0FF000000E07F000001C03FC00003C01FE00007800FF8001F0007FF007C000
10361FFFFF800003FFFE0000007FF00028297CA831>67 D<FFFFFFFC0000FFFFFFFF8000FFFF
1037FFFFE00003FC001FF80003FC0003FC0003FC0001FE0003FC0000FF0003FC00007F8003FC
103800003FC003FC00001FC003FC00001FE003FC00001FE003FC00000FF003FC00000FF003FC
103900000FF003FC00000FF003FC00000FF803FC00000FF803FC00000FF803FC00000FF803FC
104000000FF803FC00000FF803FC00000FF803FC00000FF803FC00000FF803FC00000FF803FC
104100000FF003FC00000FF003FC00000FF003FC00001FE003FC00001FE003FC00001FC003FC
104200003FC003FC00003F8003FC00007F0003FC0001FF0003FC0003FC0003FC001FF800FFFF
1043FFFFF000FFFFFFFF8000FFFFFFFC00002D297EA834>I<FFFFFFFFE0FFFFFFFFE0FFFFFF
1044FFE003FC001FE003FC0007F003FC0001F003FC0001F003FC0000F003FC00007003FC0000
10457003FC00007003FC01C07803FC01C03803FC01C03803FC01C03803FC03C00003FC03C000
104603FC0FC00003FFFFC00003FFFFC00003FFFFC00003FC0FC00003FC03C00003FC03C00003
1047FC01C00E03FC01C00E03FC01C00E03FC01C01C03FC00001C03FC00001C03FC00001C03FC
104800003C03FC00003803FC00007803FC0000F803FC0001F803FC0003F803FC001FF8FFFFFF
1049FFF0FFFFFFFFF0FFFFFFFFF027297EA82C>I<FFFFFFFFC0FFFFFFFFC0FFFFFFFFC003FC
1050003FC003FC000FE003FC0003E003FC0001E003FC0001E003FC0000E003FC0000E003FC00
105100E003FC0000F003FC01C07003FC01C07003FC01C07003FC01C00003FC03C00003FC03C0
10520003FC0FC00003FFFFC00003FFFFC00003FFFFC00003FC0FC00003FC03C00003FC03C000
105303FC01C00003FC01C00003FC01C00003FC01C00003FC00000003FC00000003FC00000003
1054FC00000003FC00000003FC00000003FC00000003FC00000003FC000000FFFFFC0000FFFF
1055FC0000FFFFFC000024297EA82A>I<FFFFF0FFFFF0FFFFF003FC0003FC0003FC0003FC00
105603FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC00
105703FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC00
105803FC0003FC0003FC0003FC0003FC0003FC0003FC00FFFFF0FFFFF0FFFFF014297EA819>
105973 D<FFFFFC0000FFFFFC0000FFFFFC000003FC00000003FC00000003FC00000003FC00
1060000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC0000
10610003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC000000
106203FC00000003FC00000003FC00000003FC0001C003FC0001C003FC0001C003FC0001C003
1063FC0003C003FC00038003FC00038003FC00078003FC00078003FC000F8003FC000F8003FC
1064001F8003FC007F8003FC01FF00FFFFFFFF00FFFFFFFF00FFFFFFFF0022297EA828>76
1065D<FFFFFFF800FFFFFFFF00FFFFFFFFC003FC003FE003FC000FF003FC0007F803FC0007FC
106603FC0003FC03FC0003FE03FC0003FE03FC0003FE03FC0003FE03FC0003FE03FC0003FE03
1067FC0003FE03FC0003FC03FC0007FC03FC0007F803FC000FF003FC003FE003FFFFFF8003FF
1068FFFE0003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00
1069000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC0000
10700003FC00000003FC000000FFFFF00000FFFFF00000FFFFF0000027297EA82E>80
1071D<00FF806003FFF0E00FFFF9E01F80FFE03F001FE03E0007E07C0003E07C0003E0FC0001
1072E0FC0001E0FC0000E0FE0000E0FE0000E0FF000000FFC000007FFC00007FFFE0003FFFF8
1073001FFFFE001FFFFF0007FFFF8003FFFFC000FFFFC0000FFFE000007FE000001FF000000F
1074F0000007F0E00003F0E00003F0E00003F0E00003F0F00003E0F00003E0F80007E0FC0007
1075C0FF000F80FFE03F80F3FFFE00E1FFFC00C01FF0001C297CA825>83
1076D<7FFFFFFFFF807FFFFFFFFF807FFFFFFFFF807F807F807F807C007F800F8078007F8007
10778078007F80078070007F800380F0007F8003C0F0007F8003C0E0007F8001C0E0007F8001
1078C0E0007F8001C0E0007F8001C0E0007F8001C000007F80000000007F80000000007F8000
10790000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000
10800000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000
10810000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000
10820000007F80000000FFFFFFC00000FFFFFFC00000FFFFFFC0002A287EA72F>I<FFFFF000
10837FFFFFFFF0007FFFFFFFF0007FFF03FE000001C001FE0000038001FE0000038001FF0000
1084078000FF0000070000FF80000F00007F80000E00007FC0000E00003FC0001C00003FC000
10851C00003FE0003C00001FE0003800001FF0007800000FF0007000000FF80070000007F800
1086E0000007F800E0000003FC01C0000003FC01C0000003FE03C0000001FE0380000001FF07
108780000000FF0700000000FF87000000007F8E000000007F8E000000007FDE000000003FDC
1088000000003FFC000000001FF8000000001FF8000000000FF0000000000FF0000000000FF0
10890000000007E00000000007E00000000003C00000000003C0000030297FA833>86
1090D<01FF80000FFFF0001F81FC003FC0FE003FC07F003FC03F003FC03F801F803F800F003F
10918000003F8000003F800000FF80007FFF8003FFFF800FF03F801FC03F803F803F807F003F
109280FE003F80FE003F80FE003F80FE003F80FE007F807F00DF803F839FFC1FFF0FFC03FC03
1093FC1E1B7E9A21>97 D<FFE00000FFE00000FFE000000FE000000FE000000FE000000FE000
1094000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE1FE
1095000FEFFF800FFE0FE00FF803F00FF001F80FE001FC0FE000FC0FE000FE0FE000FE0FE000
1096FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FE0FE000
1097FE0FE000FE0FE001FC0FE001FC0FF001F80FF803F00F9C0FE00F0FFF800E01FC00202A7E
1098A925>I<003FE00001FFFC0003F07E000FC0FF001FC0FF003F80FF003F80FF007F007E00
10997F003C007F000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000
11007F0000007F0000007F8000003F8003803F8003801FC007000FE00E0003F83C0001FFF800
1101003FC000191B7E9A1E>I<00007FF000007FF000007FF0000007F0000007F0000007F000
11020007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000
11033F87F001FFF7F007F03FF00FC00FF01F8007F03F8007F03F8007F07F0007F07F0007F07F
11040007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F07F
11050007F07F0007F03F0007F03F8007F01F800FF00FC01FF007F07FFF01FFE7FF007F87FF20
11062A7EA925>I<003FC00001FFF00003F0FC000FC03E001F803F001F801F003F801F807F00
11071F807F001FC07F000FC0FF000FC0FF000FC0FFFFFFC0FFFFFFC0FF000000FF000000FF00
110800007F0000007F0000007F0000003F8001C01F8001C00FC0038007C0070003F01E0000FF
1109FC00003FE0001A1B7E9A1F>I<0003F800001FFE00007E3F0001FC3F8001F87F8003F87F
11108007F07F8007F03F0007F03F0007F0000007F0000007F0000007F0000007F0000007F000
111100FFFFC000FFFFC000FFFFC00007F0000007F0000007F0000007F0000007F0000007F000
11120007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000
11130007F0000007F0000007F0000007F0000007F0000007F000007FFF80007FFF80007FFF80
111400192A7EA915>I<00FF81F003FFE7F80FC1FE1C1F80FC7C3F007E7C3F007E387F007F00
11157F007F007F007F007F007F007F007F007F007F003F007E003F007E001F80FC000FC1F800
11161FFFE00018FF800038000000380000003C0000003E0000003FFFF8003FFFFF001FFFFFC0
11170FFFFFE007FFFFF01FFFFFF03E0007F07C0001F8F80000F8F80000F8F80000F8F80000F8
11187C0001F07C0001F03F0007E00FC01F8007FFFF00007FF0001E287E9A22>I<FFE00000FF
1119E00000FFE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000F
1120E000000FE000000FE000000FE000000FE000000FE0FE000FE3FF800FE70FC00FEC0FE00F
1121F807E00FF807F00FF007F00FF007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1122E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1123E007F00FE007F0FFFE3FFFFFFE3FFFFFFE3FFF202A7DA925>I<07000F801FC03FE03FE0
11243FE01FC00F8007000000000000000000000000000000FFE0FFE0FFE00FE00FE00FE00FE0
11250FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0FFFE
1126FFFEFFFE0F2B7EAA12>I<FFE00000FFE00000FFE000000FE000000FE000000FE000000F
1127E000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000F
1128E01FFC0FE01FFC0FE01FFC0FE007800FE00F000FE01E000FE03C000FE078000FE0E0000F
1129E3C0000FE7C0000FEFE0000FFFF0000FFFF8000FF3F8000FE1FC000FC0FE000FC07F000F
1130C07F000FC03F800FC01FC00FC00FE00FC00FE00FC007F0FFFC1FFFFFFC1FFFFFFC1FFF20
11312A7FA923>107 D<FFE0FFE0FFE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0
11320FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0
11330FE00FE00FE00FE00FE00FE00FE0FFFEFFFEFFFE0F2A7EA912>I<FFC07F001FC000FFC1
1134FFC07FF000FFC707E1C1F8000FCC07F301FC000FD803F600FC000FD803FE00FE000FF003
1135FC00FE000FF003FC00FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F8
113600FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800
1137FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800FE000FE003F800FE
1138000FE003F800FE000FE003F800FE00FFFE3FFF8FFFE0FFFE3FFF8FFFE0FFFE3FFF8FFFE0
1139331B7D9A38>I<FFC0FE00FFC3FF80FFC70FC00FCC0FE00FD807E00FD807F00FF007F00F
1140F007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1141E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F0FFFE3FFFFF
1142FE3FFFFFFE3FFF201B7D9A25>I<003FE00001FFFC0003F07E000FC01F801F800FC03F80
11430FE03F0007E07F0007F07F0007F07F0007F0FF0007F8FF0007F8FF0007F8FF0007F8FF00
114407F8FF0007F8FF0007F8FF0007F87F0007F07F0007F03F800FE03F800FE01F800FC00FC0
11451F8007F07F0001FFFC00003FE0001D1B7E9A22>I<FFE1FE00FFEFFF80FFFE0FE00FF807
1146F00FF003F80FE001FC0FE001FC0FE001FE0FE000FE0FE000FF0FE000FF0FE000FF0FE000
1147FF0FE000FF0FE000FF0FE000FF0FE000FF0FE000FE0FE001FE0FE001FE0FE001FC0FE003
1148FC0FF003F80FF807F00FFC1FE00FEFFF800FE1FC000FE000000FE000000FE000000FE000
1149000FE000000FE000000FE000000FE000000FE00000FFFE0000FFFE0000FFFE000020277E
11509A25>I<FFC1F0FFC7FCFFCE3E0FDC7F0FD87F0FF07F0FF07F0FF03E0FE0000FE0000FE0
1151000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0
1152000FE000FFFF00FFFF00FFFF00181B7F9A1B>114 D<03FE300FFFF03E03F07800F07000
1153F0F00070F00070F80070FE0000FFE0007FFF007FFFC03FFFE01FFFF007FFF800FFF80007
1154FC0000FCE0007CE0003CF0003CF00038F80038FC0070FF01E0F7FFC0C1FF00161B7E9A1B
1155>I<00E00000E00000E00000E00001E00001E00001E00003E00003E00007E0000FE0001F
1156FFE0FFFFE0FFFFE00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000F
1157E0000FE0000FE0000FE0000FE0700FE0700FE0700FE0700FE0700FE0700FE07007F0E003
1158F0C001FF80007F0014267FA51A>I<FFE07FF0FFE07FF0FFE07FF00FE007F00FE007F00F
1159E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
1160E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE00FF00FE00FF007
1161E01FF003F077FF01FFE7FF007F87FF201B7D9A25>I<FFFC03FFFFFC03FFFFFC03FF0FF0
116200F007F000E007F800E003F801C003F801C003FC03C001FC038001FE078000FE070000FF
11630700007F0E00007F0E00007F9E00003F9C00003FFC00001FF800001FF800000FF000000F
1164F000000FF0000007E0000007E0000003C0000003C000201B7F9A23>I<FFFC7FFC1FFCFF
1165FC7FFC1FFCFFFC7FFC1FFC0FE00FE001C007F007E0038007F007E0038007F807F0078003
1166F807F0070003F80FF8070003FC0FF80F0001FC0FF80E0001FC1FFC0E0000FE1CFC1C0000
1167FE1CFE1C0000FF387E3C00007F387E3800007F787F3800003FF03F7000003FF03FF00000
11683FE01FF000001FE01FE000001FE01FE000000FC00FC000000FC00FC000000F8007C00000
116907800780000007800780002E1B7F9A31>I<FFFC1FFEFFFC1FFEFFFC1FFE07F0038003F8
1170078003FC0F0001FE1E0000FE3C00007F3800007FF800003FF000001FE000000FE000000F
1171F0000007F800000FF800001FFC00003CFE000038FF0000787F0000F03F8001E01FC003C0
11721FE003800FE0FFF03FFFFFF03FFFFFF03FFF201B7F9A23>I<FFFC03FFFFFC03FFFFFC03
1173FF0FF000F007F000E007F800E003F801C003F801C003FC03C001FC038001FE078000FE07
11740000FF0700007F0E00007F0E00007F9E00003F9C00003FFC00001FF800001FF800000FF0
117500000FF000000FF0000007E0000007E0000003C0000003C0000003800000038000000780
117600380700007C0F0000FE0E0000FE1E0000FE1C0000FE38000074F000003FE000000F8000
11770020277F9A23>I E /Fq 41 127 df<007E0001C1800301800703C00E03C00E01800E00
1178000E00000E00000E00000E0000FFFFC0FFFFC00E01C00E01C00E01C00E01C00E01C00E01
1179C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C07F87F87F87F8151D809C17
1180>12 D<FC00FC001C001C001C001C001C001C001C001C001C001C001C001C001C001C00FF
118180FF8009127F910C>16 D<070F0F1C3870E0400808789C15>19 D<1C001E000780038003
1182800380FF00800009087B7E12>24 D<70F8F8F87005057D840C>46
1183D<07C01FF0387C603C601EF01FF81FF80FF80F700F001F001E001E003C0038007000E000
1184C00180030006000C031803100320067FFEFFFEFFFE101C7E9B15>50
1185D<000C00001C00001C00003C00007C00005C0000DC00019C00031C00031C00061C000C1C
118600081C00181C00301C00201C00601C00C01C00FFFFC0FFFFC0001C00001C00001C00001C
118700001C00001C0001FFC001FFC0121C7F9B15>52 D<00060000000F0000000F0000000F00
118800001F8000001F8000001F8000003FC0000033C0000033C0000073E0000061E0000061E0
11890000E1F00000C0F00000C0F00001C0F8000180780001FFF80003FFFC0003003C0003003C
11900007003E0006001E0006001E000E001F001E000F00FF807FF0FF807FF01C1D7F9C1F>65
1191D<001F808000FFE18001F03B8007C00F800F0007801F0007801E0003803C0003807C0001
1192807C00018078000180F8000000F8000000F8000000F8000000F8000000F8000000F80000
119300F8000000780001807C0001807C0001803C0001801E0003001F0003000F00060007C00C
11940001F0380000FFF000001FC000191E7E9C1E>67 D<FFFFFCFFFFFC0F007C0F001C0F000C
11950F000E0F00060F03060F03060F03060F03000F07000FFF000FFF000F07000F03000F0300
11960F03030F03030F00030F00060F00060F00060F000E0F001E0F007CFFFFFCFFFFFC181C7E
11979B1C>69 D<FFF0FFF00F000F000F000F000F000F000F000F000F000F000F000F000F000F
1198000F000F000F000F000F000F000F000F000F000F00FFF0FFF00C1C7F9B0F>73
1199D<FFF800FFF8000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00
1200000F00000F00000F00000F00000F00000F00180F00180F00180F00180F00380F00300F00
1201700F00F00F01F0FFFFF0FFFFF0151C7E9B1A>76 D<003F800000E0E0000380380007001C
1202000E000E001E000F003C0007803C0007807C0007C0780003C0780003C0F80003E0F80003
1203E0F80003E0F80003E0F80003E0F80003E0F80003E0F80003E0780003C07C0007C07C0007
1204C03C0007803E000F801E000F000F001E0007001C000380380000E0E000003F80001B1E7E
12059C20>79 D<FFFF80FFFFE00F01F00F00780F003C0F003E0F003E0F003E0F003E0F003E0F
1206003C0F003C0F00780F01F00FFFC00F00000F00000F00000F00000F00000F00000F00000F
120700000F00000F00000F0000FFF000FFF000171C7E9B1C>I<7FFFFFC07FFFFFC0780F03C0
1208700F01C0600F00C0E00F00E0C00F0060C00F0060C00F0060C00F0060000F0000000F0000
1209000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000
1210000F0000000F0000000F0000000F0000000F000003FFFC0003FFFC001B1C7F9B1E>84
1211D<FFE01FF0FFE01FF01F0007800F0003000F00030007800600078006000780060003C00C
12120003C00C0003C00C0001E0180001E0180001F0180000F0300000F0300000F87000007860
12130000786000003CC000003CC000003CC000001F8000001F8000001F8000000F0000000F00
121400000F0000000600001C1D7F9B1F>86 D<0FE0001838003C1C003C0E00180E00000E0000
12150E0001FE000F8E003C0E00780E00700E00F00E60F00E60F00E60701E603827C00FC38013
1216127F9115>97 D<FC0000FC00001C00001C00001C00001C00001C00001C00001C00001C00
1217001C00001CFC001F87001E03801C01C01C01E01C00E01C00F01C00F01C00F01C00F01C00
1218F01C00F01C00E01C01E01C01C01E03801B070018FC00141D7F9C17>I<03F80E0C1C1E38
12191E780C7000F000F000F000F000F000F0007000780638061C0C0E1803E00F127F9112>I<
1220001F80001F8000038000038000038000038000038000038000038000038000038003F380
12210E0F801C0780380380780380700380F00380F00380F00380F00380F00380F00380700380
12227803803803801C07800E1BF003F3F0141D7F9C17>I<07E00C301818381C701E700EF00E
1223FFFEF000F000F000F000700070063806180C0E1803E00F127F9112>I<00F8018C071E06
12241E0E0C0E000E000E000E000E000E00FFE0FFE00E000E000E000E000E000E000E000E000E
1225000E000E000E000E000E007FE07FE00F1D809C0D>I<00038007E4C00C39C0381DC0381C
122600781E00781E00781E00781E00381C00381C001C300037E0002000003000003000003FF8
1227001FFF001FFF803003806001C0C000C0C000C0C000C06001803003001C0E0007F800121C
12287F9215>I<FC0000FC00001C00001C00001C00001C00001C00001C00001C00001C00001C
122900001C7C001C87001D03001E03801C03801C03801C03801C03801C03801C03801C03801C
123003801C03801C03801C03801C0380FF9FF0FF9FF0141D7F9C17>I<38007C007C007C0038
123100000000000000000000000000FC00FC001C001C001C001C001C001C001C001C001C001C
1232001C001C001C001C00FF80FF80091D7F9C0C>I<01C003E003E003E001C0000000000000
123300000000000007E007E000E000E000E000E000E000E000E000E000E000E000E000E000E0
123400E000E000E000E000E000E060E0F0C0F1C061803E000B25839C0D>I<FC00FC001C001C
1235001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C
1236001C001C001C001C001C00FF80FF80091D7F9C0C>108 D<FC7E07E000FC838838001D01
12379018001E01E01C001C01C01C001C01C01C001C01C01C001C01C01C001C01C01C001C01C0
12381C001C01C01C001C01C01C001C01C01C001C01C01C001C01C01C001C01C01C00FF8FF8FF
123980FF8FF8FF8021127F9124>I<FC7C00FC87001D03001E03801C03801C03801C03801C03
1240801C03801C03801C03801C03801C03801C03801C03801C0380FF9FF0FF9FF014127F9117
1241>I<03F0000E1C00180600380700700380700380F003C0F003C0F003C0F003C0F003C0F0
124203C07003807003803807001C0E000E1C0003F00012127F9115>I<FCFC00FF87001E0380
12431C01C01C01E01C00E01C00F01C00F01C00F01C00F01C00F01C00F01C01E01C01E01C01C0
12441E03801F07001CFC001C00001C00001C00001C00001C00001C0000FF8000FF8000141A7F
12459117>I<03F1800E19801C0780380780780380780380F00380F00380F00380F00380F003
124680F003807003807803803807801C07800E1B8003E3800003800003800003800003800003
124780000380001FF0001FF0141A7F9116>I<FCE0FD381E781E781C301C001C001C001C001C
1248001C001C001C001C001C001C00FFC0FFC00D127F9110>I<1F9020F04070C030C030E030
1249F8007F803FE00FF000F8C038C018C018E018E010D0608FC00D127F9110>I<0C000C000C
1250000C000C000C001C001C003FE0FFE01C001C001C001C001C001C001C001C001C301C301C
1251301C301C300C200E6003C00C1A7F9910>I<FC1F80FC1F801C03801C03801C03801C0380
12521C03801C03801C03801C03801C03801C03801C03801C03801C07800C07800E1BF003E3F0
125314127F9117>I<FF0FE0FF0FE01C07801C03000E06000E06000E0600070C00070C00070C
12540003980003980003F80001F00001F00000E00000E00000E00013127F9116>I<FF3FCFE0
1255FF3FCFE03C0F07801C0F03001C1B03001C1B87000E1B86000E3B86000E3186000731CC00
12560731CC000760CC0003E0F80003E0F80003C0780003C0780001C0700001C070001B127F91
12571E>I<7F8FF07F8FF00F0780070600038E0001DC0001D80000F00000700000780000F800
125801DC00038E00030E000607000F0380FF0FF8FF0FF81512809116>I<FF0FE0FF0FE01C07
1259801C03000E06000E06000E0600070C00070C00070C0003980003980003F80001F00001F0
12600000E00000E00000E00000C00000C00000C000F18000F18000F300006600003C0000131A
12617F9116>I<1C043F0843F080E00E047D9B15>126 D E /Fr 13 118
1262df<0F001F003F803F007E00F800F000C0000908769C18>19 D<00038000000380000007
1263C0000007C0000007C000000FE000000FE000001FF000001BF000003BF8000031F8000031
1264F8000060FC000060FC0000E0FE0000C07E0000C07E0001803F0001FFFF0003FFFF800300
12651F8007001FC006000FC006000FC00C0007E00C0007E0FF803FFEFF803FFE1F1C7E9B24>
126665 D<07F8601FFEE03C07E07801E07000E0F000E0F00060F00060F80000FE0000FFE000
12677FFE003FFF003FFF800FFFC007FFE0007FE00003F00001F00000F0C000F0C000F0C000E0
1268E000E0F001C0FC03C0EFFF00C3FC00141C7D9B1B>83 D<07F8001FFE003F1F803F07803F
126907C01E07C00C07C003FFC01FFFC03F87C07E07C0FC07C0FC07C0FC07C0FC0FC07E1FC03F
1270FBF80FE1F815127F9117>97 D<FF0000FF00001F00001F00001F00001F00001F00001F00
1271001F00001F00001F00001F1FC01FFFE01FC1F81F00F81F007C1F007C1F007E1F007E1F00
12727E1F007E1F007E1F007E1F007C1F007C1F80F81FC1F01C7FE0181F80171D7F9C1B>I<03
1273F8000FFE001F3F003E3F007C3F007C1E00FC0C00FC0000FC0000FC0000FC0000FC00007C
127400007E01803E03801F07000FFE0003F80011127E9115>I<1C003E007F007F007F003E00
12751C00000000000000000000007F007F001F001F001F001F001F001F001F001F001F001F00
12761F001F001F001F00FFC0FFC00A1E7F9D0E>105 D<FF1FC0FE00FF7FE3FF001FE1F70F80
12771F80FC07C01F80FC07C01F00F807C01F00F807C01F00F807C01F00F807C01F00F807C01F
127800F807C01F00F807C01F00F807C01F00F807C01F00F807C01F00F807C0FFE7FF3FF8FFE7
1279FF3FF825127F9128>109 D<01FC000FFF801F07C03E03E07C01F07C01F0FC01F8FC01F8
1280FC01F8FC01F8FC01F8FC01F87C01F07C01F03E03E01F07C00FFF8001FC0015127F9118>
1281111 D<FE7C00FEFF001FDF801F9F801F9F801F0F001F06001F00001F00001F00001F0000
12821F00001F00001F00001F00001F0000FFE000FFE00011127F9114>114
1283D<1FD83FF87038E018E018F000FF807FE07FF01FF807FC007CC01CC01CE01CF038FFF0CF
1284C00E127E9113>I<030003000300070007000F000F003F00FFFCFFFC1F001F001F001F00
12851F001F001F001F001F001F0C1F0C1F0C1F0C0F9807F003E00E1A7F9913>I<FF07F8FF07
1286F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00F81F00
1287F81F01F80F03F807FEFF03F8FF18127F911B>I E /Fs 7 115 df<000FF000007FFC0000
1288FFFF0001FFFF0007F81F0007E006000F8000001F0000003F0000003E0000003E0000007C
12890000007C0000007C000000F8000000F8000000F8000000F8000000F8000000F8000000F8
1290000000F8000000F80000007C0000007C0000007C0000003E0000003E0000003F0000001F
12910000000F80008007E0038007F80F8001FFFF8000FFFF00007FFC00000FF00019257DA31F
1292>67 D<000FF000003FFE0000FFFF8001FFFF8003F80F8007E003000FC000001F8000001F
12930000003E0000003E0000007C0000007C0000007C000000F8000000F8000000F8000000F8
1294000000F8000000F8000000F800FFC0F800FFC0F800FFC07C0003C07C0003C07C0003C03E
12950003C03E0003C01F0003C01F8003C00FC003C007E003C003F807C001FFFFC000FFFFC000
12963FFF00000FF8001A257DA321>71 D<FFFFFFF0FFFFFFF0FFFFFFF0FFFFFFF0000F800000
12970F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000
12980F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000
12990F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000
13000F8000000F8000000F80001C237EA221>84 D<07F0003FFC007FFE00781F00600F004007
13018000078000078000078001FF800FFF801FFF807F0780780780F00780F00780F00780F80F
1302807C1F807FFF803FFF801FC78011167E9517>97 D<01F80007FE000FFF001F07803C03C0
13037801C07801C07000E0FFFFE0FFFFE0FFFFE0F00000F00000F000007000007800007C0000
13043E00401F03C00FFFC007FF8000FC0013167F9516>101 D<007F01FF03FF07C107000F00
13050F000F000F000F000F000F000F00FFF8FFF8FFF80F000F000F000F000F000F000F000F00
13060F000F000F000F000F000F000F000F000F000F000F00102380A20F>I<F0E0F3E0F7E0FF
1307E0FF00FC00F800F800F000F000F000F000F000F000F000F000F000F000F000F000F000F0
1308000B167C9511>114 D E /Ft 30 118 df<387CFCFE7E3E0E1C3CF8F040070C788516>
130944 D<FFFF80FFFF80FFFF8011037E8D16>I<3078FCFC78300606788516>I<0001800003
131080000380000700000700000E00000E00001C00001C0000380000380000700000700000E0
13110000E00001C00001C0000380000380000700000700000E00000E00001C00001C00003800
131200380000700000700000E00000E00000C0000011207E9C16>I<03E0000FF8001FFC001E
13133C00380E00780F00700700700700E00380E00380E00380E00380E00380E00380E00380E0
13140380F00780700700700700780F003C1E001E3C001FFC000FF80003E00011197E9816>I<
13150300070007000F001F00FF00FF00E7000700070007000700070007000700070007000700
13160700070007000700FFF8FFF8FFF80D197B9816>I<07E0001FF8003FFC00783E00E00700
1317F00780F00380600380000380000380000700000700000E00001C0000380000700000E000
131801C0000380000F00001E03803803807FFF80FFFF807FFF8011197E9816>I<007C0000FC
13190000FC0001DC00039C00039C00071C000F1C000E1C001E1C003C1C00381C00781C00F01C
132000FFFFE0FFFFE0FFFFE0001C00001C00001C00001C00001C0001FFC001FFC001FFC01319
13217F9816>52 D<3FFE007FFE007FFE00700000700000700000700000700000700000700000
132277F0007FFC007FFE00780F00300700000380000380600380F00380F00380E00700781E00
13233FFC001FF80007E00011197E9816>I<00F80003FC0007FE000F07001C0F00380F007806
132400700000700000E7F800EFFC00FFFE00F80F00F00700F00380E00380E003807003807003
1325807007803807003C1E001FFC000FF80003E00011197E9816>I<07F0001FFC003FFE007C
13261F00F00780E00380E00380E003807007007C1F001FFC0007F0001FFC003C1E00700700F0
13270780E00380E00380E00380F007807007007C1F003FFE001FFC0007F00011197E9816>56
1328D<03E0000FF8001FFC003C1E00700E00700700E00700E00780E00380E00380E007807007
132980780F803FFF801FFB800FF380000700000700300700780E00781C00707C003FF8001FE0
1330000F800011197E9816>I<3078FCFC78300000000000003078FCFC78300612789116>I<00
1331F80003FC0007FE000F07001C3B8038FF8079FF8073C7C07383C0E701C0E701C0E701C0E7
133201C0E701C0E701C0E701C073838073C78079FF0038FE001C38000F03C007FFC003FF0000
1333FC0012197E9816>64 D<7FF800FFFE007FFF001C0F001C07801C03C01C01C01C01C01C01
1334E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C01C01C01C01C03C01C07
1335801C0F807FFF00FFFE007FF8001319809816>68 D<1FE0003FF0007FF800783C00300E00
1336000E00003E0007FE001FFE007FCE00780E00E00E00E00E00E00E00783E007FFFE03FF7E0
13370FC3E013127E9116>97 D<FC0000FC0000FC00001C00001C00001C00001C00001C7C001D
1338FE001FFF001F07801E03C01C01C01C00E01C00E01C00E01C00E01C00E01C00E01E01C01E
133903C01F07801FFF001DFE000CF80013197F9816>I<03F80FFC1FFE3C1E780C7000E000E0
134000E000E000E000F000700778073E0E1FFC0FF803F010127D9116>I<003F00003F00003F
13410000070000070000070000070003E7000FF7001FFF003C1F00780F00700700E00700E007
134200E00700E00700E00700E00700700F00780F003C1F001FFFE00FF7E007C7E013197F9816
1343>I<03F0000FFC001FFE003C0F00780700700380E00380FFFF80FFFF80FFFF80E00000E0
134400007003807803803E07801FFF0007FE0001F80011127E9116>I<001E00007F0001FF80
134501C7800383000380000380007FFF00FFFF00FFFF00038000038000038000038000038000
13460380000380000380000380000380000380000380007FFC00FFFE007FFC0011197F9816>
1347I<FC0000FC0000FC00001C00001C00001C00001C00001CF8001DFC001FFE001F0F001E07
1348001C07001C07001C07001C07001C07001C07001C07001C07001C07001C0700FF8FE0FF9F
1349E0FF8FE013197F9816>104 D<07000F800F800F800700000000000000FF80FF80FF8003
13508003800380038003800380038003800380038003800380FFFCFFFEFFFC0F1A7C9916>I<
13517FC000FFC0007FC00001C00001C00001C00001C00001C00001C00001C00001C00001C000
135201C00001C00001C00001C00001C00001C00001C00001C00001C00001C0007FFF00FFFF80
13537FFF0011197E9816>108 D<03E0000FF8001FFC003C1E00780F00700700E00380E00380
1354E00380E00380E00380F00780700700780F003C1E001FFC000FF80003E00011127E9116>
1355111 D<FC7C00FDFE00FFFF001F07801E03C01C01C01C00E01C00E01C00E01C00E01C00E0
13561C00E01E01C01E03C01F07801FFF001DFE001CF8001C00001C00001C00001C00001C0000
13571C0000FF8000FF8000FF8000131B7F9116>I<7F0F80FF3FC07F7FE007F1E007C0C00780
1358000780000700000700000700000700000700000700000700000700007FFC00FFFC007FFC
13590013127F9116>114 D<0FEC3FFC7FFCF03CE01CE01C70007F801FF007F8003C600EE00E
1360F00EF81EFFFCFFF8C7E00F127D9116>I<0300000700000700000700000700007FFF00FF
1361FF00FFFF0007000007000007000007000007000007000007000007010007038007038007
1362038007870003FE0001FC0000F80011177F9616>I<FC3F00FC3F00FC3F001C07001C0700
13631C07001C07001C07001C07001C07001C07001C07001C07001C07001C1F001FFFE00FFFE0
136407E7E013127F9116>I E /Fu 34 125 df<038007800F800F001E003C0038007000E000
13654000090A77A218>19 D<FFF8FFF8FFF80D03808B10>45 D<000FE010003FF83000F80E70
136601E0077003C001F0078001F00F0000F01E0000F03E0000703C0000707C0000707C000030
13677800003078000030F8000000F8000000F8000000F8000000F8000000F8000000F8000000
1368F800000078000000780000307C0000307C0000303C0000303E0000601E0000600F0000C0
1369078000C003C0018001E0030000FC0E00003FFC00000FE0001C247DA223>67
1370D<FFFFF800FFFFFF0007C00F8007C003C007C001E007C000F007C0007807C0007C07C000
13713C07C0003E07C0001E07C0001E07C0001E07C0001F07C0001F07C0001F07C0001F07C000
13721F07C0001F07C0001F07C0001F07C0001F07C0001E07C0001E07C0003E07C0003C07C000
13733C07C0007807C000F007C001F007C003E007C00F80FFFFFF00FFFFF80020227FA125>I<
1374FFFFFFE0FFFFFFE007C007E007C001E007C000E007C0006007C0007007C0007007C00030
137507C0003007C0183007C0183007C0180007C0180007C0380007C0780007FFF80007FFF800
137607C0780007C0380007C0180007C0180007C0180007C0180007C0000007C0000007C00000
137707C0000007C0000007C0000007C0000007C00000FFFF0000FFFF00001C227FA120>70
1378D<FFFE1FFFC0FFFE1FFFC007C000F80007C000F80007C000F80007C000F80007C000F800
137907C000F80007C000F80007C000F80007C000F80007C000F80007C000F80007C000F80007
1380C000F80007FFFFF80007FFFFF80007C000F80007C000F80007C000F80007C000F80007C0
138100F80007C000F80007C000F80007C000F80007C000F80007C000F80007C000F80007C000
1382F80007C000F80007C000F80007C000F800FFFE1FFFC0FFFE1FFFC022227FA125>72
1383D<FFFEFFFE07C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007
1384C007C007C007C007C007C007C007C007C007C007C007C007C007C007C0FFFEFFFE0F227F
1385A112>I<FFFE0000FFFE00000F8000000F8000000F8000000F8000000F8000000F800000
13860F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000
13870F8000000F8000000F8000000F8000000F8001800F8001800F8001800F8001800F800380
13880F8003800F8003000F8007000F8007000F800F000F803F00FFFFFF00FFFFFF0019227EA1
13891E>76 D<FFFFF800FFFFFE0007C01F8007C007C007C003C007C001E007C001E007C001F0
139007C001F007C001F007C001F007C001F007C001E007C001E007C003C007C0078007C01F00
139107FFFC0007C0000007C0000007C0000007C0000007C0000007C0000007C0000007C00000
139207C0000007C0000007C0000007C0000007C0000007C00000FFFE0000FFFE00001C227FA1
139321>80 D<FFFFF00000FFFFFE000007C01F000007C007800007C003C00007C003E00007C0
139401F00007C001F00007C001F00007C001F00007C001F00007C001E00007C003E00007C003
1395C00007C007800007C01E000007FFF0000007C03C000007C01E000007C00F000007C00F80
13960007C007C00007C007C00007C007C00007C007C00007C007C00007C007C00007C007C000
139707C007C00007C007C0C007C007C0C007C003C0C0FFFE01E180FFFE00F1000000003E0022
1398237FA124>82 D<FFFE03FFC0FFFE03FFC007C0003C0007C000180007C000180007C00018
13990007C000180007C000180007C000180007C000180007C000180007C000180007C0001800
140007C000180007C000180007C000180007C000180007C000180007C000180007C000180007
1401C000180007C000180007C000180007C000180007C000180007C000180003C000300003E0
140200300001E000300001E000600000F000C0000078018000003E070000000FFE00000003F8
1403000022237FA125>85 D<FFF83FFE07FEFFF83FFE07FE1F8003F001F80F8003E000600F80
140403F000600FC003F000E007C003F000C007C003F000C007E006F800C003E006F8018003E0
140506F8018003E00C7C018001F00C7C030001F00C7C030001F01C7E030001F8183E070000F8
1406183E060000F8183E060000FC301F0600007C301F0C00007C301F0C00007C600F8C00003E
1407600F9800003E600F9800003EE00FD800003FC007F800001FC007F000001FC007F000001F
14088003F000000F8003E000000F8003E000000F0001E00000070001C00000070001C0000007
14090001C0002F237FA132>87 D<1FF000383C007C0E007C0F007C0780380780000780000780
141000FF8007C7801E07803C0780780780700780F00798F00798F00798F00F987817983C23F0
14110FC1E015157E9418>97 D<0F0000FF0000FF00001F00000F00000F00000F00000F00000F
141200000F00000F00000F00000F00000F00000F3F000F61C00F80600F00300F00380F003C0F
1413001C0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001C0F003C0F00380F00700F
141480600E61C00C3F0017237FA21B>I<01FE000707000C0F801C0F80380F80780700700000
1415F00000F00000F00000F00000F00000F00000F000007000007800C03800C01C01800C0300
141607060001F80012157E9416>I<0001E0001FE0001FE00003E00001E00001E00001E00001
1417E00001E00001E00001E00001E00001E00001E001F9E00707E00C03E01C01E03801E07801
1418E07001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E07001E07801E03801E01801
1419E00C03F0070DFE01F1FE17237EA21B>I<01FC000707000C03801C01C03801C07801E070
142000E0F000E0FFFFE0F00000F00000F00000F00000F000007000007800603800601C00C00E
1421018007070000FC0013157F9416>I<003E0000E18003C3C00387C00787C00F03800F0000
14220F00000F00000F00000F00000F00000F00000F0000FFF800FFF8000F00000F00000F0000
14230F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F0000
14240F00000F0000FFF000FFF000122380A20F>I<0000F003F1180E1E381C0E383807303807
1425007807807807807807807807803807003807001C0E001E1C0033F0002000002000003000
1426003800003FFE001FFFC00FFFE03801F0700070E00038E00038E00038E000386000307000
1427703800E00E038003FE0015217F9518>I<0F0000FF0000FF00001F00000F00000F00000F
142800000F00000F00000F00000F00000F00000F00000F00000F0F800F31C00F40E00F80F00F
142980F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F
143000F00F00F00F00F0FFF3FFFFF3FF18237FA21B>I<0E001F001F001F000E000000000000
143100000000000000000000000F007F007F001F000F000F000F000F000F000F000F000F000F
1432000F000F000F000F000F000F00FFE0FFE00B2280A10D>I<0F00FF00FF001F000F000F00
14330F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F00
14340F000F000F000F000F000F000F000F000F00FFF0FFF00C2380A20D>108
1435D<0F0FC07E00FF30E18700FF407203801F807C03C00F807C03C00F007803C00F007803C0
14360F007803C00F007803C00F007803C00F007803C00F007803C00F007803C00F007803C00F
1437007803C00F007803C00F007803C00F007803C00F007803C0FFF3FF9FFCFFF3FF9FFC2615
14387F9429>I<0F0F80FF31C0FF40E01F80F00F80F00F00F00F00F00F00F00F00F00F00F00F
143900F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F0FFF3FFFFF3FF18157F94
14401B>I<01FC000707000C01801800C03800E0700070700070F00078F00078F00078F00078
1441F00078F00078F000787000707800F03800E01C01C00E038007070001FC0015157F9418>
1442I<0F3F00FF61C0FF80600F00700F00380F003C0F003C0F001E0F001E0F001E0F001E0F00
14431E0F001E0F001E0F003C0F003C0F00380F00700F80E00F61C00F3F000F00000F00000F00
1444000F00000F00000F00000F00000F0000FFF000FFF000171F7F941B>I<01F860070CE00E
144502E01C03E03801E07801E07801E0F001E0F001E0F001E0F001E0F001E0F001E0F001E078
144601E07801E03801E01C03E00C03E0070DE001F1E00001E00001E00001E00001E00001E000
144701E00001E00001E0001FFE001FFE171F7E941A>I<0F1E00FF2300FF47801F87800F8300
14480F80000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F0000
14490F00000F0000FFF800FFF8001115809413>I<0FC8307860386018E018E018F000FC007F
1450C03FE01FF007F8007CC03CC01CC01CE01CE018F038D8708FC00E157E9413>I<06000600
145106000600060006000E000E000E001E003FFCFFFC1E001E001E001E001E001E001E001E00
14521E001E001E0C1E0C1E0C1E0C1E0C1E0C0F18071001E00E1F7F9E13>I<0F00F0FF0FF0FF
14530FF01F01F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F
145400F00F00F00F01F00F01F00702F80386FF00F8FF18157F941B>I<FFC1FEFFC1FE1F00F8
14550F00600F00600780C00780C00780C003C18003C18003E38001E30001E30000F60000F600
145600F600007C00007C00007C00003800003800003000003000007000006000F86000F8C000
1457F8C000F980006300003E0000171F7F941A>121 D<3FFFC03C0780380F80300F00701E00
1458603E00603C0060780000F80000F00001E00003C00007C0C00780C00F00C01F01C01E0180
14593C01807C0380780780FFFF8012157F9416>I<FFFFFFFFFFFF3001808C31>124
1460D E /Fv 21 118 df<78FCFCFCFC7806067A8512>46 D<007F800001FFE0000781F8000E
1461007C0018003E0030001F0030000F8060000FC0600007C0F80007C0FC0007E0FE0007E0FE
14620003E0FE0003E0FE0003E07C0007E0000007E0000007C0000007C000000FC000000F8000
1463000F8000001F0000003E0000003C00000078000000F8000000F0000001E0000003C00000
1464070000000E0000001C000000180000003000000060000000C00060018000600380006007
14650000C00E0000C00C0000C0180001C03FFFFFC07FFFFF80FFFFFF80FFFFFF801B2F7DAE21
1466>50 D<00001C0000001C0000003C0000003C0000007C000000FC000000FC000001BC0000
146703BC0000033C0000073C0000063C00000C3C00001C3C0000183C0000303C0000303C0000
1468603C0000E03C0000C03C0001803C0003803C0003003C0007003C0006003C000C003C001C
1469003C0018003C0030003C0030003C0060003C00E0003C00FFFFFFF8FFFFFFF800003C0000
1470003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C0000
1471007E00000FFFF0000FFFF01D2F7EAE21>52 D<FFFFC00000FFFFC0000007F000000003E0
147200000003E000000003E000000003E000000003E000000003E000000003E000000003E000
1473000003E000000003E000000003E000000003E000000003E000000003E000000003E00000
14740003E000000003E000000003E000000003E000000003E000000003E000000003E0000000
147503E000000003E000000003E000000003E000000003E000000003E000000003E000006003
1476E000006003E000006003E000006003E00000C003E00000C003E00000C003E00000C003E0
14770001C003E00001C003E00003C003E00003C003E00007C003E0000F8003E0003F8007E000
1478FF80FFFFFFFF80FFFFFFFF8023317DB029>76 D<FFF00000007FF8FFF8000000FFF807F8
1479000000FF0003F8000000FE00037C000001BE00037C000001BE00037C000001BE00033E00
148000033E00033E0000033E00033E0000033E00031F0000063E00031F0000063E00031F0000
1481063E00030F80000C3E00030F80000C3E00030F80000C3E000307C000183E000307C00018
14823E000307C000183E000303E000303E000303E000303E000303E000303E000301F000603E
1483000301F000603E000301F000C03E000300F800C03E000300F800C03E0003007C01803E00
148403007C01803E0003007C01803E0003003E03003E0003003E03003E0003003E03003E0003
1485001F06003E0003001F06003E0003001F06003E0003000F8C003E0003000F8C003E000300
14860F8C003E00030007D8003E00030007D8003E00030007D8003E00030003F0003E00030003
1487F0003E00030003F0003E00078001E0003E000FC001E0007F00FFFC01E00FFFF8FFFC00C0
14880FFFF835317CB03D>I<FFFFFFE000FFFFFFFC0007E0007F0003E0000F8003E00007C003
1489E00003E003E00001F003E00001F803E00000F803E00000F803E00000FC03E00000FC03E0
14900000FC03E00000FC03E00000FC03E00000FC03E00000F803E00000F803E00001F803E000
149101F003E00003E003E00007C003E0000F8003E0007F0003FFFFFC0003FFFFE00003E00000
14920003E000000003E000000003E000000003E000000003E000000003E000000003E0000000
149303E000000003E000000003E000000003E000000003E000000003E000000003E000000003
1494E000000003E000000003E000000003E000000003E000000007F0000000FFFF800000FFFF
149580000026317DB02D>80 D<FFFFFF000000FFFFFFF0000007E001FC000003E0003F000003
1496E0000F800003E00007C00003E00003E00003E00003F00003E00003F00003E00001F00003
1497E00001F80003E00001F80003E00001F80003E00001F80003E00001F80003E00001F00003
1498E00003F00003E00003F00003E00003E00003E00007C00003E0000F800003E0003F000003
1499E001FC000003FFFFF0000003FFFFC0000003E001F0000003E0007C000003E0003E000003
1500E0001F000003E0000F000003E0000F800003E00007800003E00007C00003E00007C00003
1501E00007C00003E00007C00003E00007C00003E00007E00003E00007E00003E00007E00003
1502E00007E00003E00007E00003E00007E01803E00007F01803E00003F01803E00003F01807
1503F00001F830FFFF8000F870FFFF80007FE0000000000F802D327CB031>82
1504D<03FE00000FFFC0001E03E0003F00F0003F0078003F003C001E001C000C001E0000001E
15050000001E0000001E0000001E000001FE00003FFE0001FF1E0007F01E000F801E001F001E
1506003E001E007C001E007C001E00F8001E0CF8001E0CF8001E0CF8003E0CF8003E0C7C007E
15070C3E00DF1C1F038FB80FFF07F003F803C01E1F7D9E21>97 D<001FF00000FFFC0001F01E
15080007C03F000F003F000F003F001E001E003C000C003C0000007C00000078000000F80000
150900F8000000F8000000F8000000F8000000F8000000F8000000F8000000F80000007C0000
1510007C0000003C0000003E0001801E0001800F0003000F80070007C00E0001F81C0000FFF0
151100001FC000191F7E9E1D>99 D<003F800000FFE00003E0F80007803C000F001E001E001E
1512001E000F003C000F007C000F007C000F8078000780F8000780FFFFFF80FFFFFF80F80000
151300F8000000F8000000F8000000F8000000F8000000780000007C0000003C0000003C0001
1514801E0001800F0003000F80060007C00E0001F0380000FFF000001FC000191F7E9E1D>
1515101 D<0003F0000FF8003C3C00787E00F07E01E07E01E03C01C01803C00003C00003C000
151603C00003C00003C00003C00003C00003C00003C00003C000FFFFC0FFFFC003C00003C000
151703C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C000
151803C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C000
151907E0007FFF007FFF0017327FB114>I<000000F0007F03F801FFCF1C03C1FC3C0780F83C
15200F0078181F007C001E003C003E003E003E003E003E003E003E003E003E003E003E003E00
15213E003E001E003C001F007C000F0078000780F0000FC1E0000DFFC0001C7F000018000000
1522180000001C0000001C0000001E0000000FFFF8000FFFFF0007FFFF800FFFFFC01E0007E0
1523380001F07000007070000078E0000038E0000038E0000038E0000038E000003870000070
1524780000F03C0001E01E0003C007C01F0001FFFC00003FE0001E2F7E9F21>I<0780000000
1525FF80000000FF800000000F80000000078000000007800000000780000000078000000007
1526800000000780000000078000000007800000000780000000078000000007800000000780
15270000000780000000078000000007800000000781FE00000787FF8000078E07C000079803
1528E00007B001E00007E000F00007C000F00007C000F00007C000F000078000F000078000F0
152900078000F000078000F000078000F000078000F000078000F000078000F000078000F000
1530078000F000078000F000078000F000078000F000078000F000078000F000078000F00007
15318000F000078000F000078000F0000FC001F800FFFC1FFF80FFFC1FFF8021327EB125>I<
15320F001F801F801F801F800F00000000000000000000000000000000000000000000000780
15337F807F800F80078007800780078007800780078007800780078007800780078007800780
15340780078007800780078007800780078007800FC0FFF8FFF80D307EAF12>I<0780FF80FF
1535800F80078007800780078007800780078007800780078007800780078007800780078007
1536800780078007800780078007800780078007800780078007800780078007800780078007
153780078007800780078007800780078007800FC0FFFCFFFC0E327EB112>108
1538D<0781FE003FC000FF87FF80FFF000FF8E07C1C0F8000F9803E3007C0007B001E6003C00
153907E000FC001E0007C000F8001E0007C000F8001E0007C000F8001E00078000F0001E0007
15408000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E000780
154100F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000
1542F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0
1543001E00078000F0001E00078000F0001E000FC001F8003F00FFFC1FFF83FFF0FFFC1FFF83
1544FFF0341F7E9E38>I<0781FE0000FF87FF8000FF8E07C0000F9803E00007B001E00007E0
154500F00007C000F00007C000F00007C000F000078000F000078000F000078000F000078000
1546F000078000F000078000F000078000F000078000F000078000F000078000F000078000F0
154700078000F000078000F000078000F000078000F000078000F000078000F000078000F000
1548078000F0000FC001F800FFFC1FFF80FFFC1FFF80211F7E9E25>I<001FC00000FFF80001
1549E03C0007800F000F0007801E0003C01E0003C03C0001E03C0001E0780000F0780000F078
15500000F0F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F878
15510000F07C0001F03C0001E03C0001E01E0003C01E0003C00F00078007C01F0001F07C0000
1552FFF800001FC0001D1F7E9E21>I<0783E0FF8FF8FF9C7C0FB87C07F07C07E03807E00007
1553C00007C00007C00007800007800007800007800007800007800007800007800007800007
155480000780000780000780000780000780000780000780000780000FC000FFFE00FFFE0016
15551F7E9E19>114 D<00C00000C00000C00000C00000C00001C00001C00001C00003C00003
1556C00007C0000FC0001FC000FFFFE0FFFFE003C00003C00003C00003C00003C00003C00003
1557C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C03003C03003
1558C03003C03003C03003C03003C03003C03001E06001E06000F0C0007F80001F00142C7FAB
155919>116 D<078000F000FF801FF000FF801FF0000F8001F000078000F000078000F00007
15608000F000078000F000078000F000078000F000078000F000078000F000078000F0000780
156100F000078000F000078000F000078000F000078000F000078000F000078000F000078000
1562F000078000F000078000F000078001F000078001F000078003F000038007F00003C00EF0
15630001F03CF80000FFF0FF80003FC0FF80211F7E9E25>I E end
1564%%EndProlog
1565%%BeginSetup
1566%%Feature: *Resolution 300dpi
1567TeXDict begin
1568
1569%%EndSetup
1570%%Page: 1 1
15711 0 bop 108 381 a Fv(Reference)22 b(Man)n(ual)f(of)g(the)h(Programming)
1572f(Language)g(Lua)g(2.4)99 508 y Fu(Rob)q(erto)c(Ierusalimsc)o(h)o(y)49
1573b(Luiz)17 b(Henrique)e(de)h(Figueiredo)50 b(W)l(aldemar)17
1574b(Celes)g(Filho)563 587 y Ft(roberto,lhf,celes)o(@icad)o(.puc-)o(rio.b)
1575o(r)359 694 y Fs(T)l(eC)431 709 y(Graf)534 694 y Fu(|)g(Departamen)o
1576(to)f(de)g(Inform\023)-24 b(atica)17 b(|)f(PUC-Rio)661
1577790 y Ft(Date:)21 b(1996/04/29)f(18:50:08)842 957 y Fr(Abstract)72
15781033 y Fq(Lua)13 b(is)h(an)f(extension)i(programmi)o(ng)c(language)h
1579(designed)j(to)e(b)q(e)i(used)f(as)g(a)f(con\014guration)g(language)g
1580(for)72 1083 y(an)o(y)18 b(program)e(that)i(needs)h(one.)30
1581b(This)18 b(do)q(cumen)o(t)f(describ)q(es)j(V)m(ersion)e(2.4)f(of)g
1582(the)i(Lua)e(programming)72 1132 y(language)e(and)g(the)h(API)g(that)g
1583(allo)o(ws)e(in)o(teraction)i(b)q(et)o(w)o(een)h(Lua)e(programs)f(and)i
1584(its)f(host)h(C)g(program.)72 1182 y(It)e(also)f(presen)o(ts)j(some)d
1585(examples)g(of)g(using)h(the)h(main)c(features)k(of)f(the)g(system.)881
15861397 y Fr(Sum\023)-24 b(ario)72 1465 y Fq(Lua)15 b(\023)-20
1587b(e)18 b(uma)d(linguagem)f(de)j(extens~)-21 b(ao)18 b(pro)r(jetada)f
1588(para)f(ser)i(usada)f(como)e(linguagem)g(de)i(con\014gura\030)-18
1589b(c~)d(ao)72 1515 y(em)12 b(qualquer)g(programa)e(que)j(precise)h(de)f
1590(uma.)j(Este)e(do)q(cumen)o(to)d(descrev)o(e)k(a)d(v)o(ers~)-21
1591b(ao)13 b(2.4)e(da)h(linguagem)72 1565 y(de)18 b(programa\030)-18
1592b(c~)d(ao)16 b(Lua)i(e)g(a)g(In)o(terface)h(de)f(Programa\030)-18
1593b(c~)d(ao)16 b(que)i(p)q(ermite)g(a)f(in)o(tera\030)-18
1594b(c~)d(ao)18 b(en)o(tre)h(programas)72 1614 y(Lua)c(e)g(o)g(programa)e
1595(C)h(hosp)q(edeiro.)22 b(O)15 b(do)q(cumen)o(to)g(tam)o(b)o(\023)-20
1596b(em)12 b(apresen)o(ta)k(alguns)e(exemplos)g(de)i(uso)f(das)72
15971664 y(principais)f(caracter)-5 b(\023)-16 b(\020sticas)15
1598b(do)f(sistema.)-42 1807 y Fp(1)67 b(In)n(tro)r(duction)-42
15991909 y Fo(Lua)18 b(is)f(an)g(extension)g(programmi)o(ng)d(language)j
1600(designed)g(to)g(supp)q(ort)g(general)g(pro)q(cedural)g(programming)-42
16011965 y(features)f(with)g(data)g(description)f(facilities.)22
1602b(It)16 b(is)g(supp)q(osed)h(to)f(b)q(e)g(used)h(as)f(a)g
1603(con\014guration)g(language)f(for)-42 2022 y(an)o(y)j(program)d(that)i
1604(needs)i(one.)27 b(Lua)18 b(has)f(b)q(een)i(designed)f(and)g(implemen)o
1605(ted)d(b)o(y)j(W.)f(Celes)g(F.,)g(L.)h(H.)f(de)-42 2078
1606y(Figueiredo)e(and)g(R.)g(Ierusalimsc)o(h)o(y)l(.)29
16072135 y(Lua)d(is)f(implemen)o(ted)f(as)h(a)g(library)l(,)g(written)g(in)
1608h(C.)f(Being)g(an)h(extension)g(language,)f(Lua)h(has)f(no)h(notion)f
1609(of)-42 2191 y(a)h(\\main")d(program:)16 b(it)10 b(only)h(w)o(orks)g
1610Fn(emb)n(e)n(dde)n(d)f Fo(in)i(a)f(host)g(clien)o(t,)g(called)g(the)g
1611Fn(emb)n(e)n(dding)f Fo(program.)17 b(This)11 b(host)-42
16122248 y(program)i(can)j(in)o(v)o(ok)o(e)e(functions)h(to)f(execute)i(a)f
1613(piece)g(of)g(co)q(de)g(in)g(Lua,)g(can)h(write)e(and)h(read)g(Lua)h(v)
1614m(ariables,)-42 2304 y(and)f(can)e(register)g(C)h(functions)f(to)h(b)q
1615(e)g(called)g(b)o(y)f(Lua)h(co)q(de.)20 b(Through)14
1616b(the)g(use)g(of)g(C)f(functions,)h(Lua)g(can)g(b)q(e)-42
16172360 y(augmen)o(ted)d(to)h(cop)q(e)g(with)f(rather)h(di\013eren)o(t)f
1618(domains,)f(th)o(us)i(creating)f(customized)g(programmi)o(ng)e
1619(languages)-42 2417 y(sharing)15 b(a)g(syn)o(tactical)e(framew)o(ork.)
162029 2473 y(Lua)f(is)e(free)i(distribution)e(soft)o(w)o(are,)g(and)h(pro)
1621o(vided)g(as)g(usual)g(with)g(no)g(guaran)o(tees.)18
1622b(The)11 b(implemen)o(tatio)o(n)-42 2530 y(describ)q(ed)17
1623b(in)e(this)f(man)o(ual)g(is)g(a)o(v)m(ailable)g(b)o(y)h(anon)o(ymous)f
1624(ftp)h(from)30 2623 y Fm(ftp.icad.puc-rio.br:/pub/lu)o(a/lua.t)o(ar.gz)
1625922 2748 y Fo(1)p eop
1626%%Page: 2 2
16272 1 bop -42 199 a Fo(or)15 b(b)o(y)g(WWW)g(\(W)l(orld)f(Wide)h(W)l
1628(eb\))g(from)30 293 y Fm(http://www.inf.puc-rio.br/~)o(roberto)o
1629(/lua.ht)o(ml)-42 436 y Fp(2)67 b(En)n(vironmen)n(t)25
1630b(and)e(Ch)n(unks)-42 538 y Fo(All)10 b(statemen)o(ts)e(in)i(Lua)h(are)
1631f(executed)h(in)g(a)f Fn(glob)n(al)h(envir)n(onment)p
1632Fo(.)17 b(This)9 b(en)o(vironmen)o(t,)h(whic)o(h)g(k)o(eeps)h(all)e
1633(global)-42 594 y(v)m(ariables)14 b(and)g(functions,)f(is)g
1634(initialized)g(at)g(the)h(b)q(eginning)g(of)f(the)h(em)o(b)q(edding)f
1635(program)f(and)i(p)q(ersists)f(un)o(til)-42 651 y(its)i(end.)29
1636707 y(The)g(global)d(en)o(vironmen)o(t)h(can)h(b)q(e)h(manipulated)e(b)
1637o(y)h(Lua)h(co)q(de)g(or)e(b)o(y)h(the)h(em)o(b)q(edding)f(program,)e
1638(whic)o(h)-42 764 y(can)k(read)f(and)g(write)g(global)e(v)m(ariables)i
1639(using)g(functions)g(in)g(the)g(library)f(that)h(implemen)o(ts)d(Lua.)
164029 820 y(Global)g(v)m(ariables)h(do)h(not)f(need)h(declaration.)k(An)o
1641(y)c(v)m(ariable)f(is)g(assumed)g(to)g(b)q(e)h(global)e(unless)i
1642(explicitly)-42 876 y(declared)20 b(lo)q(cal)e(\(see)h(lo)q(cal)f
1643(declarations,)h(Section)g(4.4.5\).)30 b(Before)19 b(the)g(\014rst)g
1644(assignmen)o(t,)e(the)j(v)m(alue)f(of)g(a)-42 933 y(global)14
1645b(v)m(ariable)h(is)g Fl(nil)p Fo(.)29 989 y(The)g(unit)g(of)g
1646(execution)h(of)e(Lua)i(is)f(called)f(a)h Fn(chunk)p
1647Fo(.)20 b(The)15 b(syn)o(tax)g(for)f(c)o(h)o(unks)i(is:)1480
1648973 y Fk(1)42 1062 y Fn(chunk)50 b Fj(!)g(f)p Fn(statement)32
1649b Fj(j)16 b Fn(function)s Fj(g)-42 1134 y Fo(A)f(c)o(h)o(unk)f(ma)o(y)e
1650(con)o(tain)h(statemen)o(ts)f(and)i(function)g(de\014nitions,)g(and)g
1651(ma)o(y)e(b)q(e)j(in)f(a)g(\014le)g(or)f(in)h(a)g(string)f(inside)-42
16521190 y(the)k(host)f(program.)22 b(When)17 b(a)g(c)o(h)o(unk)g(is)f
1653(executed,)h(\014rst)g(all)e(its)h(functions)g(and)h(statemen)o(ts)e
1654(are)h(compiled,)-42 1247 y(then)d(the)e(statemen)o(ts)f(are)i
1655(executed)g(in)g(sequen)o(tial)f(order.)18 b(All)11 b(mo)q
1656(di\014cations)f(a)i(c)o(h)o(unk)g(e\013ects)f(on)h(the)g(global)-42
16571303 y(en)o(vironmen)o(t)k(p)q(ersist)h(after)f(its)g(end.)27
1658b(Those)17 b(include)g(mo)q(di\014cations)f(to)g(global)g(v)m(ariables)
1659g(and)i(de\014nitions)-42 1359 y(of)d(new)h(functions)285
16601343 y Fk(2)304 1359 y Fo(.)29 1416 y(Ch)o(unks)j(ma)o(y)e(b)q(e)i
1661(pre-compiled;)g(see)g(program)d Fm(luac)i Fo(for)g(details.)30
1662b(Ascii)18 b(\014les)g(with)g(c)o(h)o(unk)h(co)q(de)g(and)-42
16631472 y(their)e(binary)g(pre-compiled)f(forms)f(are)i(in)o(terc)o
1664(hangeable.)25 b(Lua)17 b(automatically)d(detects)j(the)g(\014le)g(t)o
1665(yp)q(e)g(and)-42 1529 y(acts)e(accordingly)l(.)-42 1672
1666y Fp(3)67 b(T)n(yp)r(es)-42 1773 y Fo(Lua)14 b(is)g(a)f(dynamically)f
1667(t)o(yp)q(ed)i(language.)k(V)l(ariables)13 b(do)h(not)f(ha)o(v)o(e)g(t)
1668o(yp)q(es;)h(only)f(v)m(alues)h(do.)19 b(All)13 b(v)m(alues)h(carry)-42
16691830 y(their)h(o)o(wn)g(t)o(yp)q(e.)20 b(Therefore,)15
1670b(there)g(are)g(no)g(t)o(yp)q(e)g(de\014nitions)g(in)g(the)g(language.)
167129 1886 y(There)20 b(are)f(sev)o(en)h(basic)f(t)o(yp)q(es)h(in)g(Lua:)
167229 b Fn(nil)p Fo(,)19 b Fn(numb)n(er)p Fo(,)h Fn(string)p
1673Fo(,)g Fn(function)p Fo(,)g Fn(CF)m(unction)p Fo(,)e
1674Fn(user)n(data)p Fo(,)j(and)-42 1943 y Fn(table)p Fo(.)f
1675Fn(Nil)14 b Fo(is)g(the)g(t)o(yp)q(e)h(of)f(the)h(v)m(alue)g
1676Fl(nil)p Fo(,)e(whose)h(main)f(prop)q(ert)o(y)h(is)h(to)e(b)q(e)j
1677(di\013eren)o(t)d(from)g(an)o(y)h(other)h(v)m(alue.)-42
16781999 y Fn(Numb)n(er)h Fo(represen)o(ts)f(real)f(\(\015oating)g(p)q(oin)
1679o(t\))g(n)o(um)o(b)q(ers,)h(while)f Fn(string)h Fo(has)g(the)g(usual)g
1680(meaning.)29 2056 y(F)l(unctions)20 b(are)f(considered)i(\014rst-class)
1681e(v)m(alues)h(in)g(Lua.)34 b(This)19 b(means)g(that)h(functions)f(can)h
1682(b)q(e)h(stored)-42 2112 y(in)c(v)m(ariables,)g(passed)g(as)g(argumen)o
1683(ts)f(to)g(other)h(functions)g(and)g(returned)h(as)e(results.)26
1684b(When)17 b(a)g(function)g(is)-42 2169 y(de\014ned)g(in)d(Lua,)h(its)f
1685(b)q(o)q(dy)i(is)e(compiled)f(and)i(stored)g(in)f(a)h(giv)o(en)f(v)m
1686(ariable.)19 b(Lua)c(can)g(call)f(\(and)h(manipulate\))-42
16872225 y(functions)g(written)g(in)g(Lua)g(and)h(functions)f(written)f(in)
1688h(C;)f(the)i(latter)e(ha)o(v)o(e)g(t)o(yp)q(e)i Fn(CF)m(unction)s
1689Fo(.)29 2282 y(The)i(t)o(yp)q(e)f Fn(user)n(data)h Fo(is)g(pro)o(vided)
1690f(to)g(allo)o(w)f(arbitrary)f(C)j(p)q(oin)o(ters)f(to)g(b)q(e)h(stored)
1691f(in)g(Lua)h(v)m(ariables.)26 b(It)-42 2338 y(corresp)q(onds)18
1692b(to)f Fm(void*)f Fo(and)i(has)f(no)g(pre-de\014ned)j(op)q(erations)c
1693(in)h(Lua,)h(b)q(esides)g(assignmen)o(t)d(and)j(equalit)o(y)-42
16942394 y(test.)24 b(Ho)o(w)o(ev)o(er,)16 b(b)o(y)g(using)h(fallbac)o(ks,)
1695e(the)i(programmer)c(ma)o(y)i(de\014ne)j(op)q(erations)e(for)g
1696Fn(user)n(data)h Fo(v)m(alues;)g(see)-42 2451 y(Section)f(4.7.)p
1697-42 2482 780 2 v 10 2509 a Fi(1)28 2524 y Fh(As)c(usual,)i
1698Fg(f)p Ff(a)s Fg(g)f Fh(means)h(0)f(or)g(more)g Ff(a)s
1699Fh('s,)f([)p Ff(a)s Fh(])f(means)j(an)f(optional)j Ff(a)c
1700Fh(and)i Fg(f)p Ff(a)s Fg(g)1179 2509 y Fi(+)1217 2524
1701y Fh(means)f(one)h(or)f(more)g Ff(a)s Fh('s.)10 2554
1702y Fi(2)28 2570 y Fh(Actually)m(,)h(a)f(function)h(de\014nition)i(is)d
1703(an)h(assignmen)o(t)h(to)d(a)h(global)j(v)n(ariable;)e(see)f(Section)i
1704(3.)922 2748 y Fo(2)p eop
1705%%Page: 3 3
17063 2 bop 29 199 a Fo(The)12 b(t)o(yp)q(e)g Fn(table)g
1707Fo(implemen)o(ts)d(asso)q(ciativ)o(e)i(arra)o(ys,)g(that)g(is,)h(arra)o
1708(ys)e(whic)o(h)i(can)g(b)q(e)h(indexed)g(not)f(only)f(with)-42
1709256 y(n)o(um)o(b)q(ers,)k(but)g(with)g(an)o(y)g(v)m(alue)h(\(except)f
1710Fl(nil)p Fo(\).)20 b(Therefore,)15 b(this)f(t)o(yp)q(e)i(ma)o(y)e(b)q
1711(e)i(used)g(not)f(only)g(to)f(represen)o(t)-42 312 y(ordinary)h(arra)o
1712(ys,)e(but)i(also)f(sym)o(b)q(ol)g(tables,)g(sets,)g(records,)h(etc.)20
1713b(T)l(o)15 b(represen)o(t)g(records,)f(Lua)i(uses)f(the)g(\014eld)-42
1714369 y(name)k(as)f(an)h(index.)32 b(The)19 b(language)g(supp)q(orts)g
1715(this)f(represen)o(tation)g(b)o(y)i(pro)o(viding)e Fm(a.name)g
1716Fo(as)g(syn)o(tactic)-42 425 y(sugar)i(for)f Fm(a["name"])p
1717Fo(.)33 b(T)l(ables)20 b(ma)o(y)e(also)h(carry)g(metho)q(ds.)34
1718b(Because)20 b(functions)g(are)g(\014rst)f(class)h(v)m(alues,)-42
1719482 y(table)d(\014elds)g(ma)o(y)e(con)o(tain)g(functions.)25
1720b(The)16 b(form)f Fm(t:f\(x\))h Fo(is)g(syn)o(tactic)g(sugar)g(for)g
1721Fm(t.f\(t,x\))p Fo(,)g(whic)o(h)g(calls)-42 538 y(the)g(metho)q(d)e
1722Fm(f)h Fo(from)f(the)h(table)g Fm(t)g Fo(passing)f(itself)g(as)h(the)g
1723(\014rst)g(parameter.)29 594 y(It)d(is)f(imp)q(ortan)o(t)e(to)i(notice)
1724g(that)g(tables)g(are)g(ob)s(jects,)g(and)h(not)f(v)m(alues.)19
1725b(V)l(ariables)10 b(cannot)i(con)o(tain)e(tables,)-42
1726651 y(only)15 b(references)g(to)f(them.)19 b(Assignmen)o(t,)12
1727b(parameter)h(passing)i(and)f(returns)h(alw)o(a)o(ys)e(manipulate)g
1728(references)-42 707 y(to)k(tables,)f(and)i(do)f(not)f(imply)g(an)o(y)h
1729(kind)g(of)f(cop)o(y)l(.)26 b(Moreo)o(v)o(er,)16 b(tables)g(m)o(ust)f
1730(b)q(e)j(explicitly)e(created)h(b)q(efore)-42 764 y(used;)f(see)f
1731(Section)g(4.5.7.)-42 907 y Fp(4)67 b(The)23 b(Language)-42
17321008 y Fo(This)15 b(section)g(describ)q(es)h(the)f(lexis,)f(syn)o(tax)h
1733(and)g(seman)o(tics)e(of)i(Lua.)-42 1130 y Fe(4.1)56
1734b(Lexical)19 b(Con)n(v)n(en)n(tions)-42 1216 y Fo(Lua)g(is)e(a)g(case)h
1735(sensitiv)o(e)f(language.)27 b(Iden)o(ti\014ers)18 b(can)g(b)q(e)g(an)o
1736(y)f(string)g(of)g(letters,)h(digits,)e(and)i(underscores,)-42
17371272 y(not)d(b)q(eginning)h(with)e(a)h(digit.)k(The)c(follo)o(wing)e(w)
1738o(ords)i(are)f(reserv)o(ed,)h(and)h(cannot)f(b)q(e)h(used)f(as)g(iden)o
1739(ti\014ers:)173 1366 y Fm(and)143 b(do)191 b(else)142
1740b(elseif)95 b(end)173 1422 y(function)23 b(if)191 b(local)118
1741b(nil)167 b(not)173 1478 y(or)g(repeat)95 b(return)f(until)119
1742b(then)95 b(while)29 1572 y Fo(The)15 b(follo)o(wing)e(strings)i
1743(denote)g(other)g(tok)o(ens:)173 1665 y Fm(~=)48 b(<=)f(>=)h(<)71
1744b(>)h(==)47 b(=)71 b(..)48 b(+)71 b(-)h(*)f(/)173 1721
1745y(\045)h(\()f(\))h({)f(})h([)f(])g(;)h(,)f(.)29 1815
1746y Fo(Literal)17 b(strings)f(can)i(b)q(e)g(delimited)e(b)o(y)i(matc)o
1747(hing)d(single)i(or)g(double)h(quotes,)g(and)f(can)h(con)o(tain)f(the)h
1748(C-)-42 1871 y(lik)o(e)i(escap)q(e)i(sequences)g Fm('\\n')p
1749Fo(,)f Fm('\\t')f Fo(and)h Fm('\\r')p Fo(.)36 b(Literal)20
1750b(strings)g(can)g(also)g(b)q(e)i(delimited)d(b)o(y)h(matc)o(hing)-42
17511928 y Fm([[)k(...)g(]])p Fo(.)18 b(Literals)12 b(in)h(this)f(last)g
1752(form)f(ma)o(y)h(run)h(for)f(sev)o(eral)g(lines,)h(ma)o(y)e(con)o(tain)
1753h(nested)i Fm([[)23 b(...)h(]])p Fo(,)12 b(and)-42 1984
1754y(do)k(not)e(in)o(terpret)h(escap)q(e)h(sequences.)29
17552041 y(Commen)o(ts)c(start)h(an)o(ywhere)i(outside)g(a)f(string)g(with)
1756g(a)g(double)h(h)o(yphen)h(\()p Fm(--)p Fo(\))e(and)h(run)g(un)o(til)f
1757(the)g(end)i(of)-42 2097 y(the)g(line.)29 2153 y(Numerical)h(constan)o
1758(ts)g(ma)o(y)f(b)q(e)j(written)e(with)h(an)g(optional)e(decimal)h
1759(part,)h(and)g(an)g(optional)f(decimal)-42 2210 y(exp)q(onen)o(t.)k
1760(Examples)14 b(of)g(v)m(alid)h(n)o(umerical)f(constan)o(ts)g(are:)126
17612303 y Fm(4)119 b(4.0)g(0.4)g(4.57e-3)f(0.3e12)-42 2425
1762y Fe(4.2)56 b(Co)r(ercion)-42 2511 y Fo(Lua)19 b(pro)o(vides)f(some)f
1763(automatic)f(con)o(v)o(ersions.)29 b(An)o(y)19 b(arithmetic)d(op)q
1764(eration)i(applied)g(to)g(a)g(string)f(tries)h(to)-42
17652567 y(con)o(v)o(ert)d(that)f(string)g(to)h(a)f(n)o(um)o(b)q(er,)g
1766(follo)o(wing)f(the)i(usual)g(rules.)20 b(Con)o(v)o(ersely)l(,)14
1767b(whenev)o(er)h(a)g(n)o(um)o(b)q(er)f(is)h(used)-42 2623
1768y(when)h(a)f(string)f(is)h(exp)q(ected,)h(that)e(n)o(um)o(b)q(er)h(is)g
1769(con)o(v)o(erted)g(to)f(a)h(string,)f(according)h(to)f(the)h(follo)o
1770(wing)e(rule:)20 b(if)922 2748 y(3)p eop
1771%%Page: 4 4
17724 3 bop -42 199 a Fo(the)13 b(n)o(um)o(b)q(er)g(is)f(an)h(in)o(teger,)f
1773(it)g(is)g(written)g(without)g(exp)q(onen)o(t)h(or)f(decimal)f(p)q(oin)
1774o(t;)i(otherwise,)f(it)g(is)h(formatted)-42 256 y(follo)o(wing)g(the)j
1775(\\)p Fm(\045g)p Fo(")e(con)o(v)o(ersion)g(sp)q(eci\014cation)h(of)g
1776(the)h(standard)e Fm(printf)h Fo(C)g(function.)-42 377
1777y Fe(4.3)56 b(Adjustmen)n(t)-42 463 y Fo(F)l(unctions)14
1778b(in)g(Lua)h(can)f(return)g(man)o(y)f(v)m(alues.)19 b(Because)c(there)f
1779(are)g(no)g(t)o(yp)q(e)h(declarations,)d(the)i(system)f(do)q(es)-42
1780520 y(not)18 b(kno)o(w)f(ho)o(w)g(man)o(y)f(v)m(alues)i(a)g(function)f
1781(will)g(return,)g(or)h(ho)o(w)f(man)o(y)f(parameters)g(it)h(needs.)28
1782b(Therefore,)-42 576 y(sometimes,)10 b(a)i(list)g(of)g(v)m(alues)h(m)o
1783(ust)e(b)q(e)i Fn(adjuste)n(d)5 b Fo(,)13 b(at)f(run)g(time,)f(to)h(a)h
1784(giv)o(en)f(length.)18 b(If)13 b(there)g(are)f(more)f(v)m(alues)-42
1785633 y(than)17 b(are)f(needed,)i(the)f(last)f(v)m(alues)h(are)f(thro)o
1786(wn)g(a)o(w)o(a)o(y)l(.)23 b(If)17 b(there)g(are)f(more)g(needs)h(than)
1787g(v)m(alues,)g(the)f(list)g(is)-42 689 y(extended)j(with)e(as)h(man)o
1788(y)e Fl(nil)p Fo('s)h(as)g(needed.)29 b(Adjustmen)o(t)17
1789b(o)q(ccurs)h(in)f(m)o(ultiple)f(assignmen)o(t)g(and)i(function)-42
1790746 y(calls.)-42 867 y Fe(4.4)56 b(Statemen)n(ts)-42
1791953 y Fo(Lua)19 b(supp)q(orts)f(an)f(almost)f(con)o(v)o(en)o(tional)g
1792(set)i(of)f(statemen)o(ts.)26 b(The)18 b(con)o(v)o(en)o(tional)e
1793(commands)f(include)k(as-)-42 1009 y(signmen)o(t,)d(con)o(trol)f
1794(structures)i(and)g(pro)q(cedure)h(calls.)24 b(Non-con)o(v)o(en)o
1795(tional)16 b(commands)e(include)k(table)e(con-)-42 1066
1796y(structors,)e(explained)i(in)f(Section)g(4.5.7,)e(and)i(lo)q(cal)g(v)m
1797(ariable)f(declarations.)-42 1186 y Fl(4.4.1)52 b(Blo)q(c)o(ks)-42
17981272 y Fo(A)15 b(blo)q(c)o(k)f(is)f(a)h(list)f(of)h(statemen)o(ts,)e
1799(executed)j(sequen)o(tially)l(.)k(An)o(y)14 b(statemen)o(t)e(can)j(b)q
1800(e)g(optionally)d(follo)o(w)o(ed)h(b)o(y)-42 1328 y(a)i(semicolon.)42
18011388 y Fn(blo)n(ck)49 b Fj(!)h(f)p Fn(stat)16 b(sc)s
1802Fj(g)g Fo([)p Fn(r)n(et)f(sc)s Fo(])98 1444 y Fn(sc)49
1803b Fj(!)h Fo([';'])-42 1512 y(F)l(or)13 b(syn)o(tactic)f(reasons,)g(a)h
1804(return)g(statemen)o(t)e(can)i(only)g(b)q(e)g(written)f(as)h(the)g
1805(last)f(statemen)o(t)f(of)h(a)h(blo)q(c)o(k.)19 b(This)-42
18061569 y(restriction)14 b(also)g(a)o(v)o(oids)g(some)g(\\statemen)o(t)f
1807(not)i(reac)o(hed")g(errors.)-42 1689 y Fl(4.4.2)52 b(Assignmen)o(t)-42
18081775 y Fo(The)18 b(language)e(allo)o(ws)f(m)o(ultiple)g(assignmen)o(t.)
180923 b(Therefore,)17 b(the)g(syn)o(tax)g(de\014nes)h(a)f(list)e(of)i(v)m
1810(ariables)f(on)h(the)-42 1831 y(left)h(side,)g(and)h(a)e(list)g(of)h
1811(expressions)g(on)g(the)g(righ)o(t)f(side.)29 b(Both)18
1812b(lists)f(ha)o(v)o(e)g(their)h(elemen)o(ts)f(separated)h(b)o(y)-42
18131888 y(commas.)116 1947 y Fn(stat)50 b Fj(!)g Fn(varlist1)16
1814b Fo('=')g Fn(explist1)42 2003 y(varlist1)50 b Fj(!)g
1815Fn(var)17 b Fj(f)p Fo(',')d Fn(var)5 b Fj(g)-42 2072
1816y Fo(This)15 b(statemen)o(t)d(\014rst)i(ev)m(aluates)g(all)g(v)m(alues)
1817g(on)h(the)f(righ)o(t)g(side)g(and)h(ev)o(en)o(tual)f(indices)g(on)h
1818(the)f(left)g(side,)g(and)-42 2128 y(then)i(mak)o(es)e(the)h(assignmen)
1819o(ts.)j(Therefore,)c(it)h(can)g(b)q(e)h(used)g(to)e(exc)o(hange)i(t)o
1820(w)o(o)e(v)m(alues,)h(as)f(in)30 2222 y Fm(x,)24 b(y)f(=)h(y,)g(x)-42
18212316 y Fo(Before)f(the)g(assignmen)o(t,)f(the)g(list)f(of)i(v)m(alues)f
1822(is)g Fn(adjuste)n(d)h Fo(to)f(the)h(length)f(of)g(the)h(list)e(of)h(v)
1823m(ariables;)j(see)-42 2372 y(Section)16 b(4.3.)42 2444
1824y Fn(var)50 b Fj(!)g Fn(name)-42 2516 y Fo(A)16 b(single)e(name)g(can)i
1825(denote)f(a)g(global)f(or)h(a)g(lo)q(cal)f(v)m(ariable,)g(or)h(a)g
1826(formal)d(parameter.)42 2589 y Fn(var)50 b Fj(!)g Fn(var)17
1827b Fo('[')e Fn(exp1)i Fo(']')922 2748 y(4)p eop
1828%%Page: 5 5
18295 4 bop -42 199 a Fo(Square)20 b(brac)o(k)o(ets)f(are)h(used)g(to)f
1830(index)h(a)f(table.)33 b(If)20 b Fm(var)f Fo(results)g(in)g(a)h(table)f
1831(v)m(alue,)h(the)g(\014eld)g(indexed)h(b)o(y)-42 256
1832y(the)c(expression)f(v)m(alue)h(gets)f(the)h(assigned)f(v)m(alue.)24
1833b(Otherwise,)16 b(the)h(fallbac)o(k)e Fn(settable)h Fo(is)g(called,)g
1834(with)f(three)-42 312 y(parameters:)31 b(the)22 b(v)m(alue)f(of)g
1835Fm(var)p Fo(,)h(the)g(v)m(alue)g(of)f(expression,)h(and)g(the)f(v)m
1836(alue)h(b)q(eing)g(assigned)f(to)g(it;)i(see)-42 369
1837y(Section)16 b(4.7.)42 441 y Fn(var)50 b Fj(!)g Fn(var)17
1838b Fo('.')j Fn(name)-42 513 y Fo(The)c(syn)o(tax)e Fm(var.NAME)g
1839Fo(is)h(just)g(syn)o(tactic)f(sugar)h(for)f Fm(var["NAME"])p
1840Fo(.)-42 633 y Fl(4.4.3)52 b(Con)o(trol)17 b(Structures)-42
1841719 y Fo(The)k(condition)e(expression)h(of)f(a)h(con)o(trol)e
1842(structure)i(can)g(return)g(an)o(y)g(v)m(alue.)34 b(All)19
1843b(v)m(alues)h(di\013eren)o(t)f(from)-42 775 y Fl(nil)f
1844Fo(are)g(considered)g(true,)h(while)f Fl(nil)f Fo(is)h(considered)h
1845(false.)28 b Fm(if)p Fo('s,)18 b Fm(while)p Fo('s)f(and)h
1846Fm(repeat)p Fo('s)f(ha)o(v)o(e)h(the)h(usual)-42 832
1847y(meaning.)70 900 y Fn(stat)50 b Fj(!)g Fl(while)15 b
1848Fn(exp1)i Fl(do)f Fn(blo)n(ck)g Fl(end)245 956 y Fj(j)32
1849b Fl(rep)q(eat)17 b Fn(blo)n(ck)f Fl(un)o(til)f Fn(exp1)245
18501013 y Fj(j)32 b Fl(if)16 b Fn(exp1)h Fl(then)g Fn(blo)n(ck)e
1851Fj(f)p Fn(elseif)8 b Fj(g)16 b Fo([)p Fl(else)f Fn(blo)n(ck)5
1852b Fo(])15 b Fl(end)42 1069 y Fn(elseif)49 b Fj(!)h Fl(elseif)15
1853b Fn(exp1)i Fl(then)f Fn(blo)n(ck)29 1162 y Fo(A)g Fm(return)g
1854Fo(is)g(used)g(to)g(return)g(v)m(alues)h(from)d(a)i(function.)23
1855b(Because)17 b(a)f(function)g(ma)o(y)f(return)h(more)f(than)-42
18561219 y(one)h(v)m(alue,)f(the)g(syn)o(tax)g(for)f(a)h(return)g(statemen)
1857o(t)e(is:)42 1291 y Fn(r)n(et)50 b Fj(!)g Fl(return)16
1858b Fn(explist)-42 1483 y Fl(4.4.4)52 b(F)l(unction)18
1859b(Calls)e(as)h(Statemen)o(ts)-42 1569 y Fo(Because)f(of)f(p)q(ossible)g
1860(side-e\013ects,)g(function)g(calls)f(can)h(b)q(e)h(executed)g(as)f
1861(statemen)o(ts.)42 1641 y Fn(stat)50 b Fj(!)g Fn(functionc)n(al)r(l)-42
18621713 y Fo(Ev)o(en)o(tual)15 b(returned)g(v)m(alues)h(are)f(thro)o(wn)f
1863(a)o(w)o(a)o(y)l(.)19 b(F)l(unction)c(calls)f(are)h(explained)g(in)g
1864(Section)g(4.5.8.)-42 1833 y Fl(4.4.5)52 b(Lo)q(cal)19
1865b(Declarations)-42 1919 y Fo(Lo)q(cal)e(v)m(ariables)e(can)h(b)q(e)h
1866(declared)f(an)o(ywhere)g(inside)g(a)g(blo)q(c)o(k.)22
1867b(Their)16 b(scop)q(e)h(b)q(egins)f(after)f(the)i(declaration)-42
18681975 y(and)f(lasts)e(un)o(til)g(the)i(end)f(of)g(the)g(blo)q(c)o(k.)20
1869b(The)15 b(declaration)f(ma)o(y)g(include)i(an)f(initial)e(assignmen)o
1870(t:)92 2044 y Fn(stat)50 b Fj(!)g Fl(lo)q(cal)17 b Fn(de)n(clist)e
1871Fo([)p Fn(init)t Fo(])42 2100 y Fn(de)n(clist)49 b Fj(!)h
1872Fn(name)16 b Fj(f)p Fo(',')f Fn(name)s Fj(g)96 2157 y
1873Fn(init)49 b Fj(!)h Fo('=')16 b Fn(explist1)-42 2225
1874y Fo(If)f(there)f(is)f(an)h(initial)e(assignmen)o(t,)g(it)h(has)h(the)g
1875(same)f(seman)o(tics)f(of)h(a)h(m)o(ultiple)e(assignmen)o(t.)17
1876b(Otherwise,)d(all)-42 2281 y(v)m(ariables)h(are)g(initialized)e(with)i
1877Fl(nil)p Fo(.)-42 2403 y Fe(4.5)56 b(Expressions)-42
18782489 y Fl(4.5.1)c(Simple)15 b(Expressions)-42 2575 y
1879Fo(Simple)f(expressions)h(are:)922 2748 y(5)p eop
1880%%Page: 6 6
18816 5 bop 42 193 a Fn(exp)50 b Fj(!)g Fo('\(')16 b Fn(exp)g
1882Fo('\)')42 250 y Fn(exp)50 b Fj(!)g Fl(nil)42 306 y Fn(exp)g
1883Fj(!)g Fo('n)o(um)o(b)q(er')42 362 y Fn(exp)g Fj(!)g
1884Fo('literal')42 419 y Fn(exp)g Fj(!)g Fn(var)-42 490
1885y Fo(Num)o(b)q(ers)22 b(\(n)o(umerical)f(constan)o(ts\))g(and)i(string)
1886f(literals)f(are)h(explained)h(in)f(Section)h(4.1.)41
1887b(V)l(ariables)22 b(are)-42 546 y(explained)16 b(in)f(Section)g(4.4.2.)
1888-42 665 y Fl(4.5.2)52 b(Arithmetic)15 b(Op)q(erators)-42
1889751 y Fo(Lua)21 b(supp)q(orts)g(the)g(usual)f(arithmetic)e(op)q
1890(erators.)35 b(These)21 b(op)q(erators)f(are)g(the)g(binary)h
1891Fm(+)p Fo(,)g Fm(-)p Fo(,)g Fm(*)p Fo(,)h Fm(/)e Fo(and)h
1892Fm(^)-42 808 y Fo(\(exp)q(onen)o(tiation\),)15 b(and)h(the)g(unary)g
1893Fm(-)p Fo(.)22 b(If)16 b(the)g(op)q(erands)g(are)g(n)o(um)o(b)q(ers,)f
1894(or)g(strings)g(that)g(can)h(b)q(e)h(con)o(v)o(erted)-42
1895864 y(to)d(n)o(um)o(b)q(ers,)g(according)g(to)g(the)g(rules)g(giv)o(en)
1896g(in)h(Section)f(4.2,)f(all)h(op)q(erations)f(but)i(exp)q(onen)o
1897(tiation)e(ha)o(v)o(e)h(the)-42 920 y(usual)f(meaning.)18
1898b(Otherwise,)13 b(the)g(fallbac)o(k)f(\\arith")g(is)g(called;)h(see)g
1899(Section)g(4.7.)19 b(An)13 b(exp)q(onen)o(tiation)f(alw)o(a)o(ys)-42
1900977 y(calls)k(this)f(fallbac)o(k.)22 b(The)16 b(standard)g
1901(mathematical)c(library)j(rede\014nes)j(this)d(fallbac)o(k,)g(giving)g
1902(the)h(exp)q(ected)-42 1033 y(meaning)e(to)h(exp)q(onen)o(tiation;)f
1903(see)h(Section)g(6.3.)-42 1152 y Fl(4.5.3)52 b(Relational)18
1904b(Op)q(erators)-42 1238 y Fo(Lua)e(o\013ers)e(the)i(follo)o(wing)d
1905(relational)g(op)q(erators:)126 1327 y Fm(<)71 b(>)g(<=)48
1906b(>=)f(~=)h(==)-42 1415 y Fo(All)15 b(return)g Fl(nil)f
1907Fo(as)h(false)g(and)g(a)g(v)m(alue)g(di\013eren)o(t)g(from)e
1908Fl(nil)h Fo(\(actually)g(the)h(n)o(um)o(b)q(er)g(1\))g(as)f(true.)29
19091472 y(Equalit)o(y)h(\014rst)h(compares)f(the)i(t)o(yp)q(es)f(of)h(its)
1910e(op)q(erands.)24 b(If)17 b(they)g(are)f(di\013eren)o(t,)g(the)g
1911(result)g(is)g Fl(nil)p Fo(.)23 b(Oth-)-42 1528 y(erwise,)18
1912b(their)f(v)m(alues)h(are)g(compared.)26 b(Num)o(b)q(ers)17
1913b(and)h(strings)f(are)h(compared)e(in)i(the)g(usual)f(w)o(a)o(y)l(.)27
1914b(T)l(ables,)-42 1585 y(CF)l(unctions,)14 b(and)g(functions)g(are)g
1915(compared)f(b)o(y)h(reference,)h(that)e(is,)h(t)o(w)o(o)e(tables)i(are)
1916g(considered)g(equal)g(only)-42 1641 y(if)h(they)g(are)g(the)h(same)d
1917(table.)20 b(The)15 b(op)q(erator)g Fm(~=)f Fo(is)h(exactly)g(the)g
1918(negation)f(of)h(equalit)o(y)f(\()p Fm(==)p Fo(\).)29
19191698 y(The)19 b(other)g(op)q(erators)f(w)o(ork)g(as)g(follo)o(ws.)29
1920b(If)19 b(b)q(oth)g(argumen)o(ts)e(are)i(n)o(um)o(b)q(ers,)f(they)h
1921(are)g(compared)f(as)-42 1754 y(suc)o(h.)27 b(Otherwise,)17
1922b(if)g(b)q(oth)g(argumen)o(ts)f(can)h(b)q(e)h(con)o(v)o(erted)f(to)g
1923(strings,)f(their)h(v)m(alues)g(are)g(compared)g(using)-42
19241811 y(lexicographical)d(order.)20 b(Otherwise,)14 b(the)i(fallbac)o(k)
1925d(\\order")i(is)g(called;)f(see)h(Section)h(4.7.)-42
19261930 y Fl(4.5.4)52 b(Logical)18 b(Op)q(erators)-42 2016
1927y Fo(All)f(logical)f(op)q(erators,)g(lik)o(e)h(con)o(trol)f
1928(structures,)h(consider)g Fl(nil)g Fo(as)g(false)g(and)g(an)o(ything)g
1929(else)g(as)g(true.)26 b(The)-42 2072 y(logical)14 b(op)q(erators)g
1930(are:)269 2161 y Fm(and)71 b(or)g(not)-42 2249 y Fo(The)17
1931b(op)q(erators)f Fm(and)g Fo(and)h Fm(or)f Fo(use)h(short-cut)f(ev)m
1932(aluation,)g(that)g(is,)g(the)h(second)g(op)q(erand)g(is)f(ev)m
1933(aluated)h(only)-42 2306 y(if)e(necessary)l(.)-42 2425
1934y Fl(4.5.5)52 b(Concatenation)-42 2511 y Fo(Lua)18 b(o\013ers)d(a)i
1935(string)f(concatenation)g(op)q(erator,)f(denoted)j(b)o(y)e(\\)p
1936Fm(..)p Fo(".)24 b(If)17 b(op)q(erands)g(are)g(strings)e(or)i(n)o(um)o
1937(b)q(ers,)-42 2567 y(they)c(are)g(con)o(v)o(erted)f(to)g(strings)g
1938(according)g(to)g(the)h(rules)f(in)h(Section)f(4.2.)18
1939b(Otherwise,)13 b(the)g(fallbac)o(k)e(\\concat")-42 2623
1940y(is)k(called;)g(see)g(Section)g(4.7.)922 2748 y(6)p
1941eop
1942%%Page: 7 7
19437 6 bop -42 199 a Fl(4.5.6)52 b(Precedence)-42 285 y
1944Fo(Op)q(erator)15 b(precedence)i(follo)o(ws)d(the)h(table)g(b)q(elo)o
1945(w,)f(from)f(the)j(lo)o(w)o(er)d(to)i(the)g(higher)g(priorit)o(y:)269
1946379 y Fm(and)71 b(or)269 435 y(<)g(>)h(<=)47 b(>=)h(~=)f(==)269
1947492 y(..)269 548 y(+)71 b(-)269 605 y(*)g(/)269 661 y(not)47
1948b(-)24 b(\(unary\))269 718 y(^)-42 811 y Fo(All)15 b(binary)g(op)q
1949(erators)f(are)h(left)f(asso)q(ciativ)o(e,)g(except)h(for)g
1950Fm(^)p Fo(,)g(whic)o(h)g(is)f(righ)o(t)g(asso)q(ciativ)o(e.)-42
1951931 y Fl(4.5.7)52 b(T)l(able)18 b(Constructors)-42 1017
1952y Fo(T)l(able)d(constructors)f(are)h(expressions)g(that)f(create)h
1953(tables;)f(ev)o(ery)h(time)e(a)i(constructor)f(is)h(ev)m(aluated,)g(a)f
1954(new)-42 1074 y(table)f(is)g(created.)19 b(Constructors)12
1955b(can)h(b)q(e)h(used)g(to)e(create)h(empt)o(y)f(tables,)g(or)h(to)g
1956(create)g(a)f(table)h(and)g(initialize)-42 1130 y(some)h(\014elds.)29
19571187 y(The)h(general)g(syn)o(tax)g(for)f(constructors)h(is:)42
19581255 y Fn(table)n(c)n(onstructor)49 b Fj(!)i Fo(')p Fj(f)p
1959Fo(')15 b Fn(\014eld)r(list)g Fo(')p Fj(g)p Fo(')212
19601311 y Fn(\014eld)r(list)48 b Fj(!)j Fn(l\014eld)r(list)31
1961b Fj(j)16 b Fn(\016eld)r(list)31 b Fj(j)16 b Fn(l\014eld)r(list)f
1962Fo(';')g Fn(\016eld)r(list)200 1368 y(l\014eld)r(list)48
1963b Fj(!)j Fo([)p Fn(l\014eld)r(list1)6 b Fo(])197 1424
1964y Fn(\016eld)r(list)49 b Fj(!)i Fo([)p Fn(\016eld)r(list1)6
1965b Fo(])29 1517 y(The)15 b(form)f Fn(l\014eld)r(list1)g
1966Fo(is)h(used)g(to)g(initialize)e(lists.)42 1589 y Fn(l\014eld)r(list1)
196749 b Fj(!)h Fn(exp)16 b Fj(f)p Fo(',')f Fn(exp)s Fj(g)h
1968Fo([','])-42 1662 y(The)i(expressions)f(in)g(the)g(list)f(are)h
1969(assigned)g(to)g(consecutiv)o(e)g(n)o(umerical)f(indexes,)h(starting)f
1970(with)h(1.)25 b(As)18 b(an)-42 1718 y(example:)30 1812
1971y Fm(a)24 b(=)g({"v1",)f("v2",)g(34})-42 1906 y Fo(is)15
1972b(equiv)m(alen)o(t)g(to:)30 2000 y Fm(temp)23 b(=)h({})30
19732056 y(temp[1])f(=)h("v1")30 2112 y(temp[2])f(=)h("v2")30
19742169 y(temp[3])f(=)h(34)30 2225 y(a)g(=)g(temp)29 2319
1975y Fo(The)15 b(next)h(form)d(initializes)g(named)i(\014elds)g(in)g(a)g
1976(table.)42 2378 y Fn(\016eld)r(list1)50 b Fj(!)g Fn(\016eld)16
1977b Fj(f)p Fo(',')f Fn(\016eld)5 b Fj(g)15 b Fo([','])127
19782435 y Fn(\016eld)50 b Fj(!)g Fn(name)16 b Fo('=')g Fn(exp)-42
19792503 y Fo(As)g(an)f(example:)30 2597 y Fm(a)24 b(=)g({x)f(=)h(1,)f(y)h
1980(=)g(3})922 2748 y Fo(7)p eop
1981%%Page: 8 8
19828 7 bop -42 199 a Fo(is)15 b(equiv)m(alen)o(t)g(to:)30
1983293 y Fm(temp)23 b(=)h({})30 350 y(temp.x)f(=)h(1)30
1984406 y(temp.y)f(=)h(3)30 462 y(a)g(=)g(temp)-42 582 y
1985Fl(4.5.8)52 b(F)l(unction)18 b(Calls)-42 668 y Fo(A)e(function)f(call)f
1986(has)h(the)g(follo)o(wing)e(syn)o(tax:)42 740 y Fn(functionc)n(al)r(l)
198749 b Fj(!)h Fn(var)17 b(r)n(e)n(alPar)n(ams)-42 813 y
1988Fo(Here,)i Fm(var)e Fo(can)h(b)q(e)h(an)o(y)e(v)m(ariable)h(\(global,)e
1989(lo)q(cal,)i(indexed,)g(etc\).)28 b(If)18 b(its)f(t)o(yp)q(e)h(is)g
1990Fn(function)j Fo(or)c Fn(CF)m(unction)s Fo(,)-42 869
1991y(this)g(function)g(is)f(called.)25 b(Otherwise,)17 b(the)g(fallbac)o
1992(k)f(\\function")g(is)h(called,)g(ha)o(ving)f(as)g(\014rst)h(parameter)
1993e(the)-42 925 y(v)m(alue)h(of)f Fm(var)p Fo(,)f(and)h(then)h(the)f
1994(original)f(call)g(parameters.)29 982 y(The)h(form:)42
19951054 y Fn(functionc)n(al)r(l)49 b Fj(!)h Fn(var)17 b
1996Fo(':')j Fn(name)c(r)n(e)n(alPar)n(ams)-42 1126 y Fo(can)g(b)q(e)g
1997(used)f(to)g(call)f(\\metho)q(ds".)19 b(A)c(call)f Fm(var:name\(...\))g
1998Fo(is)g(syn)o(tactic)h(sugar)f(for)6 1220 y Fm(var.name\(var,)22
1999b(...\))-42 1314 y Fo(except)16 b(that)f Fm(var)f Fo(is)h(ev)m(aluated)
2000g(only)g(once.)42 1382 y Fn(r)n(e)n(alPar)n(ams)49 b
2001Fj(!)h Fo('\(')16 b([)p Fn(explist1)6 b Fo(])15 b('\)')42
20021438 y Fn(r)n(e)n(alPar)n(ams)49 b Fj(!)h Fn(table)n(c)n(onstructor)115
20031495 y(explist1)f Fj(!)h Fn(exp1)17 b Fj(f)p Fo(',')e
2004Fn(exp1)6 b Fj(g)-42 1563 y Fo(All)18 b(argumen)o(t)e(expressions)i
2005(are)g(ev)m(aluated)g(b)q(efore)g(the)h(call;)f(then)g(the)g(list)f(of)
2006h(argumen)o(ts)e(is)i(adjusted)g(to)-42 1620 y(the)j(length)f(of)f(the)
2007h(list)f(of)h(parameters)e(\(see)j(Section)f(4.3\);)h(\014nally)l(,)f
2008(this)g(list)f(is)g(assigned)h(to)g(the)g(formal)-42
20091676 y(parameters.)g(A)15 b(call)g(of)g(the)h(form)e
2010Fm(f{...})h Fo(is)g(syn)o(tactic)f(sugar)h(for)g Fm(f\({...}\))p
2011Fo(,)f(that)h(is,)g(the)h(parameter)e(list)-42 1732 y(is)h(a)g(single)g
2012(new)g(table.)29 1789 y(Because)h(a)f(function)h(can)g(return)f(an)o(y)
2013g(n)o(um)o(b)q(er)g(of)g(results)g(\(see)h(Section)f(4.4.3\),)e(the)j
2014(n)o(um)o(b)q(er)f(of)g(results)-42 1845 y(m)o(ust)e(b)q(e)h(adjusted)g
2015(b)q(efore)g(used.)20 b(If)14 b(the)g(function)f(is)h(called)f(as)g(a)h
2016(statemen)o(t)d(\(see)j(Section)g(4.4.4\),)e(its)g(return)-42
20171902 y(list)18 b(is)h(adjusted)g(to)g(0.)31 b(If)20 b(the)f(function)g
2018(is)g(called)g(in)g(a)g(place)g(that)f(needs)i(a)f(single)f(v)m(alue)i
2019(\(syn)o(tactically)-42 1958 y(denoted)f(b)o(y)f(the)g(non-terminal)e
2020Fm(exp1)p Fo(\),)h(its)g(return)h(list)f(is)g(adjusted)h(to)g(1.)27
2021b(If)18 b(the)g(function)g(is)g(called)f(in)h(a)-42 2015
2022y(place)f(that)g(can)g(hold)g(man)o(y)e(v)m(alues)i(\(syn)o(tactically)
2023e(denoted)j(b)o(y)f(the)g(non-terminal)e Fm(exp)p Fo(\),)h(no)h
2024(adjustmen)o(t)-42 2071 y(is)e(done.)-42 2193 y Fe(4.6)56
2025b(F)-5 b(unction)20 b(De\014nitions)-42 2279 y Fo(F)l(unctions)c(in)g
2026(Lua)g(can)g(b)q(e)h(de\014ned)g(an)o(ywhere)f(in)g(the)g(global)e(lev)
2027o(el)i(of)f(a)h(c)o(h)o(unk.)22 b(The)16 b(syn)o(tax)f(for)h(function)
2028-42 2335 y(de\014nition)g(is:)42 2407 y Fn(function)50
2029b Fj(!)g Fl(function)16 b Fn(var)h Fo('\(')e([)p Fn(p)n(arlist1)6
2030b Fo(])16 b('\)')f Fn(blo)n(ck)g Fl(end)29 2536 y Fo(When)f(Lua)g
2031(pre-compiles)f(a)g(c)o(h)o(unk,)h(all)f(its)f(function)i(b)q(o)q(dies)
2032g(are)f(pre-compiled,)g(to)q(o.)19 b(Then,)14 b(when)g(Lua)-42
20332592 y(\\executes")i(the)f(function)g(de\014nition,)g(its)f(b)q(o)q(dy)
2034i(is)f(stored,)f(with)h(t)o(yp)q(e)g Fn(function)p Fo(,)f(in)o(to)g
2035(the)i(v)m(ariable)e Fm(var)p Fo(.)922 2748 y(8)p eop
2036%%Page: 9 9
20379 8 bop 29 199 a Fo(P)o(arameters)13 b(act)i(as)f(lo)q(cal)h(v)m
2038(ariables,)f(initialized)f(with)i(the)g(argumen)o(t)f(v)m(alues.)42
2039271 y Fn(p)n(arlist1)50 b Fj(!)g Fn(name)16 b Fj(f)p
2040Fo(',')f Fn(name)s Fj(g)29 400 y Fo(Results)g(are)f(returned)h(using)f
2041(the)h Fm(return)f Fo(statemen)o(t)e(\(see)j(Section)f(4.4.3\).)k(If)d
2042(con)o(trol)e(reac)o(hes)i(the)g(end)-42 456 y(of)g(a)g(function)g
2043(without)f(a)h(return)g(instruction,)f(the)h(function)g(returns)h(with)
2044e(no)h(results.)29 513 y(There)22 b(is)f(a)g(sp)q(ecial)g(syn)o(tax)g
2045(for)g(de\014nition)h(of)f(metho)q(ds,)h(that)e(is,)j(functions)e(whic)
2046o(h)g(ha)o(v)o(e)h(an)f(extra)-42 569 y(parameter)14
2047b Fn(self)p Fo(.)42 641 y Fn(function)50 b Fj(!)g Fl(function)16
2048b Fn(var)h Fo(':')j Fn(name)c Fo('\(')f([)p Fn(p)n(arlist1)6
2049b Fo(])16 b('\)')f Fn(blo)n(ck)g Fl(end)-42 714 y Fo(A)h(declaration)e
2050(lik)o(e)-42 807 y Fm(function)23 b(v:f)h(\(...\))6 864
2051y(...)-42 920 y(end)-42 1014 y Fo(is)15 b(equiv)m(alen)o(t)g(to)-42
20521108 y Fm(function)23 b(v.f)h(\(self,)f(...\))6 1164
2053y(...)-42 1221 y(end)-42 1315 y Fo(that)16 b(is,)g(the)g(function)g
2054(gets)g(an)g(extra)f(formal)f(parameter)h(called)h Fm(self)p
2055Fo(.)22 b(Notice)16 b(that)f(the)h(v)m(ariable)g Fm(v)g
2056Fo(m)o(ust)-42 1371 y(ha)o(v)o(e)f(b)q(een)i(previously)d(initialized)g
2057(with)g(a)h(table)g(v)m(alue.)-42 1493 y Fe(4.7)56 b(F)-5
2058b(allbac)n(ks)-42 1579 y Fo(Lua)17 b(pro)o(vides)f(a)g(p)q(o)o(w)o
2059(erful)g(mec)o(hanism)e(to)h(extend)i(its)f(seman)o(tics,)e(called)i
2060Fn(fal)r(lb)n(acks)p Fo(.)23 b(Basically)l(,)15 b(a)h(fallbac)o(k)-42
20611635 y(is)f(a)g(programmer)d(de\014ned)17 b(function)e(whic)o(h)g(is)f
2062(called)h(whenev)o(er)h(Lua)f(do)q(es)h(not)f(kno)o(w)f(ho)o(w)h(to)g
2063(pro)q(ceed.)29 1691 y(Lua)h(supp)q(orts)f(the)g(follo)o(wing)e
2064(fallbac)o(ks,)h(iden)o(ti\014ed)h(b)o(y)g(the)g(giv)o(en)g(strings:)
2065-42 1785 y Fl(\\arith")24 b Fo(called)17 b(when)g(an)h(arithmetic)c(op)
2066q(eration)j(is)g(applied)g(to)f(non)i(n)o(umerical)d(op)q(erands,)j(or)
2067f(when)g(the)72 1842 y(binary)f Fm(^)g Fo(op)q(eration)g(is)f(called.)
206823 b(It)17 b(receiv)o(es)f(three)g(argumen)o(ts:)k(the)d(t)o(w)o(o)e
2069(op)q(erands)h(\(the)g(second)h(one)72 1898 y(is)j(nil)g(when)h(the)g
2070(op)q(eration)e(is)h(unary)h(min)o(us\))e(and)h(one)h(of)f(the)g(follo)
2071o(wing)f(strings)g(describing)h(the)72 1955 y(o\013ended)c(op)q
2072(erator:)120 2067 y Fm(add)47 b(sub)g(mul)h(div)f(pow)g(unm)72
20732180 y Fo(Its)15 b(return)f(v)m(alue)h(is)f(the)h(\014nal)f(result)g
2074(of)g(the)h(arithmetic)d(op)q(eration.)19 b(The)c(default)f(function)g
2075(issues)h(an)72 2236 y(error.)-42 2330 y Fl(\\order")23
2076b Fo(called)15 b(when)h(an)g(order)f(comparison)e(is)i(applied)h(to)f
2077(non)g(n)o(umerical)f(or)h(non)h(string)e(op)q(erands.)21
2078b(It)72 2386 y(receiv)o(es)d(three)g(argumen)o(ts:)23
2079b(the)18 b(t)o(w)o(o)f(op)q(erands)h(and)g(one)g(of)f(the)h(follo)o
2080(wing)e(strings)h(describing)g(the)72 2443 y(o\013ended)f(op)q(erator:)
2081120 2555 y Fm(lt)23 b(gt)h(le)g(ge)922 2748 y Fo(9)p
2082eop
2083%%Page: 10 10
208410 9 bop 72 199 a Fo(Its)17 b(return)h(v)m(alue)f(is)g(the)g(\014nal)g
2085(result)g(of)g(the)g(comparison)f(op)q(eration.)25 b(The)18
2086b(default)e(function)i(issues)72 256 y(an)d(error.)-42
2087350 y Fl(\\concat")25 b Fo(called)d(when)g(a)f(concatenation)f(is)h
2088(applied)h(to)f(non)h(string)e(op)q(erands.)39 b(It)22
2089b(receiv)o(es)f(the)h(t)o(w)o(o)72 406 y(op)q(erands)d(as)f(argumen)o
2090(ts.)29 b(Its)18 b(return)h(v)m(alue)g(is)f(the)g(\014nal)h(result)f
2091(of)g(the)h(concatenation)f(op)q(eration.)72 462 y(The)e(default)e
2092(function)h(issues)g(an)h(error.)-42 556 y Fl(\\index")23
2093b Fo(called)14 b(when)i(Lua)f(tries)f(to)g(retriev)o(e)g(the)h(v)m
2094(alue)g(of)f(an)h(index)g(not)f(presen)o(t)h(in)f(a)h(table.)k(It)c
2095(receiv)o(es)72 613 y(as)20 b(argumen)o(ts)e(the)i(table)g(and)g(the)g
2096(index.)35 b(Its)20 b(return)g(v)m(alue)g(is)f(the)h(\014nal)g(result)g
2097(of)f(the)i(indexing)72 669 y(op)q(eration.)e(The)d(default)e(function)
2098h(returns)h(nil.)-42 763 y Fl(\\getglobal")24 b Fo(called)15
2099b(when)h(Lua)f(tries)f(to)h(retriev)o(e)f(the)i(v)m(alue)f(of)g(a)f
2100(global)g(v)m(ariable)h(whic)o(h)g(has)g(a)g(nil)f(v)m(alue)72
2101819 y(\(or)k(whic)o(h)h(has)g(not)g(b)q(een)h(initialized\).)30
2102b(It)19 b(receiv)o(es)g(as)f(argumen)o(t)g(the)h(name)f(of)g(the)i(v)m
2103(ariable.)30 b(Its)72 876 y(return)15 b(v)m(alue)h(is)e(the)i(\014nal)f
2104(result)f(of)h(the)g(expression.)20 b(The)c(default)e(function)h
2105(returns)g(nil.)-42 970 y Fl(\\gettable")25 b Fo(called)17
2106b(when)i(Lua)g(tries)e(to)g(index)i(a)f(non)g(table)g(v)m(alue.)29
2107b(It)18 b(receiv)o(es)g(as)g(argumen)o(ts)e(the)i(non)72
21081026 y(table)d(v)m(alue)h(and)g(the)g(index.)22 b(Its)15
2109b(return)h(v)m(alue)g(is)f(the)h(\014nal)g(result)f(of)g(the)h
2110(indexing)g(op)q(eration.)k(The)72 1083 y(default)15
2111b(function)g(issues)g(an)g(error.)-42 1176 y Fl(\\settable")24
2112b Fo(called)18 b(when)g(Lua)g(tries)f(to)h(assign)f(indexed)h(a)g(non)g
2113(table)f(v)m(alue.)28 b(It)18 b(receiv)o(es)g(as)f(argumen)o(ts)72
21141233 y(the)e(non)h(table)e(v)m(alue,)h(the)h(index,)f(and)g(the)h
2115(assigned)e(v)m(alue.)20 b(The)c(default)f(function)g(issues)g(an)g
2116(error.)-42 1327 y Fl(\\function")24 b Fo(called)16 b(when)h(Lua)g
2117(tries)f(to)g(call)f(a)h(non)h(function)f(v)m(alue.)24
2118b(It)17 b(receiv)o(es)f(as)g(argumen)o(ts)f(the)h(non)72
21191383 y(function)i(v)m(alue)h(and)g(the)f(argumen)o(ts)f(giv)o(en)h(in)g
2120(the)h(original)d(call.)29 b(Its)19 b(return)f(v)m(alues)h(are)f(the)h
2121(\014nal)72 1440 y(results)c(of)f(the)i(call)e(op)q(eration.)19
2122b(The)d(default)e(function)h(issues)g(an)h(error.)-42
21231533 y Fl(\\gc")24 b Fo(called)12 b(during)g(garbage)e(collection.)18
2124b(It)12 b(receiv)o(es)g(as)f(argumen)o(t)f(the)i(table)f(b)q(eing)h
2125(collected.)19 b(After)11 b(eac)o(h)72 1590 y(run)16
2126b(of)f(the)g(collector)f(this)h(function)g(is)g(called)g(with)g
2127(argumen)o(t)f(nil.)20 b(Because)c(this)e(function)i(op)q(erates)72
21281646 y(during)i(garbage)g(collection,)f(it)h(m)o(ust)f(b)q(e)i(used)g
2129(with)f(great)f(care,)i(and)f(programmers)d(should)k(a)o(v)o(oid)72
21301703 y(the)g(creation)g(of)g(new)g(ob)s(jects)g(\(tables)f(or)h
2131(strings\))e(in)i(this)g(function.)32 b(The)19 b(default)g(function)g
2132(do)q(es)72 1759 y(nothing.)-42 1853 y Fl(\\error")k
2133Fo(called)16 b(when)i(an)f(error)f(o)q(ccurs.)26 b(It)17
2134b(receiv)o(es)g(as)g(argumen)o(t)e(a)i(string)f(describing)h(the)g
2135(error.)25 b(The)72 1910 y(default)15 b(function)g(prin)o(ts)f(the)i
2136(message)d(on)j(the)f(standard)g(error)f(output.)29 2003
2137y(The)19 b(function)f Fm(setfallback)f Fo(is)g(used)i(to)f(c)o(hange)g
2138(a)g(fallbac)o(k)f(action.)29 b(Its)18 b(\014rst)g(argumen)o(t)f(is)g
2139(a)h(string)-42 2060 y(describing)f(the)g(fallbac)o(k,)e(and)i(the)f
2140(second)i(the)e(new)h(function)g(to)f(b)q(e)h(called.)24
2141b(It)16 b(returns)h(the)f(old)h(function)-42 2116 y(for)e(the)g(giv)o
2142(en)g(fallbac)o(k.)29 2173 y(Section)g(8.6)f(sho)o(ws)h(an)g(example)f
2143(of)h(the)g(use)h(of)e(fallbac)o(ks.)-42 2294 y Fe(4.8)56
2144b(Error)18 b(Handling)-42 2380 y Fo(Because)c(Lua)g(is)e(an)h
2145(extension)g(language,)f(all)g(Lua)i(actions)e(start)g(from)f(C)i(co)q
2146(de)h(calling)d(a)i(function)g(from)e(the)-42 2437 y(Lua)j(library)l(.)
2147k(Whenev)o(er)13 b(an)g(error)f(o)q(ccurs)i(during)f(Lua)g(compilation)
2148d(or)j(execution,)g(an)g(error)f(fallbac)o(k)g(func-)-42
21492493 y(tion)k(is)g(called,)f(and)i(then)f(the)g(corresp)q(onding)h
2150(function)f(from)e(the)i(library)f(\()p Fm(lua_dofile)p
2151Fo(,)g Fm(lua_dostring)p Fo(,)-42 2550 y Fm(lua_call)p
2152Fo(,)f(and)i Fm(lua_callfunction)p Fo(\))c(is)j(terminated)e(returning)
2153i(an)g(error)g(condition.)911 2748 y(10)p eop
2154%%Page: 11 11
215511 10 bop 29 199 a Fo(The)15 b(only)f(argumen)o(t)e(to)i(the)g(error)g
2156(fallbac)o(k)f(function)h(is)g(a)g(string)g(describing)g(the)g(error.)
215719 b(The)c(standard)-42 256 y(I/O)i(library)d(rede\014nes)j(this)e
2158(fallbac)o(k,)f(using)h(the)h(debug)g(facilities)e(\(see)h(Section)h
2159(7,)f(in)g(order)h(to)f(prin)o(t)g(some)-42 312 y(extra)h
2160(informations,)c(lik)o(e)j(the)h(stac)o(k)f(of)h(calls.)21
2161b(F)l(or)15 b(more)f(information)f(ab)q(out)j(an)g(error,)e(the)i(Lua)h
2162(program)-42 369 y(can)j(include)f(the)g(compilation)d(pragma)h
2163Fm($debug)p Fo(.)62 b(This)18 b(pragma)f(m)o(ust)h(b)q(e)h(written)f
2164(in)h(a)f(line)h(b)o(y)g(itself.)-42 425 y(When)14 b(an)f(error)f(o)q
2165(ccurs)h(in)g(a)f(program)f(compiled)h(with)g(this)g(option,)g(the)h
2166(error)g(routine)f(is)g(able)h(to)f(prin)o(t)g(also)-42
2167482 y(the)18 b(lines)f(where)h(the)g(calls)e(\(and)i(the)f(error\))g(w)
2168o(ere)g(made.)26 b(If)18 b(needed,)h(it)e(is)g(p)q(ossible)g(to)g(c)o
2169(hange)h(the)f(error)-42 538 y(fallbac)o(k)d(routine;)h(see)g(Section)g
2170(4.7.)29 594 y(Lua)e(co)q(de)g(can)f(generate)g(an)g(error)g(b)o(y)g
2171(calling)f(the)i(function)f Fm(error)p Fo(.)18 b(Its)13
2172b(optional)d(parameter)h(is)h(a)g(string,)-42 651 y(whic)o(h)k(is)e
2173(used)i(as)f(the)g(error)g(message.)-42 794 y Fp(5)67
2174b(The)23 b(Application)h(Program)f(In)n(terface)-42 896
2175y Fo(This)13 b(section)g(describ)q(es)h(the)f(API)g(for)g(Lua,)h(that)e
2176(is,)h(the)g(set)g(of)f(C)h(functions)g(a)o(v)m(ailable)f(to)h(the)g
2177(host)g(program)-42 952 y(to)i(comm)o(unicate)e(with)h(the)h(library)l
2178(.)k(The)d(API)f(functions)g(can)h(b)q(e)f(classi\014ed)g(in)g(the)h
2179(follo)o(wing)d(categories:)14 1046 y(1.)22 b(executing)15
2180b(Lua)h(co)q(de;)14 1140 y(2.)22 b(con)o(v)o(erting)14
2181b(v)m(alues)i(b)q(et)o(w)o(een)f(C)g(and)g(Lua;)14 1233
2182y(3.)22 b(manipulating)13 b(\(reading)h(and)i(writing\))d(Lua)j(ob)s
2183(jects;)14 1327 y(4.)22 b(calling)14 b(Lua)i(functions;)14
21841421 y(5.)22 b(C)15 b(functions)g(to)g(b)q(e)g(called)g(b)o(y)g(Lua;)14
21851515 y(6.)22 b(references)16 b(to)f(Lua)g(Ob)s(jects.)-42
21861609 y(All)g(API)h(functions)f(are)f(declared)i(in)f(the)g(\014le)g
2187Fm(lua.h)p Fo(.)-42 1730 y Fe(5.1)56 b(Executing)18 b(Lua)h(Co)r(de)-42
21881816 y Fo(A)12 b(host)f(program)f(can)i(execute)g(Lua)g(c)o(h)o(unks)g
2189(written)f(in)g(a)h(\014le)f(or)h(in)f(a)g(string,)g(using)h(the)g
2190(follo)o(wing)d(functions:)-42 1967 y Fm(int)286 b(lua_dofile)357
2191b(\(char)23 b(*filename\);)-42 2023 y(int)286 b(lua_dostring)309
2192b(\(char)23 b(*string\);)-42 2117 y Fo(Both)15 b(functions)f(return)g
2193(an)g(error)f(co)q(de:)20 b(0,)14 b(in)g(case)g(of)g(success;)h(non)f
2194(zero,)g(in)g(case)h(of)e(errors.)19 b(The)c(function)-42
21952173 y Fm(lua_dofile)p Fo(,)h(if)g(called)g(with)g(argumen)o(t)f(NULL)j
2196(\(0\),)d(executes)j(the)f(\\\014le")f Fm(stdin)p Fo(.)23
2197b(F)l(unction)17 b Fm(lua_dofile)-42 2230 y Fo(is)f(also)e(able)h(to)g
2198(execute)h(pre-compiled)f(c)o(h)o(unks.)21 b(It)16 b(detects)f(whether)
2199h(the)f(\014le)h(is)f(text)g(or)g(not,)g(and)g(loads)g(it)-42
22002286 y(accordingly)g(\(see)g(program)e Fm(luac)p Fo(\).)-42
22012408 y Fe(5.2)56 b(Con)n(v)n(erting)20 b(V)-5 b(alues)20
2202b(b)r(et)n(w)n(een)e(C)h(and)h(Lua)-42 2494 y Fo(Because)13
2203b(Lua)f(has)g(no)f(static)g(t)o(yp)q(e)h(system,)f(all)f(v)m(alues)i
2204(passed)g(b)q(et)o(w)o(een)g(Lua)g(and)g(C)g(ha)o(v)o(e)f(t)o(yp)q(e)h
2205Fm(lua_Object)p Fo(,)-42 2550 y(whic)o(h)f(w)o(orks)f(lik)o(e)g(an)h
2206(abstract)f(t)o(yp)q(e)h(in)g(C)g(that)f(can)h(hold)g(an)o(y)g(Lua)g(v)
2207m(alue.)19 b(V)l(alues)11 b(of)f(t)o(yp)q(e)h Fm(lua_Object)f
2208Fo(ha)o(v)o(e)-42 2607 y(no)16 b(meaning)d(outside)i(Lua;)g(for)g
2209(instance,)g(the)g(comparisson)e(of)i(t)o(w)o(o)f Fm(lua_Object's)f
2210Fo(is)i(of)g(no)g(signi\014cance.)911 2748 y(11)p eop
2211%%Page: 12 12
221212 11 bop 29 199 a Fo(Lua)11 b(has)f(automatic)e(memory)f(managemen)o
2213(t,)i(and)h(garbage)g(collection.)17 b(Because)11 b(of)f(that,)g(a)g
2214Fm(lua_Object)-42 256 y Fo(has)18 b(a)f(limited)e(scop)q(e,)j(and)g(is)
2215f(only)g(v)m(alid)g(inside)g(the)h Fn(blo)n(ck)j Fo(where)d(it)f(w)o
2216(as)f(created.)27 b(A)17 b(C)h(function)f(called)-42
2217312 y(from)c(Lua)i(is)f(a)h(blo)q(c)o(k,)f(and)h(its)e(parameters)g
2218(are)h(v)m(alid)h(only)f(un)o(til)g(its)f(end.)21 b(A)14
2219b(go)q(o)q(d)h(programmi)o(ng)d(practice)-42 369 y(is)i(to)f(con)o(v)o
2220(ert)g(Lua)h(ob)s(jects)f(to)g(C)h(v)m(alues)g(as)f(so)q(on)h(as)f
2221(they)h(are)g(a)o(v)m(ailable,)e(and)i(nev)o(er)g(to)f(store)g
2222Fm(lua_Object)p Fo(s)-42 425 y(in)j(C)e(global)g(v)m(ariables.)29
2223482 y(When)f(C)g(co)q(de)h(calls)e(Lua)h(rep)q(eatedly)l(,)g(as)g(in)g
2224(a)f(lo)q(op,)h(ob)s(jects)f(returned)i(b)o(y)f(these)g(calls)f(accum)o
2225(ulate,)f(and)-42 538 y(ma)o(y)j(create)h(a)g(memory)d(problem.)19
2226b(T)l(o)c(a)o(v)o(oid)f(this,)g(nested)i(blo)q(c)o(ks)f(can)g(b)q(e)h
2227(de\014ned)g(with)f(the)g(functions:)-42 629 y Fm(void)262
2228b(lua_beginblock)f(\(void\);)-42 686 y(void)h(lua_endblock)309
2229b(\(void\);)-42 777 y Fo(After)15 b(the)h(end)f(of)g(the)g(blo)q(c)o
2230(k,)g(all)f Fm(lua_Object)p Fo('s)g(created)h(inside)g(it)f(are)h
2231(released.)29 834 y(T)l(o)g(c)o(hec)o(k)g(the)h(t)o(yp)q(e)f(of)g(a)g
2232Fm(lua_Object)p Fo(,)e(the)i(follo)o(wing)e(function)i(is)g(a)o(v)m
2233(ailable:)-42 925 y Fm(int)286 b(lua_type)405 b(\(lua_Object)22
2234b(object\);)-42 1016 y Fo(plus)16 b(the)f(follo)o(wing)e(macros)g(and)j
2235(functions:)-42 1108 y Fm(int)286 b(lua_isnil)381 b(\(lua_Object)22
2236b(object\);)-42 1164 y(int)286 b(lua_isnumber)309 b(\(lua_Object)22
2237b(object\);)-42 1220 y(int)286 b(lua_isstring)309 b(\(lua_Object)22
2238b(object\);)-42 1277 y(int)286 b(lua_istable)333 b(\(lua_Object)22
2239b(object\);)-42 1333 y(int)286 b(lua_isfunction)261 b(\(lua_Object)22
2240b(object\);)-42 1390 y(int)286 b(lua_iscfunction)237
2241b(\(lua_Object)22 b(object\);)-42 1446 y(int)286 b(lua_isuserdata)261
2242b(\(lua_Object)22 b(object\);)-42 1538 y Fo(All)14 b(macros)f(return)i
2243(1)f(if)g(the)h(ob)s(ject)f(is)g(compatible)f(with)h(the)g(giv)o(en)g
2244(t)o(yp)q(e,)h(and)g(0)f(otherwise.)19 b(The)c(function)-42
22451594 y Fm(lua_isnumber)d Fo(accepts)i(n)o(um)o(b)q(ers)f(and)h(n)o
2246(umerical)e(strings,)g Fm(lua_isstring)g Fo(accepts)i(strings)e(and)i
2247(n)o(um)o(b)q(ers)-42 1650 y(\(see)i(Section)f(4.2\),)e(and)j
2248Fm(lua_isfunction)d Fo(accepts)i(Lua)h(and)f(C)g(functions.)29
22491707 y(The)20 b(function)g Fm(lua_type)f Fo(can)h(b)q(e)h(used)f(to)g
2250(distinguish)f(b)q(et)o(w)o(een)h(di\013eren)o(t)f(kinds)h(of)g(user)g
2251(data;)h(see)-42 1763 y(b)q(elo)o(w.)29 1820 y(T)l(o)15
2252b(translate)f(a)h(v)m(alue)g(from)f(t)o(yp)q(e)h Fm(lua_Object)f
2253Fo(to)g(a)h(sp)q(eci\014c)h(C)f(t)o(yp)q(e,)g(the)g(programmer)d(can)k
2254(use:)-42 1911 y Fm(double)214 b(lua_getnumber)285 b(\(lua_Object)22
2255b(object\);)-42 1968 y(char)239 b(*lua_getstring)284
2256b(\(lua_Object)22 b(object\);)-42 2024 y(lua_CFunction)46
2257b(lua_getcfunction)213 b(\(lua_Object)22 b(object\);)-42
22582081 y(void)239 b(*lua_getuserdata)d(\(lua_Object)22
2259b(object\);)-42 2172 y(lua_getnumber)14 b Fo(con)o(v)o(erts)g(a)g
2260Fm(lua_Object)g Fo(to)g(a)h(\015oat.)k(This)c Fm(lua_Object)e
2261Fo(m)o(ust)h(b)q(e)h(a)g(n)o(um)o(b)q(er)f(or)h(a)f(string)-42
22622228 y(con)o(v)o(ertible)h(to)f(n)o(um)o(b)q(er)h(\(see)g(Section)g
2263(4.2\);)f(otherwise,)g(the)h(function)g(returns)g(0.)29
22642285 y Fm(lua_getstring)c Fo(con)o(v)o(erts)g(a)h Fm(lua_Object)f
2265Fo(to)h(a)g(string)g(\()p Fm(char)23 b(*)p Fo(\).)18
2266b(This)12 b Fm(lua_Object)f Fo(m)o(ust)g(b)q(e)i(a)f(string)-42
22672341 y(or)k(a)f(n)o(um)o(b)q(er;)h(otherwise,)e(the)i(function)g
2268(returns)g(0)f(\(the)h(n)o(ull)f(p)q(oin)o(ter\).)21
2269b(This)16 b(function)f(do)q(es)i(not)e(create)h(a)-42
22702398 y(new)f(string,)d(but)i(returns)g(a)f(p)q(oin)o(ter)g(to)h(a)f
2271(string)g(inside)g(the)h(Lua)g(en)o(vironmen)o(t.)k(Because)d(Lua)f
2272(has)f(garbage)-42 2454 y(collection,)h(there)h(is)g(no)g(guaran)o(tee)
2273g(that)f(suc)o(h)i(p)q(oin)o(ter)e(will)g(b)q(e)i(v)m(alid)f(after)f
2274(the)i(blo)q(c)o(k)f(ends.)29 2511 y Fm(lua_getcfunction)f
2275Fo(con)o(v)o(erts)h(a)h Fm(lua_Object)f Fo(to)g(a)h(C)g(function.)23
2276b(This)15 b Fm(lua_Object)g Fo(m)o(ust)g(ha)o(v)o(e)g(t)o(yp)q(e)-42
22772567 y Fn(CF)m(unction)s Fo(;)j(otherwise,)f(the)h(function)g(returns)g
2278(0)f(\(the)h(n)o(ull)f(p)q(oin)o(ter\).)27 b(The)18 b(t)o(yp)q(e)g
2279Fm(lua_CFunction)e Fo(is)h(ex-)-42 2623 y(plained)f(in)f(Section)g
2280(5.5.)911 2748 y(12)p eop
2281%%Page: 13 13
228213 12 bop 29 199 a Fm(lua_getuserdata)10 b Fo(con)o(v)o(erts)i(a)g
2283Fm(lua_Object)e Fo(to)i Fm(void*)p Fo(.)18 b(This)12
2284b Fm(lua_Object)f Fo(m)o(ust)g(ha)o(v)o(e)h(t)o(yp)q(e)g
2285Fn(user)n(data)s Fo(;)-42 256 y(otherwise,)j(the)g(function)g(returns)g
2286(0)g(\(the)g(n)o(ull)f(p)q(oin)o(ter\).)29 312 y(The)j(rev)o(erse)g
2287(pro)q(cess,)h(that)e(is,)h(passing)f(a)h(sp)q(eci\014c)h(C)f(v)m(alue)
2288g(to)g(Lua,)h(is)e(done)i(b)o(y)f(using)g(the)g(follo)o(wing)-42
2289369 y(functions:)-42 457 y Fm(void)262 b(lua_pushnumber)f(\(double)23
2290b(n\);)-42 513 y(void)262 b(lua_pushstring)f(\(char)23
2291b(*s\);)-42 570 y(void)262 b(lua_pushcfunction)189 b(\(lua_CFunction)22
2292b(f\);)-42 626 y(void)262 b(lua_pushusertag)237 b(\(void)23
2293b(*u,)h(int)f(tag\);)-42 714 y Fo(plus)16 b(the)f(macro:)-42
2294802 y Fm(void)262 b(lua_pushuserdata)213 b(\(void)23
2295b(*u\);)-42 890 y Fo(All)17 b(of)f(them)g(receiv)o(e)h(a)f(C)h(v)m
2296(alue,)g(con)o(v)o(ert)f(it)h(to)f(a)g(corresp)q(onden)o(t)i
2297Fm(lua_Object)p Fo(,)d(and)i(lea)o(v)o(e)f(the)h(result)g(on)-42
2298947 y(the)h(top)g(of)f(the)h(Lua)g(stac)o(k,)f(where)h(it)f(can)h(b)q
2299(e)h(assigned)e(to)g(a)h(Lua)g(v)m(ariable,)f(passed)h(as)g(paramen)o
2300(ter)e(to)h(a)-42 1003 y(Lua)f(function,)f(etc)g(\(see)g(b)q(elo)o
2301(w\).)29 1060 y(User)10 b(data)g(can)h(ha)o(v)o(e)e(di\013eren)o(t)h
2302(tags,)g(whose)g(seman)o(tics)f(are)h(de\014ned)h(b)o(y)g(the)f(host)g
2303(program.)16 b(An)o(y)10 b(p)q(ositiv)o(e)-42 1116 y(in)o(teger)15
2304b(can)h(b)q(e)h(used)f(to)g(tag)e(a)i(user)g(data.)21
2305b(When)16 b(a)g(user)g(data)f(is)g(retriev)o(ed,)g(the)h(function)g
2306Fm(lua_type)e Fo(can)-42 1173 y(b)q(e)i(used)g(to)f(get)f(its)h(tag.)29
23071229 y(T)l(o)g(complete)f(the)h(set,)g(the)g(v)m(alue)g
2308Fl(nil)g Fo(or)f(a)h Fm(lua_Object)f Fo(can)h(also)g(b)q(e)g(pushed)i
2309(on)o(to)d(the)h(stac)o(k,)f(with:)-42 1317 y Fm(void)262
2310b(lua_pushnil)333 b(\(void\);)-42 1374 y(void)262 b(lua_pushobject)f
2311(\(lua_Object)22 b(object\);)-42 1494 y Fe(5.3)56 b(Manipulating)22
2312b(Lua)c(Ob)s(jects)-42 1580 y Fo(T)l(o)d(read)h(the)f(v)m(alue)g(of)g
2313(an)o(y)g(global)f(Lua)h(v)m(ariable,)f(one)i(can)f(use)h(the)f
2314(function:)-42 1668 y Fm(lua_Object)118 b(lua_getglobal)285
2315b(\(char)23 b(*varname\);)-42 1756 y Fo(As)16 b(in)f(Lua,)g(if)g(the)g
2316(v)m(alue)g(of)g(the)g(global)f(is)h Fl(nil)p Fo(,)f(the)h
2317Fm("getglobal")f Fo(fallbac)o(k)g(is)g(called.)29 1813
2318y(T)l(o)h(store)f(a)h(v)m(alue)h(previously)e(pushed)j(on)o(to)d(the)h
2319(stac)o(k)g(in)g(a)f(global)g(v)m(ariable,)h(there)g(is)g(the)g
2320(function:)-42 1901 y Fm(void)262 b(lua_storeglobal)237
2321b(\(char)23 b(*varname\);)29 1989 y Fo(T)l(ables)15 b(can)g(also)f(b)q
2322(e)i(manipulated)e(via)g(the)i(API.)f(The)g(function)-42
23232077 y Fm(lua_Object)118 b(lua_getsubscript)213 b(\(void\);)-42
23242165 y Fo(exp)q(ects)16 b(on)f(the)h(stac)o(k)e(a)h(table)f(and)i(an)f
2325(index,)g(and)g(returns)g(the)g(con)o(ten)o(ts)g(of)g(the)g(table)f(at)
2326h(that)f(index.)20 b(As)-42 2221 y(in)15 b(Lua,)g(if)g(the)g(\014rst)f
2327(ob)s(ject)h(is)f(not)h(a)f(table,)g(or)h(the)g(index)g(is)g(not)f
2328(presen)o(t)h(in)g(the)g(table,)f(the)h(corresp)q(onden)o(t)-42
23292278 y(fallbac)o(k)f(is)h(called.)29 2334 y(T)l(o)h(store)g(a)g(v)m
2330(alue)h(in)f(an)h(index,)g(the)f(program)e(m)o(ust)h(push)j(on)o(to)d
2331(the)i(stac)o(k)e(the)i(table,)f(the)h(index,)f(and)-42
23322391 y(the)g(v)m(alue,)f(and)g(then)h(call)e(the)h(function:)-42
23332479 y Fm(void)24 b(lua_storesubscript)d(\(void\);)-42
23342567 y Fo(Again,)15 b(the)g(corresp)q(onden)o(t)g(fallbac)o(k)f(is)h
2335(called)g(if)f(needed.)29 2623 y(Finally)l(,)g(the)h(function)911
23362748 y(13)p eop
2337%%Page: 14 14
233814 13 bop -42 199 a Fm(lua_Object)118 b(lua_createtable)237
2339b(\(void\);)-42 293 y Fo(creates)15 b(a)g(new)h(table.)29
2340349 y Fn(Ple)n(ase)22 b(Notic)n(e:)36 b Fo(Most)22 b(functions)g(from)e
2341(the)j(Lua)f(library)f(receiv)o(e)i(parameters)d(through)i(the)h(stac)o
2342(k.)-42 406 y(Because)c(other)e(functions)g(also)g(use)h(the)g(stac)o
2343(k,)f(it)g(is)g(imp)q(ortan)o(t)e(that)i(these)h(parameters)e(b)q(e)i
2344(pushed)h(just)-42 462 y(b)q(efore)d(the)f(corresp)q(onden)o(t)g(call,)
2345f(without)g(in)o(termediate)e(calls)i(to)h(the)g(Lua)g(library)l(.)k(F)
2346l(or)14 b(instance,)h(supp)q(ose)-42 519 y(the)h(user)f(w)o(an)o(ts)f
2347(the)h(v)m(alue)h(of)f Fm(a[i])p Fo(.)k(A)c(simplistic)e(solution)h(w)o
2348(ould)g(b)q(e:)6 613 y Fm(/*)24 b(Warning:)f(WRONG)g(CODE)g(*/)6
2349669 y(lua_Object)g(result;)6 725 y(lua_pushobject\(lua_getglobal)o
2350(\("a"\)\);)44 b(/*)24 b(push)f(table)g(*/)6 782 y
2351(lua_pushobject\(lua_getglobal)o(\("i"\)\);)44 b(/*)24
2352b(push)f(index)g(*/)6 838 y(result)g(=)h(lua_getsubscript\(\);)-42
2353932 y Fo(Ho)o(w)o(ev)o(er,)c(the)f(call)g Fm(lua_getglobal\("i"\))e
2354Fo(mo)q(di\014es)i(the)h(stac)o(k,)f(and)h(in)o(v)m(alidates)e(the)i
2355(previous)f(pushed)-42 989 y(v)m(alue.)i(A)15 b(correct)g(solution)f
2356(could)h(b)q(e:)6 1082 y Fm(lua_Object)23 b(result;)6
23571139 y(lua_Object)g(index)g(=)h(lua_getglobal\("i"\);)6
23581195 y(lua_pushobject\(lua_getglobal)o(\("a"\)\);)44
2359b(/*)24 b(push)f(table)g(*/)6 1252 y(lua_pushobject\(index\);)355
2360b(/*)24 b(push)f(index)g(*/)6 1308 y(result)g(=)h
2361(lua_getsubscript\(\);)-42 1430 y Fe(5.4)56 b(Calling)21
2362b(Lua)e(F)-5 b(unctions)-42 1516 y Fo(F)l(unctions)19
2363b(de\014ned)g(in)g(Lua)f(b)o(y)h(a)f(c)o(h)o(unk)g(executed)i(with)e
2364Fm(dofile)f Fo(or)h Fm(dostring)f Fo(can)i(b)q(e)g(called)f(from)e(the)
2365-42 1572 y(host)h(program.)23 b(This)16 b(is)g(done)h(using)g(the)g
2366(follo)o(wing)e(proto)q(col:)22 b(\014rst,)16 b(the)h(argumen)o(ts)e
2367(to)h(the)h(function)g(are)-42 1629 y(pushed)f(on)o(to)d(the)i(Lua)g
2368(stac)o(k)e(\(see)i(Section)f(5.2\),)f(in)h(direct)g(order,)g(i.e.,)g
2369(the)g(\014rst)g(argumen)o(t)f(is)h(pushed)h(\014rst.)-42
23701685 y(Again,)g(it)f(is)h(imp)q(ortan)o(t)e(to)h(emphasize)h(that,)f
2371(during)h(this)f(phase,)i(no)f(other)g(Lua)g(function)g(can)g(b)q(e)h
2372(called.)29 1741 y(Then,)f(the)h(function)f(is)f(called)h(using)-42
23731835 y Fm(int)286 b(lua_call)405 b(\(char)23 b(*functionname\);)-42
23741929 y Fo(or)-42 2023 y Fm(int)286 b(lua_callfunction)213
2375b(\(lua_Object)22 b(function\);)-42 2116 y Fo(Both)16
2376b(functions)g(return)f(an)h(error)f(co)q(de:)22 b(0,)15
2377b(in)h(case)g(of)f(success;)i(non)f(zero,)f(in)h(case)g(of)f(errors.)21
2378b(Finally)l(,)14 b(the)-42 2173 y(returned)i(v)m(alues)f(\(a)g(Lua)h
2379(function)f(ma)o(y)e(return)i(man)o(y)f(v)m(alues\))h(can)g(b)q(e)h
2380(retriev)o(ed)f(with)f(the)i(macro)-42 2267 y Fm(lua_Object)118
2381b(lua_getresult)309 b(\(int)23 b(number\);)-42 2360 y
2382Fo(where)18 b Fm(number)d Fo(is)i(the)g(order)f(of)h(the)g(result,)f
2383(starting)f(with)h(1.)25 b(When)17 b(called)f(with)g(a)h(n)o(um)o(b)q
2384(er)f(larger)g(than)-42 2417 y(the)g(actual)e(n)o(um)o(b)q(er)h(of)f
2385(results,)h(this)f(function)h(returns)g Fm(LUA_NOOBJECT)p
2386Fo(.)29 2473 y(Tw)o(o)j(sp)q(ecial)g(Lua)g(functions)h(ha)o(v)o(e)e
2387(exclusiv)o(e)i(in)o(terfaces:)25 b Fm(error)18 b Fo(and)g
2388Fm(setfallback)p Fo(.)28 b(A)18 b(C)h(function)-42 2530
2389y(can)d(generate)f(a)g(Lua)g(error)g(calling)f(the)h(function)-42
23902623 y Fm(void)24 b(lua_error)e(\(char)i(*message\);)911
23912748 y Fo(14)p eop
2392%%Page: 15 15
239315 14 bop -42 199 a Fo(This)18 b(function)g(nev)o(er)g(returns.)28
2394b(If)18 b(the)g(C)f(function)h(has)g(b)q(een)h(called)f(from)e(Lua,)i
2395(the)g(corresp)q(onding)g(Lua)-42 256 y(execution)f(terminates,)d(as)i
2396(if)g(an)g(error)f(had)i(o)q(ccurred)g(inside)f(Lua)h(co)q(de.)23
2397b(Otherwise,)16 b(the)h(whole)f(program)-42 312 y(terminates.)29
2398369 y(F)l(allbac)o(ks)e(can)h(b)q(e)h(c)o(hanged)g(with:)-42
2399454 y Fm(lua_Object)23 b(lua_setfallback)f(\(char)h(*name,)g
2400(lua_CFunction)f(fallback\);)-42 540 y Fo(The)12 b(\014rst)f(parameter)
2401f(is)g(the)i(fallbac)o(k)e(name,)h(and)g(the)h(second)f(a)h(CF)l
2402(unction)f(to)f(b)q(e)i(used)g(as)f(the)h(new)f(fallbac)o(k.)-42
2403596 y(This)k(function)f(returns)h(a)f Fm(lua_Object)p
2404Fo(,)g(whic)o(h)g(is)g(the)h(old)g(fallbac)o(k)e(v)m(alue,)i(or)f
2405Fl(nil)g Fo(on)g(fail)g(\(in)o(v)m(alid)g(fallbac)o(k)-42
2406653 y(name\).)19 b(This)c(old)g(v)m(alue)g(can)g(b)q(e)h(used)g(for)f
2407(c)o(haining)f(fallbac)o(ks.)29 709 y(An)i(example)e(of)g(C)h(co)q(de)h
2408(calling)e(a)h(Lua)g(function)h(is)e(sho)o(wn)h(in)g(Section)g(8.10.)
2409-42 829 y Fe(5.5)56 b(C)19 b(F)-5 b(unctions)-42 915
2410y Fo(T)l(o)15 b(register)g(a)f(C)h(function)g(to)g(Lua,)g(there)g(is)g
2411(the)g(follo)o(wing)e(macro:)-42 1001 y Fm(#define)23
2412b(lua_register\(n,f\))165 b(\(lua_pushcfunction\(f\),)21
2413b(lua_storeglobal\(n\)\))-42 1057 y(/*)j(char)f(*n;)215
2414b(*/)-42 1114 y(/*)24 b(lua_CFunction)e(f;)i(*/)-42 1199
2415y Fo(whic)o(h)15 b(receiv)o(es)g(the)f(name)g(the)h(function)f(will)g
2416(ha)o(v)o(e)g(in)g(Lua,)h(and)g(a)f(p)q(oin)o(ter)g(to)g(the)h
2417(function.)20 b(This)14 b(p)q(oin)o(ter)-42 1256 y(m)o(ust)g(ha)o(v)o
2418(e)h(t)o(yp)q(e)g Fm(lua_CFunction)p Fo(,)e(whic)o(h)i(is)g(de\014ned)i
2419(as)-42 1341 y Fm(typedef)23 b(void)h(\(*lua_CFunction\))d(\(void\);)
2420-42 1427 y Fo(that)15 b(is,)f(a)h(p)q(oin)o(ter)g(to)f(a)h(function)g
2421(with)g(no)g(parameters)e(and)j(no)f(results.)29 1483
2422y(In)g(order)e(to)h(comm)o(unicate)d(prop)q(erly)j(with)f(Lua,)h(a)f(C)
2423h(function)g(m)o(ust)e(follo)o(w)g(a)i(proto)q(col,)f(whic)o(h)g
2424(de\014nes)-42 1540 y(the)j(w)o(a)o(y)e(parameters)f(and)j(results)e
2425(are)h(passed.)29 1596 y(T)l(o)g(access)g(its)g(argumen)o(ts,)e(a)i(C)g
2426(function)g(calls:)-42 1682 y Fm(lua_Object)118 b(lua_getparam)309
2427b(\(int)23 b(number\);)-42 1767 y Fo(where)16 b Fm(number)e
2428Fo(starts)g(with)h(1)g(to)f(get)h(the)h(\014rst)e(argumen)o(t.)19
2429b(When)c(called)g(with)g(a)g(n)o(um)o(b)q(er)f(larger)g(than)h(the)-42
24301824 y(actual)d(n)o(um)o(b)q(er)g(of)g(argumen)o(ts,)f(this)g(function)
2431i(returns)f Fm(LUA_NOOBJECT)p Fo(.)e(In)j(this)f(w)o(a)o(y)l(,)g(it)g
2432(is)f(p)q(ossible)i(to)e(write)-42 1880 y(functions)k(that)g(w)o(ork)f
2433(with)h(a)g(v)m(ariable)f(n)o(um)o(b)q(er)h(of)f(parameters.)29
24341937 y(T)l(o)g(return)g(v)m(alues,)g(a)g(C)g(function)g(just)f(pushes)i
2435(them)e(on)o(to)g(the)i(stac)o(k,)e(in)h(direct)g(order;)f(see)i
2436(Section)f(5.2.)-42 1993 y(Lik)o(e)i(a)e(Lua)i(function,)f(a)g(C)g
2437(function)g(called)f(b)o(y)h(Lua)h(can)f(also)g(return)g(man)o(y)e
2438(results.)29 2050 y(Section)i(8.9)f(presen)o(ts)i(an)f(example)f(of)g
2439(a)h(CF)l(unction.)-42 2170 y Fe(5.6)56 b(References)17
2440b(to)i(Lua)f(Ob)s(jects)-42 2256 y Fo(As)h(already)g(noted,)g
2441Fm(lua_Object)p Fo(s)f(are)h(v)o(olatile.)29 b(If)19
2442b(the)g(C)g(co)q(de)h(needs)g(to)e(k)o(eep)h(a)g Fm(lua_Object)f
2443Fo(outside)-42 2312 y(blo)q(c)o(k)f(b)q(oundaries,)g(it)e(m)o(ust)g
2444(create)i(a)f Fn(r)n(efer)n(enc)n(e)f Fo(to)h(the)g(ob)s(ject.)23
2445b(The)17 b(routines)f(to)g(manipulate)f(references)-42
24462369 y(are)g(the)h(follo)o(wing:)-42 2454 y Fm(int)286
2447b(lua_ref)23 b(\(int)h(lock\);)-42 2511 y(lua_Object)118
2448b(lua_getref)47 b(\(int)23 b(ref\);)-42 2567 y(void)262
2449b(lua_pushref)23 b(\(int)g(ref\);)-42 2623 y(void)262
2450b(lua_unref)23 b(\(int)g(ref\);)911 2748 y Fo(15)p eop
2451%%Page: 16 16
245216 15 bop -42 199 a Fo(The)23 b(function)e Fm(lua_ref)g
2453Fo(creates)g(a)h(reference)g(to)g(the)f(ob)s(ject)h(whic)o(h)f(is)h(on)
2454f(the)h(top)g(of)f(the)h(stac)o(k,)g(and)-42 256 y(returns)f(this)f
2455(reference.)36 b(If)21 b Fm(lock)f Fo(is)g(true,)h(the)g(ob)s(ject)f
2456(is)g Fn(lo)n(cke)n(d)p Fo(:)30 b(that)19 b(means)h(the)h(ob)s(ject)e
2457(will)h(not)g(b)q(e)-42 312 y(garbage)g(collected.)35
2458b(Notice)19 b(that)h(an)g(unlo)q(c)o(k)o(ed)g(reference)h(ma)o(y)e(b)q
2459(e)i(garbage)e(collected.)35 b(Whenev)o(er)20 b(the)-42
2460369 y(referenced)15 b(ob)s(ject)e(is)f(needed,)j(a)e(call)f(to)h
2461Fm(lua_getref)f Fo(returns)h(a)g(handle)h(to)f(it,)f(while)h
2462Fm(lua_pushref)f Fo(pushes)-42 425 y(the)k(ob)s(ject)g(on)g(the)g(stac)
2463o(k.)21 b(If)16 b(the)g(ob)s(ject)f(has)h(b)q(een)h(collected,)e
2464Fm(lua_getref)g Fo(returns)g Fm(LUA_NOOBJECT)p Fo(,)f(and)-42
2465482 y Fm(lua_pushobject)g Fo(issues)h(an)g(error.)29
2466538 y(When)h(a)f(reference)g(is)g(no)g(longer)g(needed,)h(it)e(can)i(b)
2467q(e)g(freed)f(with)g(a)f(call)h(to)f Fm(lua_unref)p Fo(.)-42
2468681 y Fp(6)67 b(Prede\014ned)24 b(F)-6 b(unctions)24
2469b(and)f(Libraries)-42 783 y Fo(The)17 b(set)g(of)f(prede\014ned)i
2470(functions)e(in)h(Lua)f(is)h(small)d(but)j(p)q(o)o(w)o(erful.)23
2471b(Most)15 b(of)h(them)g(pro)o(vide)g(features)g(that)-42
2472839 y(allo)o(ws)d(some)h(degree)g(of)h(re\015exivit)o(y)e(in)i(the)f
2473(language.)19 b(Some)14 b(of)g(these)h(features)f(cannot)g(b)q(e)i(sim)
2474o(ulated)c(with)-42 896 y(the)21 b(rest)f(of)g(the)h(Language)g(nor)f
2475(with)g(the)h(standard)f(Lua)h(API.)f(Others)h(are)f(just)h(helpful)f
2476(in)o(terfaces)g(to)-42 952 y(common)13 b(API)j(functions.)29
24771008 y(The)e(libraries,)e(on)i(the)f(other)g(hand,)h(pro)o(vide)g
2478(useful)f(routines)g(that)g(are)h(implemen)o(ted)d(directly)i(through)
2479-42 1065 y(the)g(standard)f(API.)h(Therefore,)f(they)h(are)f(not)g
2480(necessary)h(to)f(the)g(language,)g(and)h(are)f(pro)o(vided)h(as)f
2481(separated)-42 1121 y(C)j(mo)q(dules.)k(Curren)o(tly)c(there)g(are)g
2482(three)g(standard)g(libraries:)27 1215 y Fj(\017)22 b
2483Fo(string)14 b(manipulation;)27 1309 y Fj(\017)22 b Fo(mathematical)11
2484b(functions)k(\(sin,)g(cos,)f(etc\);)27 1403 y Fj(\017)22
2485b Fo(input)15 b(and)h(output)f(\(plus)g(some)e(system)h(facilities\).)
2486-42 1497 y(In)j(order)f(to)g(ha)o(v)o(e)g(access)g(to)g(these)g
2487(libraries,)f(the)h(host)g(program)e(m)o(ust)h(call)g(the)h(functions)g
2488Fm(strlib_open)p Fo(,)-42 1553 y Fm(mathlib_open)p Fo(,)e(and)h
2489Fm(iolib_open)p Fo(,)e(declared)j(in)f Fm(lualib.h)p
2490Fo(.)-42 1675 y Fe(6.1)56 b(Prede\014ned)18 b(F)-5 b(unctions)-42
24911761 y Fm(dofile)24 b(\(filename\))-42 1846 y Fo(This)18
2492b(function)g(receiv)o(es)g(a)f(\014le)h(name,)f(op)q(ens)i(it)e(and)h
2493(executes)h(its)e(con)o(ten)o(ts)g(as)h(a)f(Lua)i(c)o(h)o(unk,)f(or)g
2494(as)f(pre-)-42 1903 y(compiled)e(c)o(h)o(unks.)20 b(When)c(called)f
2495(without)f(argumen)o(ts,)g(it)g(executes)i(the)g(con)o(ten)o(ts)e(of)h
2496(the)h(standard)f(input.)-42 1959 y(It)i(returns)g(1)f(if)g(there)h
2497(are)f(no)h(errors,)f Fl(nil)g Fo(otherwise.)23 b(It)17
2498b(issues)f(an)h(error)f(when)h(called)f(with)g(a)h(non)f(string)-42
24992016 y(argumen)o(t.)-42 2136 y Fm(dostring)23 b(\(string\))-42
25002222 y Fo(This)e(function)h(executes)g(a)f(giv)o(en)g(string)f(as)h(a)g
2501(Lua)h(c)o(h)o(unk.)38 b(It)22 b(returns)f(1)g(if)g(there)g(are)g(no)h
2502(errors,)f Fl(nil)-42 2278 y Fo(otherwise.)-42 2398 y
2503Fm(next)j(\(table,)f(index\))-42 2484 y Fo(This)18 b(function)f(allo)o
2504(ws)f(a)i(program)d(to)i(tra)o(v)o(erse)g(all)g(\014elds)h(of)f(a)g
2505(table.)27 b(Its)18 b(\014rst)f(argumen)o(t)f(is)i(a)f(table)g(and)-42
25062540 y(its)e(second)i(argumen)o(t)c(is)j(an)f(index)h(in)g(this)f
2507(table.)21 b(It)15 b(returns)h(the)g(next)f(index)h(of)g(the)f(table)h
2508(and)f(the)h(v)m(alue)-42 2597 y(asso)q(ciated)g(with)f(the)h(index.)23
2509b(When)17 b(called)e(with)h Fl(nil)f Fo(as)g(its)h(second)g(argumen)o
2510(t,)e(the)j(function)e(returns)h(the)911 2748 y(16)p
2511eop
2512%%Page: 17 17
251317 16 bop -42 199 a Fo(\014rst)16 b(index)g(of)g(the)g(table)g(\(and)f
2514(its)h(asso)q(ciated)f(v)m(alue\).)22 b(When)17 b(called)e(with)h(the)g
2515(last)f(index,)h(or)f(with)h Fl(nil)f Fo(in)-42 256 y(an)h(empt)o(y)e
2516(table,)g(it)g(returns)h Fl(nil)p Fo(.)29 312 y(In)i(Lua)f(there)g(is)g
2517(no)g(declaration)f(of)h(\014elds;)g(seman)o(tically)l(,)d(there)j(is)g
2518(no)g(di\013erence)g(b)q(et)o(w)o(een)h(a)e(\014eld)i(not)-42
2519369 y(presen)o(t)g(in)f(a)g(table)f(or)h(a)g(\014eld)h(with)e(v)m(alue)
2520i Fl(nil)p Fo(.)22 b(Therefore,)16 b(the)g(function)g(only)g(considers)
2521g(\014elds)h(with)e(non)-42 425 y(nil)g(v)m(alues.)20
2522b(The)c(order)f(the)g(indices)g(are)g(en)o(umerated)f(is)h(not)g(sp)q
2523(eci\014ed,)h Fn(even)f(for)i(numeric)f(indic)n(es)p
2524Fo(.)29 482 y(See)g(Section)f(8.2)f(for)h(an)g(example)f(of)h(the)g
2525(use)h(of)e(this)h(function.)-42 602 y Fm(nextvar)23
2526b(\(name\))-42 687 y Fo(This)18 b(function)g(is)g(similar)d(to)i(the)i
2527(function)f Fm(next)p Fo(,)f(but)i(it)e(iterates)g(o)o(v)o(er)g(the)h
2528(global)f(v)m(ariables.)28 b(Its)18 b(single)-42 744
2529y(argumen)o(t)c(is)h(the)h(name)e(of)h(a)g(global)f(v)m(ariable,)g(or)h
2530Fl(nil)g Fo(to)g(get)g(a)g(\014rst)g(name.)k(Similarly)13
2531b(to)h Fm(next)p Fo(,)h(it)g(returns)-42 800 y(the)j(name)e(of)g
2532(another)h(v)m(ariable)f(and)h(its)f(v)m(alue,)i(or)e
2533Fl(nil)g Fo(if)g(there)h(are)g(no)g(more)e(v)m(ariables.)25
2534b(See)18 b(Section)e(8.2)-42 857 y(for)f(an)g(example)f(of)h(the)g(use)
2535h(of)f(this)f(function.)-42 977 y Fm(tostring)23 b(\(e\))-42
25361063 y Fo(This)15 b(function)g(receiv)o(es)g(an)g(argumen)o(t)f(of)h
2537(an)o(y)g(t)o(yp)q(e)g(and)g(con)o(v)o(erts)g(it)f(to)h(a)f(string)h
2538(in)g(a)g(reasonable)f(format.)-42 1183 y Fm(print)24
2539b(\(e1,)f(e2,)g(...\))-42 1269 y Fo(This)18 b(function)g(receiv)o(es)g
2540(an)o(y)g(n)o(um)o(b)q(er)g(of)f(argumen)o(ts,)g(and)h(prin)o(ts)g
2541(their)f(v)m(alues)i(in)f(a)g(reasonable)f(format.)-42
25421325 y(Eac)o(h)i(v)m(alue)g(is)f(prin)o(ted)h(in)f(a)h(new)g(line.)30
2543b(This)18 b(function)h(is)f(not)g(in)o(tended)h(for)f(formatted)f
2544(output,)i(but)g(as)-42 1381 y(a)h(quic)o(k)f(w)o(a)o(y)g(to)g(sho)o(w)
2545g(a)g(v)m(alue,)i(for)e(instance)g(for)g(error)g(messages)f(or)h
2546(debugging.)34 b(See)20 b(Section)f(6.4)g(for)-42 1438
2547y(functions)c(for)g(formatted)e(output.)-42 1558 y Fm(tonumber)23
2548b(\(e\))-42 1644 y Fo(This)13 b(function)f(receiv)o(es)g(one)h(argumen)
2549o(t,)e(and)h(tries)g(to)g(con)o(v)o(ert)f(it)h(to)g(a)g(n)o(um)o(b)q
2550(er.)18 b(If)13 b(the)g(argumen)o(t)d(is)i(already)-42
25511700 y(a)j(n)o(um)o(b)q(er)g(or)g(a)g(string)f(con)o(v)o(ertible)g(to)h
2552(a)g(n)o(um)o(b)q(er)f(\(see)h(Section)h(4.2\),)d(it)i(returns)g(that)f
2553(n)o(um)o(b)q(er;)h(otherwise,)-42 1757 y(it)g(returns)g
2554Fl(nil)p Fo(.)-42 1877 y Fm(type)24 b(\(v\))-42 1963
2555y Fo(This)13 b(function)h(allo)o(ws)d(Lua)j(to)e(test)h(the)g(t)o(yp)q
2556(e)h(of)f(a)g(v)m(alue.)19 b(It)13 b(receiv)o(es)h(one)f(argumen)o(t,)f
2557(and)h(returns)g(its)g(t)o(yp)q(e,)-42 2019 y(co)q(ded)21
2558b(as)e(a)g(string.)31 b(The)19 b(p)q(ossible)g(results)g(of)g(this)g
2559(function)g(are)g Fm("nil")g Fo(\(a)f(string,)h(not)g(the)h(v)m(alue)f
2560Fl(nil)p Fo(\),)-42 2075 y Fm("number")p Fo(,)g Fm("string")p
2561Fo(,)g Fm("table")p Fo(,)h Fm("function")e Fo(\(returned)h(b)q(oth)h
2562(for)f(C)g(functions)g(and)h(Lua)f(functions\),)-42 2132
2563y(and)d Fm("userdata")p Fo(.)29 2188 y(Besides)f(this)f(string,)f(the)i
2564(function)f(returns)h(a)f(second)h(result,)f(whic)o(h)g(is)g(the)h
2565Fn(tag)g Fo(of)f(the)g(v)m(alue.)20 b(This)14 b(tag)-42
25662245 y(can)g(b)q(e)h(used)f(to)f(distinguish)g(b)q(et)o(w)o(een)g(user)
2567h(data)f(with)g(di\013eren)o(t)g(tags,)g(and)h(b)q(et)o(w)o(een)f(C)h
2568(functions)f(and)h(Lua)-42 2301 y(functions.)-42 2421
2569y Fm(assert)24 b(\(v\))-42 2507 y Fo(This)15 b(function)g(issues)g(an)g
2570Fn(\\assertion)h(faile)n(d!")k Fo(error)15 b(when)h(its)e(argumen)o(t)f
2571(is)i Fl(nil)p Fo(.)911 2748 y(17)p eop
2572%%Page: 18 18
257318 17 bop -42 199 a Fm(error)24 b(\(message\))-42 285
2574y Fo(This)e(function)f(issues)g(an)h(error)f(message)f(and)h
2575(terminates)f(the)h(last)g(called)g(function)g(from)f(the)i(library)-42
2576342 y(\()p Fm(lua_dofile)p Fo(,)14 b Fm(lua_dostring)p
2577Fo(,)f(.)7 b(.)g(.)g(\).)20 b(It)15 b(nev)o(er)g(returns.)-42
2578462 y Fm(setglobal)23 b(\(name,)g(value\))-42 547 y Fo(This)18
2579b(function)h(assigns)e(the)i(giv)o(en)f(v)m(alue)g(to)g(a)g(global)f(v)
2580m(ariable.)29 b(The)19 b(string)e Fm(name)h Fo(do)q(es)h(not)f(need)h
2581(to)f(b)q(e)-42 604 y(a)f(syn)o(tactically)d(v)m(alid)i(v)m(ariable)g
2582(name.)22 b(Therefore,)17 b(this)f(function)g(can)g(set)h(global)e(v)m
2583(ariables)g(with)h(strange)-42 660 y(names)f(lik)o(e)f
2584Fm(m)24 b(v)f(1)15 b Fo(or)g Fm(34)p Fo(.)20 b(It)15
2585b(returns)g(the)g(v)m(alue)h(of)e(its)h(second)h(argumen)o(t.)-42
2586780 y Fm(getglobal)23 b(\(name\))-42 866 y Fo(This)e(function)g
2587(retriev)o(es)g(the)g(v)m(alue)h(of)f(a)g(global)f(v)m(ariable.)37
2588b(The)22 b(string)e Fm(name)h Fo(do)q(es)g(not)g(need)h(to)f(b)q(e)h(a)
2589-42 923 y(syn)o(tactically)14 b(v)m(alid)g(v)m(ariable)h(name.)-42
25901043 y Fm(setfallback)23 b(\(fallbackname,)f(newfallback\))-42
25911128 y Fo(This)13 b(function)f(sets)g(a)h(new)f(fallbac)o(k)g(function)
2592g(to)g(the)h(giv)o(en)f(fallbac)o(k.)18 b(It)12 b(returns)h(the)g(old)f
2593(fallbac)o(k)f(function.)-42 1250 y Fe(6.2)56 b(String)19
2594b(Manipulation)-42 1336 y Fo(This)j(library)e(pro)o(vides)i(generic)f
2595(functions)h(for)f(string)g(manipulation,)f(suc)o(h)i(as)g(\014nding)g
2596(and)g(extracting)-42 1392 y(substrings.)29 b(When)19
2597b(indexing)f(a)g(string,)f(the)i(\014rst)f(c)o(haracter)f(has)h(p)q
2598(osition)g(1.)29 b(See)19 b(Section)f(8.3)f(for)h(some)-42
25991449 y(examples)c(on)i(string)e(manipulation)f(in)i(Lua.)-42
26001569 y Fm(strfind)23 b(\(str,)h(substr,)e([init,)i([end]]\))-42
26011655 y Fo(Receiv)o(es)c(t)o(w)o(o)e(string)h(argumen)o(ts,)f(and)h
2602(returns)g(a)g(n)o(um)o(b)q(er.)32 b(This)19 b(n)o(um)o(b)q(er)f
2603(indicates)h(the)g(\014rst)g(p)q(osition)-42 1711 y(where)13
2604b(the)f(second)h(argumen)o(t)e(app)q(ears)h(in)g(the)g(\014rst)g
2605(argumen)o(t.)17 b(If)c(the)f(second)h(argumen)o(t)d(is)i(not)g(a)g
2606(substring)-42 1768 y(of)j(the)g(\014rst)g(one,)f(then)i
2607Fm(strfind)e Fo(returns)h Fl(nil)p Fo(.)j(A)e(third)e(optional)g(n)o
2608(umerical)f(argumen)o(t)g(sp)q(eci\014es)j(where)f(to)-42
26091824 y(start)f(the)i(searc)o(h.)j(Another)d(optional)d(n)o(umerical)h
2610(argumen)o(t)f(sp)q(eci\014es)j(where)g(to)e(stop)h(it.)-42
26111944 y Fm(strlen)24 b(\(s\))-42 2030 y Fo(Receiv)o(es)16
2612b(a)f(string)f(and)i(returns)f(its)f(length.)-42 2150
2613y Fm(strsub)24 b(\(s,)f(i,)h([j]\))-42 2236 y Fo(Returns)17
2614b(another)f(string,)f(whic)o(h)h(is)g(a)g(substring)g(of)g
2615Fm(s)p Fo(,)g(starting)e(at)i Fm(i)g Fo(and)g(runing)g(un)o(til)g
2616Fm(j)p Fo(.)23 b(If)16 b Fm(j)g Fo(is)g(absen)o(t,)-42
26172292 y(it)f(is)g(assumed)g(to)f(b)q(e)i(equal)g(to)e(the)i(length)f(of)
2618g Fm(s)p Fo(.)20 b(P)o(articularly)l(,)13 b(the)j(call)e
2619Fm(strsub\(s,1,j\))g Fo(returns)h(a)g(pre\014x)-42 2349
2620y(of)g Fm(s)g Fo(with)g(length)g Fm(j)p Fo(,)f(while)h(the)g(call)g
2621Fm(strsub\(s,i\))e Fo(returns)i(a)g(su\016x)g(of)g Fm(s)p
2622Fo(,)g(starting)e(at)i Fm(i)p Fo(.)-42 2469 y Fm(strlower)23
2623b(\(s\))-42 2555 y Fo(Receiv)o(es)14 b(a)e(string)g(and)h(returns)f(a)h
2624(cop)o(y)f(of)h(that)f(string)f(with)h(all)g(upp)q(er)i(case)f(letters)
2625e(c)o(hanged)i(to)f(lo)o(w)o(er)g(case.)-42 2611 y(All)j(other)g(c)o
2626(haracters)f(are)h(left)g(unc)o(hanged.)911 2748 y(18)p
2627eop
2628%%Page: 19 19
262919 18 bop -42 199 a Fm(strupper)23 b(\(s\))-42 285 y
2630Fo(Receiv)o(es)14 b(a)e(string)g(and)h(returns)f(a)h(cop)o(y)f(of)h
2631(that)f(string)f(with)h(all)g(lo)o(w)o(er)f(case)i(letters)f(c)o
2632(hanged)h(to)f(upp)q(er)i(case.)-42 342 y(All)h(other)g(c)o(haracters)f
2633(are)h(left)g(unc)o(hanged.)-42 462 y Fm(ascii)24 b(\(s,)f([i]\))-42
2634547 y Fo(Returns)16 b(the)f(ascii)g(co)q(de)h(of)e(the)i(c)o(haracter)e
2635Fm(s[i])p Fo(.)19 b(If)d Fm(i)f Fo(is)g(absen)o(t,)f(it)h(is)f(assumed)
2636h(to)f(b)q(e)i(1.)-42 667 y Fm(format)24 b(\(formatstring,)d(e1,)j(e2,)
2637f(...\))-42 753 y Fo(This)14 b(function)f(returns)g(a)h(formated)d(v)o
2638(ersion)i(of)g(its)g(v)m(ariable)g(n)o(um)o(b)q(er)f(of)i(argumen)o(ts)
2639d(follo)o(wing)g(the)j(descrip-)-42 810 y(tion)h(giv)o(en)f(in)h(its)f
2640(\014rst)g(argumen)o(t)f(\(whic)o(h)h(m)o(ust)g(b)q(e)h(a)g(string\).)j
2641(The)d(format)e(string)g(follo)o(ws)g(the)i(same)f(rules)-42
2642866 y(as)g(the)h Fm(printf)e Fo(family)f(of)i(standard)g(C)g
2643(functions.)19 b(The)c(only)f(di\013erencies)g(are)g(that)f(the)i
2644(options/mo)q(di\014ers)-42 923 y Fm(*)p Fo(,)f Fm(l)p
2645Fo(,)g Fm(L)p Fo(,)f Fm(n)p Fo(,)h Fm(p)p Fo(,)g(and)g
2646Fm(h)g Fo(are)f(not)h(supp)q(orted,)g(and)g(there)g(is)g(an)g(extra)f
2647(option,)g Fm(q)p Fo(.)19 b(This)14 b(option)f(formats)f(a)h(string)-42
2648979 y(in)19 b(a)f(form)f(suitable)h(to)g(b)q(e)i(safely)e(read)g(bac)o
2649(k)h(b)o(y)f(the)h(Lua)g(in)o(terpreter.)30 b(The)19
2650b(string)e(is)h(written)g(b)q(et)o(w)o(een)-42 1036 y(double)g(quotes,)
2651f(and)h(all)e(double)i(quotes,)f(returns)g(and)g(bac)o(kslashes)g(in)g
2652(the)h(string)e(are)h(correctly)f(escap)q(ed)-42 1092
2653y(when)g(written.)29 1148 y(The)k(options)e Fm(c)p Fo(,)i
2654Fm(d)p Fo(,)g Fm(E)p Fo(,)e Fm(e)p Fo(,)i Fm(f)p Fo(,)g
2655Fm(g)f(i)p Fo(,)h Fm(o)p Fo(,)g Fm(u)p Fo(,)g Fm(X)p
2656Fo(,)e(and)i Fm(x)f Fo(all)f(exp)q(ect)i(a)f(n)o(um)o(b)q(er)g(argumen)
2657o(t,)f(while)h Fm(q)g Fo(and)h Fm(s)-42 1205 y Fo(exp)q(ects)c(a)f
2658(string.)-42 1327 y Fe(6.3)56 b(Mathematical)20 b(F)-5
2659b(unctions)-42 1412 y Fo(This)13 b(library)f(is)h(an)g(in)o(terface)f
2660(to)h(some)e(functions)i(of)g(the)g(standard)g(C)g(math)e(library)l(.)
266119 b(Moreo)o(v)o(er,)11 b(it)i(registers)-42 1469 y(a)i(fallbac)o(k)f
2662(for)h(the)g(binary)g(op)q(erator)f Fm(^)h Fo(whic)o(h,)g(when)h
2663(applied)f(to)f(n)o(um)o(b)q(ers)h Fm(x^y)p Fo(,)f(returns)h
2664Fd(x)1619 1452 y Fc(y)1640 1469 y Fo(.)29 1525 y(The)g(library)f(pro)o
2665(vides)h(the)g(follo)o(wing)e(functions:)-42 1619 y Fm(abs)24
2666b(acos)f(asin)h(atan)f(atan2)g(ceil)g(cos)h(floor)f(log)g(log10)-42
26671676 y(max)h(min)47 b(mod)h(sin)f(sqrt)23 b(tan)h(random)f(randomseed)
2668-42 1769 y Fo(Most)17 b(of)g(them)g(are)g(only)g(in)o(terfaces)g(to)g
2669(the)g(homon)o(ymous)e(functions)j(in)f(the)h(C)f(library)l(,)g(except)
2670h(that,)f(for)-42 1826 y(the)f(trigonometri)o(c)d(functions,)h(all)h
2671(angles)f(are)h(expressed)h(in)f(degrees.)29 1882 y(The)d(function)f
2672Fm(max)g Fo(returns)g(the)g(maxim)o(um)d(v)m(alue)j(of)g(its)f(n)o
2673(umeric)h(argumen)o(ts.)16 b(Similarly)l(,)9 b Fm(min)i
2674Fo(computes)-42 1939 y(the)16 b(minim)o(um)o(.)h(Both)e(can)g(b)q(e)h
2675(used)g(with)e(an)h(unlimited)f(n)o(um)o(b)q(er)g(of)h(argumen)o(ts.)29
26761995 y(The)g(function)h Fm(mod)e Fo(is)h(equiv)m(alen)o(t)g(to)f(the)i
2677Fm(\045)f Fo(op)q(erator)f(in)h(C.)29 2052 y(The)f(functions)g
2678Fm(random)f Fo(and)h Fm(randomseed)f Fo(are)h(in)o(terfaces)f(to)g(the)
2679h(simple)f(random)g(generator)g(functions)-42 2108 y
2680Fm(rand)18 b Fo(and)h Fm(srand)p Fo(,)f(pro)o(vided)g(b)o(y)g(ANSI)h
2681(C.)f(The)h(function)f Fm(random)f Fo(returns)h(pseudo-random)g(n)o(um)
2682o(b)q(ers)g(in)-42 2165 y(the)e(range)f([0)p Fd(;)8 b
2683Fo(1\).)-42 2286 y Fe(6.4)56 b(I/O)19 b(F)-5 b(acilities)-42
26842372 y Fo(All)20 b(I/O)g(op)q(erations)f(in)h(Lua)g(are)f(done)i(o)o(v)
2685o(er)e(t)o(w)o(o)f Fn(curr)n(ent)i Fo(\014les,)g(one)g(for)g(reading)f
2686(and)h(one)g(for)f(writing.)-42 2429 y(Initially)l(,)14
2687b(the)h(curren)o(t)g(input)h(\014le)f(is)g Fm(stdin)p
2688Fo(,)f(and)h(the)g(curren)o(t)g(output)g(\014le)h(is)e
2689Fm(stdout)p Fo(.)29 2485 y(Unless)h(otherwise)g(stated,)f(all)g(I/O)i
2690(functions)f(return)g(1)g(on)g(success)h(and)f Fl(nil)f
2691Fo(on)h(failure.)911 2748 y(19)p eop
2692%%Page: 20 20
269320 19 bop -42 199 a Fm(readfrom)23 b(\(filename\))-42
2694285 y Fo(This)e(function)g(op)q(ens)g(a)g(\014le)g(named)f
2695Fm(filename)g Fo(and)h(sets)g(it)f(as)h(the)g Fn(curr)n(ent)f
2696Fo(input)h(\014le.)38 b(When)21 b(called)-42 342 y(without)c
2697(parameters,)e(this)i(function)g(closes)f(the)i(curren)o(t)f(input)g
2698(\014le,)g(and)h(restores)e Fm(stdin)h Fo(as)f(the)i(curren)o(t)-42
2699398 y(input)e(\014le.)29 454 y Fn(System)f(dep)n(endent:)k
2700Fo(if)13 b Fm(filename)h Fo(starts)e(with)i(a)g Fm(|)p
2701Fo(,)g(then)g(a)g(pip)q(ed)h(input)g(is)e(op)q(en,)i(via)e(function)i
2702Fm(popen)p Fo(.)-42 574 y Fm(writeto)23 b(\(filename\))-42
2703660 y Fo(This)d(function)g(op)q(ens)g(a)f(\014le)h(named)f
2704Fm(filename)g Fo(and)h(sets)g(it)f(as)g(the)h Fn(curr)n(ent)g
2705Fo(output)f(\014le.)34 b(Notice)20 b(that,)-42 717 y(if)g(the)g(\014le)
2706f(already)h(exists,)f(it)h(will)e(b)q(e)i Fn(c)n(ompletely)g(er)n(ase)n
2707(d)g Fo(with)f(this)g(op)q(eration.)33 b(When)20 b(called)f(without)-42
2708773 y(parameters,)13 b(this)i(function)g(closes)f(the)h(curren)o(t)g
2709(output)g(\014le,)g(and)g(restores)f Fm(stdout)g Fo(as)h(the)g(curren)o
2710(t)g(output)-42 829 y(\014le.)29 886 y Fn(System)e(dep)n(endent:)18
2711b Fo(if)12 b Fm(filename)f Fo(starts)g(with)h(a)g Fm(|)p
2712Fo(,)g(then)h(a)f(pip)q(ed)h(output)g(is)e(op)q(en,)j(via)d(function)i
2713Fm(popen)p Fo(.)-42 1006 y Fm(appendto)23 b(\(filename\))-42
27141091 y Fo(This)11 b(function)g(op)q(ens)h(a)f(\014le)g(named)f
2715Fm(filename)g Fo(and)i(sets)f(it)f(as)h(the)g Fn(curr)n(ent)g
2716Fo(output)g(\014le.)19 b(Unlik)o(e)10 b(the)h Fm(writeto)-42
27171148 y Fo(op)q(eration,)k(this)f(function)h(do)q(es)h(not)f(erase)g(an)
2718o(y)f(previous)h(con)o(ten)o(t)g(of)g(the)g(\014le.)-42
27191268 y Fm(remove)24 b(\(filename\))-42 1354 y Fo(This)15
2720b(function)g(deletes)h(the)f(\014le)g(with)g(the)g(giv)o(en)g(name.)-42
27211473 y Fm(rename)24 b(\(name1,)e(name2\))-42 1559 y Fo(This)15
2722b(function)g(renames)f(\014le)i Fm(name1)e Fo(to)h Fm(name2)p
2723Fo(.)-42 1679 y Fm(tmpname)23 b(\(\))-42 1765 y Fo(This)15
2724b(function)g(returns)g(a)g(string)f(with)h(a)g(\014le)g(name)f(that)h
2725(can)g(safely)g(b)q(e)g(used)h(for)f(a)g(temp)q(orary)e(\014le.)-42
27261885 y Fm(read)24 b(\([format]\))-42 1970 y Fo(This)17
2727b(function)g(returns)f(a)h(v)m(alue)g(read)g(from)e(the)i(curren)o(t)g
2728(input.)25 b(An)17 b(optional)f(string)g(argumen)o(t)f(sp)q(eci\014es)
2729-42 2027 y(the)h(w)o(a)o(y)e(the)h(input)g(is)g(in)o(terpreted.)29
27302083 y(Without)d(a)h(format)d(argumen)o(t,)h Fm(read)i
2731Fo(\014rst)f(skips)h(blanks,)g(tabs)f(and)h(newlines.)19
2732b(Then)14 b(it)e(c)o(hec)o(ks)h(whether)-42 2140 y(the)h(curren)o(t)f
2733(c)o(haracter)f(is)h Fm(")g Fo(or)f Fm(')p Fo(.)19 b(If)14
2734b(so,)e(it)h(reads)g(a)f(string)g(up)i(to)f(the)g(ending)g(quotation)f
2735(mark,)f(and)j(returns)-42 2196 y(this)h(string,)f(without)g(the)h
2736(quotation)f(marks.)k(Otherwise)d(it)g(reads)g(up)h(to)e(a)h(blank,)g
2737(tab)f(or)h(newline.)29 2253 y(The)g(format)e(string)i(can)g(ha)o(v)o
2738(e)g(the)g(follo)o(wing)e(format:)30 2345 y Fm(?[n])-42
27392438 y Fo(where)j Fm(?)f Fo(can)g(b)q(e:)-42 2530 y Fl('s')i(or)g('S')k
2740Fo(to)15 b(read)g(a)g(string;)-42 2623 y Fl('f)5 b(')17
2741b(or)g('F')22 b Fo(to)14 b(read)h(a)g(real)g(n)o(um)o(b)q(er;)911
27422748 y(20)p eop
2743%%Page: 21 21
274421 20 bop -42 199 a Fl('i')16 b(or)i('I')j Fo(to)15 b(read)g(an)g(in)o
2745(teger.)-42 293 y(The)e(optional)e Fm(n)h Fo(is)g(a)g(n)o(um)o(b)q(er)g
2746(whic)o(h)g(sp)q(eci\014es)h(ho)o(w)f(man)o(y)f(c)o(haracters)h(m)o
2747(ust)e(b)q(e)j(read)g(to)e(comp)q(ose)h(the)g(input)-42
2748350 y(v)m(alue.)21 b(P)o(articularly)l(,)12 b(the)k(format)c
2749Fm("s1")j Fo(reads)g(a)g(single)g(c)o(haracter.)-42 470
2750y Fm(readuntil)23 b(\(char\))-42 555 y Fo(Reads)f(the)f(curren)o(t)f
2751(input)h(un)o(til)f(the)h(\014rst)f(o)q(currence)i(of)e(the)h(giv)o(en)
2752f(c)o(haracter.)36 b(When)21 b(called)f(with)h(no)-42
2753612 y(parameters,)16 b(reads)h(un)o(til)f(the)h(end)h(of)e(the)h
2754(curren)o(t)g(input)g(\014le.)26 b(Returns)17 b(the)h(string)e(read.)25
2755b(The)17 b(c)o(haracter)-42 668 y(itself)e(is)f(not)h(read.)-42
2756788 y Fm(write)24 b(\(value,)f([format]\))-42 874 y Fo(This)d(function)
2757g(writes)f(the)i(v)m(alue)f(of)g(its)f(\014rst)h(argumen)o(t)e(to)i
2758(the)g(curren)o(t)g(output.)35 b(An)20 b(optional)f(second)-42
2759931 y(argumen)o(t)13 b(sp)q(eci\014es)i(the)f(format)e(to)i(b)q(e)h
2760(used.)20 b(This)14 b(format)e(is)i(giv)o(en)f(as)h(a)g(string,)f(comp)
2761q(osed)h(of)g(four)f(parts.)-42 987 y(The)j(\014rst)f(part)f(is)h(the)g
2762(only)g(one)g(not)g(optional,)f(and)h(m)o(ust)f(b)q(e)i(one)f(of)g(the)
2763g(follo)o(wing)e(c)o(haracters:)-42 1081 y Fl('s')k(or)g('S')k
2764Fo(to)15 b(write)f(strings;)-42 1175 y Fl('f)5 b(')17
2765b(or)g('F')22 b Fo(to)14 b(write)g(\015oats;)-42 1269
2766y Fl('i')i(or)i('I')j Fo(to)15 b(write)f(in)o(tegers;)-42
27671362 y Fl('q')j(or)g('Q')22 b Fo(to)17 b(write)g(quoted)g(strings.)27
2768b(This)17 b(format)e(writes)i(the)h(string)f(in)g(a)h(form)e(suitable)h
2769(to)g(b)q(e)h(safely)72 1419 y(read)13 b(bac)o(k)f(b)o(y)h(the)g(Lua)g
2770(in)o(terpreter.)18 b(The)13 b(string)e(is)i(written)e(b)q(et)o(w)o
2771(een)i(double)g(quotes,)g(and)g(all)e(double)72 1475
2772y(quotes,)k(returns)g(and)g(bac)o(kslashes)g(in)g(the)g(string)f(are)h
2773(correctly)g(escap)q(ed)h(when)f(written.)-42 1569 y(These)h(c)o
2774(haracters)e(can)i(b)q(e)g(follo)o(w)o(ed)d(b)o(y)30
27751663 y Fm([?][m][.n])-42 1757 y Fo(where:)-42 1851 y
2776Fm(?)23 b Fo(indicates)15 b(justi\014cation)f(inside)h(the)g(\014eld.)
2777100 1944 y(')p Fm(<)p Fo(')22 b(righ)o(t)14 b(justi\014cation)g
2778(\(default\);)100 2017 y(')p Fm(>)p Fo(')22 b(left)15
2779b(justi\014cation;)100 2090 y(')p Fm(|)p Fo(')22 b(cen)o(ter)15
2780b(justi\014cation.)-42 2184 y Fm(m)23 b Fo(Indicates)16
2781b(the)f(\014eld)g(size)g(in)g(c)o(haracters.)-42 2278
2782y Fm(.n)23 b Fo(F)l(or)18 b(reals,)h(indicates)f(the)h(n)o(um)o(b)q(er)
2783f(of)g(digital)f(places.)31 b(F)l(or)18 b(in)o(tegers,)h(it)f(is)g(the)
2784h(minim)o(um)c(n)o(um)o(b)q(er)j(of)72 2335 y(digits.)h(This)c(option)f
2785(has)h(no)g(meaning)f(for)h(strings.)29 2428 y(When)20
2786b(called)e(without)g(a)h(format)e(string,)i(this)f(function)h(writes)f
2787(n)o(um)o(b)q(ers)h(using)f(the)i Fm(\045g)e Fo(format)f(and)-42
27882485 y(strings)e(with)f Fm(\045s)p Fo(.)20 b(F)l(or)14
2789b(b)q(etter)h(format)e(facilities,)g(the)j(function)f
2790Fm(format)f Fo(should)h(b)q(e)h(used)g(\(see)f(Section)g(6.2\).)911
27912748 y(21)p eop
2792%%Page: 22 22
279322 21 bop -42 199 a Fm(date)24 b(\([format]\))-42 285
2794y Fo(This)19 b(function)f(returns)h(a)f(string)g(con)o(taining)f(date)h
2795(and)h(time)e(formatted)g(according)h(to)g(the)g(giv)o(en)g(string)-42
2796342 y Fm(format)p Fo(,)g(follo)o(wing)e(the)i(same)f(rules)h(of)f(the)i
2797(ANSI)f(C)g(function)g Fm(strftime)p Fo(.)28 b(When)18
2798b(called)g(without)f(argu-)-42 398 y(men)o(ts,)d(it)g(returns)h(a)g
2799(reasonable)g(date)g(and)g(time)f(represen)o(tation.)29
2800454 y(This)h(function)g(replaces)g(functions)g Fm(date)g
2801Fo(and)g Fm(time)g Fo(from)e(previous)i(Lua)g(v)o(ersions.)-42
2802574 y Fm(exit)24 b(\([code]\))-42 660 y Fo(This)15 b(function)g(calls)g
2803(the)g(C)g(function)g Fm(exit)p Fo(,)f(with)h(an)g(optional)f
2804Fm(code)p Fo(,)g(to)g(terminate)g(the)h(program.)-42
2805804 y Fp(7)67 b(The)23 b(Debuger)f(In)n(terface)-42 905
2806y Fo(Lua)c(has)e(no)h(built)f(in)g(debuger)i(facilities.)k(Instead,)17
2807b(it)f(o\013ers)g(a)h(sp)q(ecial)f(in)o(terface,)g(b)o(y)h(means)e(of)i
2808(functions)-42 961 y(and)12 b Fn(ho)n(oks)p Fo(,)g(whic)o(h)f(allo)o
2809(ws)f(the)i(construction)e(of)h(di\013eren)o(t)g(kinds)h(of)f
2810(debugers,)h(pro\014les,)g(and)g(other)f(to)q(ols)f(that)-42
28111018 y(need)17 b(\\inside")d(information)e(from)i(the)h(in)o
2812(terpreter.)k(This)c(in)o(terface)f(is)h(declared)h(in)f(the)g(\014le)g
2813Fm(luadebug.h)p Fo(.)-42 1140 y Fe(7.1)56 b(Stac)n(k)19
2814b(and)g(F)-5 b(unction)20 b(Information)-42 1225 y Fo(The)c(main)e
2815(function)h(to)f(get)h(information)d(ab)q(out)j(the)h(in)o(terpreter)e
2816(stac)o(k)g(is)-42 1319 y Fm(lua_Function)23 b(lua_stackedfunction)e
2817(\(int)i(level\);)-42 1413 y Fo(It)18 b(returns)f(a)g(handle)h(\()p
2818Fm(lua_Function)p Fo(\))d(to)h(the)i Fn(activation)g(r)n(e)n(c)n(or)n
2819(d)j Fo(of)c(the)h(function)f(executing)g(at)g(a)g(giv)o(en)-42
28201470 y(lev)o(el.)34 b(Lev)o(el)20 b(0)f(is)h(the)g(curren)o(t)f
2821(running)h(function,)h(while)e(lev)o(el)g Fd(n)14 b Fo(+)f(1)20
2822b(is)f(the)h(function)g(that)f(has)h(called)-42 1526
2823y(lev)o(el)g Fd(n)p Fo(.)34 b(When)21 b(called)e(with)h(a)f(lev)o(el)h
2824(greater)f(than)h(the)g(stac)o(k)f(depth,)i Fm(lua_stackedfunction)d
2825Fo(returns)-42 1582 y Fm(LUA_NOOBJECT)p Fo(.)29 1639
2826y(The)k(t)o(yp)q(e)f Fm(lua_Function)f Fo(is)h(just)g(another)g(name)g
2827(to)g Fm(lua_Object)p Fo(.)37 b(Although,)22 b(in)f(this)g(library)l(,)
2828h(a)-42 1695 y Fm(lua_Function)12 b Fo(can)i(b)q(e)g(used)g(wherev)o
2829(er)f(a)g Fm(lua_Object)f Fo(is)h(required,)g(a)g(parameter)f
2830Fm(lua_Function)f Fo(accepts)-42 1752 y(only)k(a)g(handle)h(returned)f
2831(b)o(y)g Fm(lua_stackedfunction)p Fo(.)29 1808 y(Three)g(other)g
2832(functions)g(pro)q(duce)h(extra)f(information)d(ab)q(out)j(a)g
2833(function:)-42 1902 y Fm(void)24 b(lua_funcinfo)e(\(lua_Object)g(func,)
2834i(char)f(**filename,)f(int)i(*linedefined\);)-42 1959
2835y(int)g(lua_currentline)e(\(lua_Function)g(func\);)-42
28362015 y(char)i(*lua_getobjname)e(\(lua_Object)g(o,)i(char)f(**name\);)
2837-42 2109 y(lua_funcinfo)16 b Fo(giv)o(es)g(the)h(\014le)g(name)g(and)g
2838(the)g(line)g(where)g(the)g(giv)o(en)g(function)g(has)g(b)q(een)h
2839(de\014ned.)27 b(If)17 b(the)-42 2165 y(\\function")f(is)f(in)h(fact)g
2840(the)g(main)f(co)q(de)h(of)g(a)g(c)o(h)o(unk,)g Fm(linedefined)f
2841Fo(is)g(0.)22 b(If)17 b(the)f(function)g(is)f(a)h(C)g(function,)-42
28422222 y Fm(linedefined)e Fo(is)h(-1,)g(and)g Fm(filename)f
2843Fo(is)h Fm("\(C\)")p Fo(.)29 2278 y(The)j(function)f
2844Fm(lua_currentline)f Fo(giv)o(es)g(the)i(curren)o(t)f(line)g(where)h(a)
2845f(giv)o(en)g(function)h(is)f(executing.)26 b(It)-42 2335
2846y(only)16 b(w)o(orks)e(if)h(the)g(function)h(has)f(b)q(een)i
2847(pre-compiled)d(with)h(debug)h(information)d(\(see)i(Section)h(4.8\).)j
2848(When)-42 2391 y(no)d(line)e(information)f(is)i(a)o(v)m(ailable,)e(it)h
2849(returns)i(-1.)29 2448 y(F)l(unction)g Fm(lua_getobjname)e
2850Fo(tries)i(to)f(\014nd)i(a)f(reasonable)g(name)f(for)h(a)f(giv)o(en)h
2851(function.)23 b(Because)17 b(func-)-42 2504 y(tions)11
2852b(in)g(Lua)g(are)g(\014rst)g(class)f(v)m(alues,)i(they)f(do)g(not)g(ha)
2853o(v)o(e)g(a)g(\014xed)g(name.)18 b(Some)10 b(functions)h(ma)o(y)e(b)q
2854(e)j(the)g(v)m(alue)f(of)-42 2560 y(man)o(y)j(global)f(v)m(ariables,)h
2855(while)g(others)h(ma)o(y)e(b)q(e)i(stored)f(only)h(in)f(a)h(table)f
2856(\014eld.)20 b(F)l(unction)14 b Fm(lua_getobjname)-42
28572617 y Fo(\014rst)j(c)o(hec)o(ks)g(whether)h(the)f(giv)o(en)f(function)
2858h(is)g(a)f(fallbac)o(k.)24 b(If)18 b(so,)e(it)h(returns)f(the)i(string)
2859e Fm("fallback")p Fo(,)f(and)911 2748 y(22)p eop
2860%%Page: 23 23
286123 22 bop -42 199 a Fm(name)16 b Fo(is)f(set)h(to)f(p)q(oin)o(t)g(to)g
2862(the)h(fallbac)o(k)f(name.)21 b(Otherwise,)15 b(if)h(the)f(giv)o(en)h
2863(function)g(is)f(the)h(v)m(alue)g(of)f(a)h(global)-42
2864256 y(v)m(ariable,)e Fm(lua_getobjname)f Fo(returns)i(the)g(string)e
2865Fm("global")p Fo(,)h(while)g Fm(name)g Fo(p)q(oin)o(ts)g(to)g(the)h(v)m
2866(ariable)f(name.)19 b(If)-42 312 y(the)f(giv)o(en)e(function)h(is)f
2867(neither)h(a)g(fallbac)o(k)f(nor)g(a)h(global)e(v)m(ariable,)i
2868Fm(lua_getobjname)e Fo(returns)i(the)g(empt)o(y)-42 369
2869y(string,)d(and)i Fm(name)e Fo(is)h(set)g(to)f Fm(NULL)p
2870Fo(.)-42 487 y Fe(7.2)56 b(Manipulating)22 b(Lo)r(cal)c(V)-5
2871b(ariables)-42 573 y Fo(The)17 b(follo)o(wing)d(functions)i(allo)o(w)e
2872(the)i(manipulation)e(of)i(the)g(lo)q(cal)f(v)m(ariables)h(of)g(a)f
2873(giv)o(en)h(activ)m(ation)f(record.)-42 629 y(They)h(only)f(w)o(ork)f
2874(if)h(the)g(function)g(has)g(b)q(een)h(pre-compiled)f(with)f(debug)i
2875(information)c(\(see)j(Section)h(4.8\).)-42 706 y Fm(lua_Object)23
2876b(lua_getlocal)f(\(lua_Function)g(func,)h(int)h(local_number,)e(char)h
2877(**name\);)-42 762 y(int)h(lua_setlocal)e(\(lua_Function)g(func,)h(int)
2878h(local_number\);)-42 839 y Fo(The)19 b(\014rst)f(one)h(returns)g(the)f
2879(v)m(alue)h(of)f(a)g(lo)q(cal)g(v)m(ariable,)g(and)h(sets)f
2880Fm(name)g Fo(to)g(p)q(oin)o(t)g(to)g(the)h(v)m(ariable)f(name.)-42
2881895 y Fm(local_number)f Fo(is)i(an)f(index)h(for)f(lo)q(cal)g(v)m
2882(ariables.)29 b(The)19 b(\014rst)f(parameter)f(has)i(index)f(1,)h(and)g
2883(so)f(on,)h(un)o(til)-42 952 y(the)k(last)e(activ)o(e)h(lo)q(cal)f(v)m
2884(ariable.)40 b(When)23 b(called)f(with)g(a)g Fm(local_number)e
2885Fo(greater)i(than)g(the)g(n)o(um)o(b)q(er)g(of)-42 1008
2886y(activ)o(e)15 b(lo)q(cal)g(v)m(ariables,)f(or)h(if)g(the)h(activ)m
2887(ation)e(record)h(has)h(no)f(debug)h(information,)d Fm(lua_getlocal)h
2888Fo(returns)-42 1065 y Fm(LUA_NOOBJECT)p Fo(.)29 1121
2889y(The)d(function)h Fm(lua_setlocal)d Fo(sets)i(the)g(lo)q(cal)f(v)m
2890(ariable)h Fm(local_number)f Fo(to)g(the)h(v)m(alue)h(previously)e
2891(pushed)-42 1178 y(on)19 b(the)f(stac)o(k)f(\(see)h(Section)g(5.2\).)28
2892b(If)18 b(the)h(function)f(succeeds)h(it)e(returns)h(1.)29
2893b(If)18 b Fm(local_number)f Fo(is)g(greater)-42 1234
2894y(than)d(the)f(n)o(um)o(b)q(er)g(of)g(activ)o(e)g(lo)q(cal)f(v)m
2895(ariables,)h(or)g(if)g(the)g(activ)m(ation)f(record)i(has)f(no)g(debug)
2896h(information,)d(this)-42 1291 y(function)16 b(fails)d(and)j(returns)f
2897(0.)-42 1409 y Fe(7.3)56 b(Ho)r(oks)-42 1495 y Fo(The)16
2898b(Lua)f(in)o(terpreter)g(o\013ers)f(t)o(w)o(o)g(ho)q(oks)h(for)g(debug)
2899g(purp)q(oses:)-42 1572 y Fm(typedef)23 b(void)h(\(*lua_CHFunction\))d
2900(\(lua_Function)h(func,)i(char)f(*file,)g(int)g(line\);)-42
29011628 y(extern)h(lua_CHFunction)d(lua_callhook;)-42 1741
2902y(typedef)i(void)h(\(*lua_LHFunction\))d(\(int)j(line\);)-42
29031797 y(extern)g(lua_LHFunction)d(lua_linehook;)-42 1874
2904y Fo(The)i(\014rst)f(one)g(is)f(called)h(whenev)o(er)h(the)f(in)o
2905(terpreter)f(en)o(ters)h(or)f(lea)o(v)o(es)h(a)f(function.)41
2906b(When)22 b(en)o(tering)g(a)-42 1930 y(function,)c(its)f(parameters)f
2907(are)h(a)h(handle)g(to)f(the)g(function)h(activ)m(ation)e(record,)i
2908(plus)g(the)f(\014le)h(and)g(the)g(line)-42 1987 y(where)h(the)g
2909(function)f(is)g(de\014ned)h(\(the)f(same)f(information)f(whic)o(h)i
2910(is)g(pro)o(vided)g(b)o(y)g Fm(lua_funcinfo)p Fo(\);)g(when)-42
29112043 y(lea)o(ving)d(a)f(function,)h Fm(func)g Fo(is)f
2912Fm(LUA_NOOBJECT)p Fo(,)g Fm(file)g Fo(is)h Fm("\(return\)")p
2913Fo(,)e(and)j Fm(line)e Fo(is)h(0.)29 2100 y(The)24 b(other)f(ho)q(ok)g
2914(is)g(called)g(ev)o(ery)g(time)f(the)h(in)o(terpreter)g(c)o(hanges)g
2915(the)g(line)g(of)g(co)q(de)h(it)f(is)g(execut-)-42 2156
2916y(ing.)31 b(Its)19 b(only)g(parameter)e(is)i(the)g(line)f(n)o(um)o(b)q
2917(er)h(\(the)f(same)g(information)e(whic)o(h)j(is)g(pro)o(vided)f(b)o(y)
2918h(the)g(call)-42 2213 y Fm(lua_currentline\(lua_stackedfun)o(ction\(0)o
2919(\)\))p Fo(\).)d(This)d(second)h(ho)q(ok)f(is)g(only)f(called)h(if)g
2920(the)g(activ)o(e)g(func-)-42 2269 y(tion)i(has)g(b)q(een)h
2921(pre-compiled)f(with)f(debug)i(information)c(\(see)k(Section)f(4.8\).)
292229 2326 y(A)g(ho)q(ok)g(is)g(disabled)g(when)h(its)e(v)m(alue)i(is)e
2923(NULL)i(\(0\),)e(whic)o(h)h(is)g(the)g(initial)f(v)m(alue)h(of)g(b)q
2924(oth)g(ho)q(oks.)-42 2466 y Fp(8)67 b(Some)22 b(Examples)-42
29252567 y Fo(This)17 b(section)f(giv)o(es)g(examples)g(sho)o(wing)g(some)g
2926(features)g(of)h(Lua.)25 b(It)17 b(do)q(es)g(not)g(in)o(tend)f(to)h(co)
2927o(v)o(er)f(the)h(whole)-42 2623 y(language,)e(but)g(only)g(to)f
2928(illustrate)f(some)h(in)o(teresting)g(uses)i(of)e(the)i(system.)911
29292748 y(23)p eop
2930%%Page: 24 24
293124 23 bop -42 199 a Fe(8.1)56 b(Data)19 b(Structures)-42
2932285 y Fo(T)l(ables)c(are)f(a)g(strong)f(unifying)h(data)g(constructor.)
293319 b(They)c(directly)f(implemen)o(t)d(a)j(m)o(ultitude)f(of)h(data)g(t)
2934o(yp)q(es,)-42 342 y(lik)o(e)h(ordinary)f(arra)o(ys,)g(records,)g
2935(sets,)h(bags,)f(and)i(lists.)29 398 y(Arra)o(ys)e(need)h(no)g
2936(explanations.)k(In)c(Lua,)g(it)e(is)i(con)o(v)o(en)o(tional)e(to)h
2937(start)f(indices)i(from)e(1,)h(but)h(this)f(is)g(only)-42
2938454 y(a)f(con)o(v)o(en)o(tion.)19 b(Arra)o(ys)12 b(can)h(b)q(e)h
2939(indexed)g(b)o(y)f(0,)g(negativ)o(e)g(n)o(um)o(b)q(ers,)f(or)h(an)o(y)g
2940(other)f(v)m(alue)i(\(but)f Fl(nil)p Fo(\).)18 b(Records)-42
2941511 y(are)d(also)g(trivially)d(implemen)o(ted)h(b)o(y)i(the)h(syn)o
2942(tactic)e(sugar)g Fm(a.x)p Fo(.)29 567 y(The)j(b)q(est)g(w)o(a)o(y)f
2943(to)g(implemen)o(t)e(a)i(set)h(is)f(to)g(store)g(its)g(elemen)o(ts)g
2944(as)g(indices)h(of)f(a)h(table.)24 b(The)17 b(statemen)o(t)-42
2945624 y Fm(s)24 b(=)g({})14 b Fo(creates)h(an)f(empt)o(y)g(set)g
2946Fm(s)p Fo(.)20 b(The)15 b(statemen)o(t)d Fm(s[x])24 b(=)f(1)15
2947b Fo(inserts)f(the)h(v)m(alue)g(of)f Fm(x)h Fo(in)o(to)e(the)i(set)g
2948Fm(s)p Fo(.)k(The)-42 680 y(expression)e Fm(s[x])f Fo(is)h(true)f(if)g
2949(and)h(only)g(if)f Fm(x)h Fo(b)q(elongs)f(to)g Fm(s)p
2950Fo(.)25 b(Finally)l(,)15 b(the)i(statemen)o(t)e Fm(s[x])23
2951b(=)h(nil)16 b Fo(erases)h Fm(x)-42 737 y Fo(from)d Fm(s)p
2952Fo(.)29 793 y(Bags)h(can)h(b)q(e)g(implemen)o(ted)e(similarl)o(y)f(to)i
2953(sets,)g(but)h(using)f(the)h(v)m(alue)f(asso)q(ciated)g(to)g(an)h
2954(elemen)o(t)e(as)h(its)-42 850 y(coun)o(ter.)20 b(So,)15
2955b(to)f(insert)h(an)g(elemen)o(t,)f(the)h(follo)o(wing)e(co)q(de)j(is)f
2956(enough:)-42 943 y Fm(if)24 b(s[x])f(then)h(s[x])f(=)h(s[x]+1)-42
29571000 y(else)g(s[x])f(=)h(1)g(end)-42 1094 y Fo(and)16
2958b(to)e(remo)o(v)o(e)g(an)h(elemen)o(t:)-42 1188 y Fm(if)24
2959b(s[x])f(then)h(s[x])f(=)h(s[x]-1)f(end)-42 1244 y(if)h(s[x])f(==)h(0)g
2960(then)f(s[x])g(=)h(nil)g(end)29 1338 y Fo(Lisp-lik)o(e)d(lists)f(also)g
2961(ha)o(v)o(e)h(an)g(easy)g(implemen)o(tatio)o(n.)36 b(The)21
2962b(\\cons")g(of)g(t)o(w)o(o)f(elemen)o(ts)g Fm(x)h Fo(and)g
2963Fm(y)g Fo(can)-42 1394 y(b)q(e)d(created)e(with)g(the)h(co)q(de)g
2964Fm(l)23 b(=)h({car=x,)f(cdr=y})p Fo(.)g(The)17 b(expression)f
2965Fm(l.car)g Fo(extracts)g(the)g(header,)h(while)-42 1451
2966y Fm(l.cdr)d Fo(extracts)g(the)g(tail.)k(An)d(alternativ)o(e)d(w)o(a)o
2967(y)i(is)f(to)h(create)g(the)g(list)g(directly)f(with)h
2968Fm(l={x,y})p Fo(,)f(and)h(then)h(to)-42 1507 y(extract)g(the)g(header)h
2969(with)e Fm(l[1])h Fo(and)g(the)h(tail)d(with)i Fm(l[2])p
2970Fo(.)-42 1629 y Fe(8.2)56 b(The)18 b(F)-5 b(unctions)21
2971b Fb(next)c Fe(and)i Fb(nextvar)-42 1715 y Fo(This)f(example)f(sho)o
2972(ws)g(ho)o(w)h(to)f(use)i(the)f(function)g Fm(next)f
2973Fo(to)h(iterate)f(o)o(v)o(er)g(the)h(\014elds)g(of)g(a)g(table.)28
2974b(F)l(unction)-42 1771 y Fn(clone)15 b Fo(receiv)o(es)g(an)o(y)g(table)
2975f(and)i(returns)f(a)g(clone)g(of)g(it.)-42 1865 y Fm(function)23
2976b(clone)g(\(t\))263 b(--)23 b(t)h(is)f(a)h(table)6 1921
2977y(local)f(new_t)h(=)f({})263 b(--)23 b(create)g(a)h(new)f(table)6
29781978 y(local)g(i,)h(v)g(=)f(next\(t,)g(nil\))48 b(--)23
2979b(i)h(is)f(an)h(index)f(of)h(t,)f(v)h(=)g(t[i])6 2034
2980y(while)f(i)h(do)54 2091 y(new_t[i])f(=)g(v)54 2147 y(i,)h(v)f(=)h
2981(next\(t,)f(i\))191 b(--)23 b(get)h(next)f(index)6 2204
2982y(end)6 2260 y(return)g(new_t)-42 2317 y(end)29 2410
2983y Fo(The)15 b(next)h(example)e(prin)o(ts)g(the)i(names)e(of)g(all)h
2984(global)e(v)m(ariables)i(in)g(the)g(system)f(with)h(non)g(nil)g(v)m
2985(alues:)-42 2504 y Fm(function)23 b(printGlobalVariables)e(\(\))6
29862561 y(local)i(i,)h(v)g(=)f(nextvar\(nil\))6 2617 y(while)g(i)h(do)911
29872748 y Fo(24)p eop
2988%%Page: 25 25
298925 24 bop 54 199 a Fm(print\(i\))54 256 y(i,)24 b(v)f(=)h(nextvar\(i\))
29906 312 y(end)-42 369 y(end)-42 488 y Fe(8.3)56 b(String)19
2991b(Manipulation)-42 574 y Fo(The)d(\014rst)f(example)f(is)g(a)h
2992(function)g(to)g(trim)e(extra)i(blanks)g(at)f(the)h(b)q(eginning)h(and)
2993f(end)h(of)f(a)g(string.)-42 654 y Fm(function)23 b(trim\(s\))6
2994710 y(local)g(l)h(=)g(1)6 767 y(while)f(strsub\(s,l,l\))f(==)i(')g(')g
2995(do)54 823 y(l)g(=)f(l+1)6 880 y(end)6 936 y(local)g(r)h(=)g
2996(strlen\(s\))6 992 y(while)f(strsub\(s,r,r\))f(==)i(')g(')g(do)54
29971049 y(r)g(=)f(r-1)6 1105 y(end)6 1162 y(return)g(strsub\(s,l,r\))-42
29981218 y(end)29 1298 y Fo(The)15 b(second)h(example)e(sho)o(ws)h(a)g
2999(function)g(that)f(eliminates)f(all)h(blanks)h(of)g(a)g(string.)-42
30001379 y Fm(function)23 b(remove_blanks)f(\(s\))6 1435
3001y(local)h(b)h(=)g(strfind\(s,)e(')i('\))6 1492 y(while)f(b)h(do)54
30021548 y(s)g(=)f(strsub\(s,)g(1,)h(b-1\))f(..)h(strsub\(s,)e(b+1\))54
30031604 y(b)i(=)f(strfind\(s,)g(')h('\))6 1661 y(end)6 1717
3004y(return)f(s)-42 1774 y(end)-42 1893 y Fe(8.4)56 b(V)-5
3005b(ariable)21 b(n)n(um)n(b)r(er)d(of)h(argumen)n(ts)-42
30061979 y Fo(Lua)14 b(do)q(es)f(not)g(pro)o(vide)f(an)o(y)h(explicit)f
3007(mec)o(hanism)f(to)h(deal)h(with)f(v)m(ariable)h(n)o(um)o(b)q(er)f(of)h
3008(argumen)o(ts.)k(Ho)o(w)o(ev)o(er,)-42 2035 y(one)f(can)g(use)g(table)f
3009(constructors)g(to)g(sim)o(ulate)e(this)i(mec)o(hanism.)k(As)d(an)g
3010(example,)e(supp)q(ose)i(a)g(function)f(to)-42 2092 y(concatenate)g
3011(all)g(its)f(argumen)o(ts.)k(It)d(could)g(b)q(e)h(written)f(lik)o(e)-42
30122172 y Fm(function)23 b(concat)g(\(o\))6 2228 y(local)g(i)h(=)g(1)6
30132285 y(local)f(s)h(=)g('')6 2341 y(while)f(o[i])h(do)54
30142398 y(s)g(=)f(s)h(..)g(o[i])54 2454 y(i)g(=)f(i+1)6
30152511 y(end)6 2567 y(return)g(s)-42 2623 y(end)911 2748
3016y Fo(25)p eop
3017%%Page: 26 26
301826 25 bop -42 199 a Fo(T)l(o)15 b(call)g(it,)f(one)h(uses)h(a)e(table)h
3019(constructor)g(to)f(join)h(all)f(argumen)o(ts:)6 293
3020y Fm(x)24 b(=)g(concat{"hello)e(",)h("john",)g(")h(and)f(",)h("mary"})
3021-42 415 y Fe(8.5)56 b(P)n(ersistence)-42 501 y Fo(Because)21
3022b(of)e(its)g(re\015exiv)o(e)g(facilities,)g(p)q(ersistence)h(in)f(Lua)h
3023(can)g(b)q(e)g(ac)o(hiev)o(ed)g(within)f(the)g(language.)33
3024b(This)-42 557 y(section)12 b(sho)o(ws)f(some)g(w)o(a)o(ys)g(to)g
3025(store)g(and)h(retriev)o(e)f(v)m(alues)i(in)e(Lua,)i(using)f(a)f(text)h
3026(\014le)g(written)e(in)i(the)g(language)-42 614 y(itself)j(as)f(the)i
3027(storage)e(media.)29 670 y(T)l(o)h(store)f(a)h(single)g(v)m(alue)g
3028(with)g(a)g(name,)f(the)h(follo)o(wing)e(co)q(de)j(is)e(enough:)-42
3029764 y Fm(function)23 b(store)g(\(name,)g(value\))6 820
3030y(write\(format\('\\n\045s)f(=',)h(name\)\))6 877 y
3031(write_value\(value\))-42 933 y(end)-42 1039 y(function)g(write_value)g
3032(\(value\))6 1096 y(local)g(t)h(=)g(type\(value\))102
30331152 y(if)f(t)h(==)g('nil')94 b(then)24 b(write\('nil'\))6
30341209 y(elseif)f(t)h(==)g('number')e(then)i(write\(value\))6
30351265 y(elseif)f(t)h(==)g('string')e(then)i(write\(value,)e('q'\))6
30361322 y(end)-42 1378 y(end)-42 1484 y Fo(In)16 b(order)f(to)g(restore)f
3037(this)h(v)m(alue,)g(a)g Fm(lua_dofile)f Fo(su\016ces.)29
30381541 y(Storing)i(tables)h(is)g(a)g(little)e(more)h(complex.)25
3039b(Assuming)16 b(that)g(the)h(table)g(is)g(a)g(tree,)g(and)g(all)f
3040(indices)i(are)-42 1597 y(iden)o(ti\014ers)13 b(\(that)e(is,)i(the)g
3041(tables)f(are)g(b)q(eing)h(used)g(as)g(records\),)f(its)g(v)m(alue)h
3042(can)g(b)q(e)g(written)f(directly)g(with)g(table)-42
30431654 y(constructors.)19 b(First,)14 b(the)h(function)g
3044Fm(write_value)f Fo(is)h(c)o(hanged)g(to)-42 1748 y Fm(function)23
3045b(write_value)g(\(value\))6 1804 y(local)g(t)h(=)g(type\(value\))102
30461860 y(if)f(t)h(==)g('nil')94 b(then)24 b(write\('nil'\))6
30471917 y(elseif)f(t)h(==)g('number')e(then)i(write\(value\))6
30481973 y(elseif)f(t)h(==)g('string')e(then)i(write\(value,)e('q'\))6
30492030 y(elseif)h(t)h(==)g('table')46 b(then)24 b(write_record\(value\))6
30502086 y(end)-42 2143 y(end)-42 2237 y Fo(The)16 b(function)f
3051Fm(write_record)e Fo(is:)-42 2330 y Fm(function)23 b(write_record\(t\))
30526 2387 y(local)g(i,)h(v)g(=)f(next\(t,)g(nil\))6 2443
3053y(write\('{'\))47 b(--)23 b(starts)g(constructor)6 2500
3054y(while)g(i)h(do)54 2556 y(store\(i,)f(v\))54 2613 y(write\(',)g('\))
3055911 2748 y Fo(26)p eop
3056%%Page: 27 27
305727 26 bop 54 199 a Fm(i,)24 b(v)f(=)h(next\(t,)f(i\))6
3058256 y(end)6 312 y(write\('}'\))47 b(--)23 b(closes)g(constructor)-42
3059369 y(end)-42 490 y Fe(8.6)56 b(Inheritance)-42 576 y
3060Fo(The)15 b(fallbac)o(k)f(for)g(absen)o(t)g(indices)h(can)g(b)q(e)g
3061(used)g(to)f(implemen)o(t)e(man)o(y)h(kinds)i(of)f(inheritance)g(in)h
3062(Lua.)20 b(As)15 b(an)-42 632 y(example,)f(the)h(follo)o(wing)e(co)q
3063(de)j(implemen)o(ts)d(single)h(inheritance:)-42 726 y
3064Fm(function)23 b(Index)g(\(t,f\))6 782 y(if)h(f)g(==)f('parent')g(then)
306547 b(--)24 b(to)f(avoid)g(loop)54 838 y(return)g(OldIndex\(t,f\))6
3066895 y(end)6 951 y(local)g(p)h(=)g(t.parent)6 1008 y(if)g(type\(p\))f
3067(==)g('table')g(then)54 1064 y(return)g(p[f])6 1121 y(else)54
30681177 y(return)g(OldIndex\(t,f\))6 1234 y(end)-42 1290
3069y(end)-42 1403 y(OldIndex)g(=)h(setfallback\("index",)d(Index\))-42
30701496 y Fo(Whenev)o(er)15 b(Lua)g(attempts)d(to)i(access)h(an)f(absen)o
3071(t)g(\014eld)h(in)f(a)g(table,)g(it)g(calls)f(the)i(fallbac)o(k)e
3072(function)h Fm(Index)p Fo(.)19 b(If)-42 1553 y(the)14
3073b(table)e(has)h(a)g(\014eld)h Fm(parent)e Fo(with)h(a)g(table)f(v)m
3074(alue,)i(then)f(Lua)h(attempts)d(to)h(access)i(the)f(desired)g(\014eld)
3075h(in)f(this)-42 1609 y(paren)o(t)i(ob)s(ject.)k(This)c(pro)q(cess)g(is)
3076f(rep)q(eated)h(\\up)o(w)o(ards")f(un)o(til)g(a)h(v)m(alue)g(for)f(the)
3077h(\014eld)g(is)g(found)g(or)f(the)h(ob)s(ject)-42 1665
3078y(has)h(no)f(paren)o(t.)k(In)d(the)f(latter)f(case,)h(the)g(previous)g
3079(fallbac)o(k)f(is)h(called)g(to)f(supply)i(a)e(v)m(alue)i(for)e(the)i
3080(\014eld.)29 1722 y(When)e(b)q(etter)g(p)q(erformance)f(is)g(needed,)i
3081(the)f(same)e(fallbac)o(k)h(ma)o(y)f(b)q(e)i(implemen)o(ted)e(in)i(C,)f
3082(as)g(illustrated)-42 1778 y(in)j(Figure)e(1.)20 b(This)14
3083b(co)q(de)i(m)o(ust)e(b)q(e)i(registered)e(with:)6 1871
3084y Fm(lua_pushstring\("parent"\);)6 1928 y(lockedParentName)22
3085b(=)i(lua_ref\(1\);)6 1984 y(lua_pushobject\(lua_setfallba)o(ck\("ind)o
3086(ex",)d(Index\)\);)6 2041 y(lockedOldIndex)h(=)i(lua_ref\(1\);)-42
30872134 y Fo(Notice)15 b(ho)o(w)g(the)g(string)f Fm("parent")g
3088Fo(is)h(k)o(ept)g(lo)q(c)o(k)o(ed)g(in)g(Lua)h(for)e(optimal)f(p)q
3089(erformance.)-42 2255 y Fe(8.7)56 b(Programming)19 b(with)h(Classes)-42
30902341 y Fo(There)e(are)g(man)o(y)e(di\013eren)o(t)h(w)o(a)o(ys)g(to)g
3091(do)h(ob)s(ject-orien)o(ted)e(programming)e(in)k(Lua.)28
3092b(This)17 b(section)h(presen)o(ts)-42 2398 y(one)g(p)q(ossible)f(w)o(a)
3093o(y)f(to)g(implemen)o(t)f(classes,)h(using)h(the)g(inheritance)g(mec)o
3094(hanism)e(presen)o(ted)j(ab)q(o)o(v)o(e.)25 b Fn(Ple)n(ase)-42
30952454 y(notic)n(e:)20 b(the)d(fol)r(lowing)e(examples)g(only)h(work)g
3096(with)g(the)h(index)e(fal)r(lb)n(ack)g(r)n(e)n(de\014ne)n(d)g(ac)n(c)n
3097(or)n(ding)g(to)h(Se)n(ction)e(8.6)p Fo(.)29 2511 y(As)j(one)g(could)f
3098(exp)q(ect,)i(a)e(go)q(o)q(d)h(w)o(a)o(y)e(to)h(represen)o(t)h(a)f
3099(class)g(is)h(as)f(a)g(table.)24 b(This)16 b(table)g(will)g(con)o(tain)
3100g(all)-42 2567 y(instance)f(metho)q(ds)f(of)h(the)g(class,)f(plus)h(ev)
3101o(en)o(tual)f(default)h(v)m(alues)g(for)f(instance)h(v)m(ariables.)k
3102(An)c(instance)g(of)g(a)-42 2623 y(class)g(has)g(its)f
3103Fm(parent)h Fo(\014eld)g(p)q(oin)o(ting)g(to)f(the)h(class,)g(and)g(so)
3104g(it)f(\\inherits")g(all)g(metho)q(ds.)911 2748 y(27)p
3105eop
3106%%Page: 28 28
310728 27 bop -42 261 1950 6 v -42 355 a Fm(#include)23 b("lua.h")-42
3108467 y(int)h(lockedParentName;)45 b(/*)24 b(lock)f(index)g(for)h(the)f
3109(string)g("parent")g(*/)-42 524 y(int)h(lockedOldIndex;)93
3110b(/*)24 b(previous)f(fallback)f(function)h(*/)-42 637
3111y(void)h(callOldFallback)e(\(lua_Object)g(table,)h(lua_Object)g
3112(index\))-42 693 y({)6 750 y(lua_Object)g(oldIndex)f(=)i
3113(lua_getref\(lockedOldIndex\);)6 806 y(lua_pushobject\(table\);)6
3114863 y(lua_pushobject\(index\);)6 919 y(lua_callfunction\(oldIndex\);)
3115-42 976 y(})-42 1088 y(void)g(Index)f(\(void\))-42 1145
3116y({)6 1201 y(lua_Object)g(table)g(=)h(lua_getparam\(1\);)6
31171258 y(lua_Object)f(index)g(=)h(lua_getparam\(2\);)6
31181314 y(lua_Object)f(parent;)6 1371 y(if)h(\(lua_isstring\(index\))d(&&)
3119j(strcmp\(lua_getstring\(in)o(dex\),)d("parent"\))h(==)i(0\))6
31201427 y({)54 1484 y(callOldFallback\(table,)d(index\);)54
31211540 y(return;)6 1597 y(})6 1653 y(lua_pushobject\(table\);)6
31221709 y(lua_pushref\(lockedParentName)o(\);)6 1766 y(parent)i(=)h
3123(lua_getsubscript\(\);)6 1822 y(if)g(\(lua_istable\(parent\)\))6
31241879 y({)54 1935 y(lua_pushobject\(parent\);)54 1992
3125y(lua_pushobject\(index\);)54 2048 y(/*)g(return)f(result)g(from)g
3126(getsubscript)f(*/)54 2105 y(lua_pushobject\(lua_getsubs)o(cript\(\))o
3127(\);)6 2161 y(})6 2218 y(else)54 2274 y(callOldFallback\(table,)f
3128(index\);)-42 2330 y(})665 2466 y Fo(Figure)15 b(1:)k(Inheritance)d(in)
3129f(C.)p -42 2522 V 911 2748 a(28)p eop
3130%%Page: 29 29
313129 28 bop -42 159 1950 6 v -42 253 a Fm(Point)24 b(=)f({x)h(=)g(0,)f(y)
3132h(=)g(0})-42 366 y(function)f(Point:create)f(\(o\))6
3133423 y(o.parent)h(=)h(self)6 479 y(return)f(o)-42 536
3134y(end)-42 648 y(function)g(Point:move)g(\(p\))6 705 y(self.x)g(=)h
3135(self.x)f(+)h(p.x)6 761 y(self.y)f(=)h(self.y)f(+)h(p.y)-42
3136818 y(end)-42 931 y(...)-42 1044 y(--)-42 1100 y(--)g(creating)f
3137(points)-42 1157 y(--)-42 1213 y(p1)h(=)g(Point:create{x)e(=)h(10,)h(y)
3138g(=)f(20})-42 1270 y(p2)h(=)g(Point:create{x)e(=)h(10})48
3139b(--)23 b(y)h(will)f(be)h(inherited)f(until)g(it)g(is)h(set)-42
31401382 y(--)-42 1439 y(--)g(example)f(of)h(a)f(method)g(invocation)-42
31411495 y(--)-42 1552 y(p1:move\(p2\))690 1687 y Fo(Figure)15
3142b(2:)k(A)c(Class)g(P)o(oin)o(t.)p -42 1744 V 29 1872
3143a(F)l(or)e(instance,)g(a)g(class)g Fm(Point)g Fo(can)g(b)q(e)h(describ)
3144q(ed)h(as)e(in)g(Figure)f(2.)19 b(F)l(unction)14 b Fm(create)e
3145Fo(helps)i(the)f(creation)-42 1928 y(of)f(new)h(p)q(oin)o(ts,)f(adding)
3146g(the)g(paren)o(t)g(\014eld.)20 b(F)l(unction)12 b Fm(move)f
3147Fo(is)h(an)h(example)e(of)h(an)g(instance)g(metho)q(d.)18
3148b(Finally)l(,)-42 1984 y(a)h(sub)q(class)f(can)h(b)q(e)h(created)e(as)g
3149(a)h(new)g(table,)f(with)g(the)h Fm(parent)f Fo(\014eld)h(p)q(oin)o
3150(ting)e(to)h(its)g(sup)q(erclass.)30 b(It)19 b(is)-42
31512041 y(in)o(teresting)d(to)g(notice)g(ho)o(w)g(the)h(use)g(of)f
3152Fm(self)g Fo(in)h(metho)q(d)e Fm(create)h Fo(allo)o(ws)f(this)h(metho)q
3153(d)g(to)g(w)o(ork)g(prop)q(erly)-42 2097 y(ev)o(en)g(when)g(inherited)f
3154(b)o(y)g(a)f(sub)q(class.)20 b(As)c(usual,)e(a)h(sub)q(class)g(ma)o(y)f
3155(o)o(v)o(erwrite)f(an)o(y)i(inherited)g(metho)q(d)f(with)-42
31562154 y(its)h(o)o(wn)g(v)o(ersion.)-42 2275 y Fe(8.8)56
3157b(Mo)r(dules)-42 2361 y Fo(Here)17 b(w)o(e)f(explain)f(one)i(p)q
3158(ossible)f(w)o(a)o(y)f(to)g(sim)o(ulate)f(mo)q(dules)h(in)h(Lua.)23
3159b(The)17 b(main)d(idea)i(is)g(to)f(use)i(a)f(table)f(to)-42
31602418 y(store)g(the)g(mo)q(dule)g(functions.)29 2474 y(A)g(mo)q(dule)g
3161(should)g(b)q(e)h(written)e(as)h(a)g(separate)f(c)o(h)o(unk,)h
3162(starting)f(with:)-42 2567 y Fm(if)24 b(modulename)f(then)g(return)g
3163(end)47 b(--)24 b(avoid)f(loading)g(twice)g(the)h(same)f(module)-42
31642623 y(modulename)g(=)h({})47 b(--)24 b(create)f(a)h(table)f(to)g
3165(represent)g(the)g(module)911 2748 y Fo(29)p eop
3166%%Page: 30 30
316730 29 bop -42 159 1950 6 v -42 253 a Fm(function)23 b(open)h(\(mod\))6
3168310 y(local)f(n,)h(f)g(=)f(next\(mod,)g(nil\))6 366 y(while)g(n)h(do)54
3169423 y(setglobal\(n,)e(f\))54 479 y(n,)i(f)f(=)h(next\(mod,)f(n\))6
3170536 y(end)-42 592 y(end)645 727 y Fo(Figure)14 b(3:)20
3171b(Op)q(ening)c(a)f(mo)q(dule.)p -42 784 V -42 913 a(After)g(that,)f
3172(functions)h(can)h(b)q(e)g(directly)e(de\014ned)j(with)d(the)h(syn)o
3173(tax)-42 1006 y Fm(function)23 b(modulename.foo)f(\(...\))6
31741063 y(...)-42 1119 y(end)29 1213 y Fo(An)o(y)14 b(co)q(de)g(that)f
3175(needs)i(this)e(mo)q(dule)g(has)g(only)h(to)f(execute)h
3176Fm(dofile\("filename"\))p Fo(,)d(where)j Fm(filename)f
3177Fo(is)-42 1270 y(the)j(\014le)f(where)g(the)h(mo)q(dule)e(is)h
3178(written.)k(After)14 b(this,)h(an)o(y)g(function)g(can)g(b)q(e)h
3179(called)f(with)-42 1363 y Fm(modulename.foo\(...\))29
31801457 y Fo(If)h(a)f(mo)q(dule)g(function)h(is)f(going)g(to)g(b)q(e)h
3181(used)g(man)o(y)f(times,)e(the)j(program)e(can)i(giv)o(e)f(a)g(lo)q
3182(cal)g(name)f(to)i(it.)-42 1514 y(Because)g(functions)f(are)g(v)m
3183(alues,)g(it)g(is)f(enough)i(to)e(write)-42 1607 y Fm(localname)23
3184b(=)h(modulename.foo)-42 1701 y Fo(Finally)l(,)15 b(a)g(mo)q(dule)g(ma)
3185o(y)f(b)q(e)j Fn(op)n(ene)n(d)p Fo(,)e(giving)f(direct)i(access)g(to)f
3186(all)g(its)g(functions,)g(as)g(sho)o(wn)h(in)f(the)h(co)q(de)h(in)-42
31871758 y(Figure)e(3.)-42 1879 y Fe(8.9)56 b(A)19 b(CF)-5
3188b(unction)-42 1965 y Fo(A)18 b(CF)l(unction)f(to)f(compute)h(the)g
3189(maxim)o(um)c(of)k(a)g(v)m(ariable)g(n)o(um)o(b)q(er)f(of)h(argumen)o
3190(ts)f(is)h(sho)o(wn)g(in)g(Figure)f(4.)-42 2022 y(After)f(registered)g
3191(with)-42 2115 y Fm(lua_register)23 b(\("max",)g(math_max\);)-42
31922209 y Fo(this)15 b(function)g(is)g(a)o(v)m(ailable)f(in)h(Lua,)g(as)g
3193(follo)o(ws:)-42 2303 y Fm(i)24 b(=)g(max\(4,)f(5,)h(10,)f(-34\))47
3194b(--)24 b(i)g(receives)e(10)-42 2425 y Fe(8.10)56 b(Calling)21
3195b(Lua)e(F)-5 b(unctions)-42 2511 y Fo(This)17 b(example)e(illustrates)f
3196(ho)o(w)i(a)h(C)f(function)g(can)h(call)e(the)i(Lua)g(function)f
3197Fm(remove_blanks)f Fo(presen)o(ted)i(in)-42 2567 y(Section)f(8.3.)911
31982748 y(30)p eop
3199%%Page: 31 31
320031 30 bop -42 628 1950 6 v -42 722 a Fm(void)24 b(math_max)f(\(void\))
3201-42 778 y({)-18 834 y(int)h(i=1;)71 b(/*)23 b(number)g(of)h(arguments)f
3202(*/)-18 891 y(double)g(d,)h(dmax;)-18 947 y(lua_Object)f(o;)-18
32031004 y(/*)h(the)f(function)g(must)g(get)h(at)g(least)f(one)g(argument)g
3204(*/)-18 1060 y(if)h(\(\(o)f(=)h(lua_getparam\(i++\)\))e(==)h
3205(LUA_NOOBJECT\))30 1117 y(lua_error)g(\("too)g(few)g(arguments)g(to)h
3206(function)e(`max'"\);)-18 1173 y(/*)i(and)f(this)h(argument)e(must)i
3207(be)f(a)h(number)f(*/)-18 1230 y(if)h(\(!lua_isnumber\(o\)\))30
32081286 y(lua_error)f(\("incorrect)f(argument)h(to)g(function)g(`max'"\);)
3209-18 1343 y(dmax)h(=)f(lua_getnumber)f(\(o\);)-18 1399
3210y(/*)i(loops)f(until)g(there)g(is)h(no)g(more)f(arguments)g(*/)-18
32111455 y(while)h(\(\(o)f(=)h(lua_getparam\(i++\)\))d(!=)j(LUA_NOOBJECT\))
3212-18 1512 y({)6 1568 y(if)g(\(!lua_isnumber\(o\)\))54
32131625 y(lua_error)f(\("incorrect)f(argument)h(to)g(function)g(`max'"\);)
32146 1681 y(d)h(=)g(lua_getnumber)e(\(o\);)6 1738 y(if)i(\(d)f(>)h(dmax\))
3215f(dmax)h(=)f(d;)-18 1794 y(})-18 1851 y(/*)h(push)f(the)h(result)f(to)g
3216(be)h(returned)f(*/)-18 1907 y(lua_pushnumber)f(\(dmax\);)-42
32171964 y(})623 2099 y Fo(Figure)14 b(4:)20 b(C)15 b(function)g
3218Fm(math)p 1147 2099 15 2 v 16 w(max)p Fo(.)p -42 2155
32191950 6 v 911 2748 a(31)p eop
3220%%Page: 32 32
322132 31 bop -42 199 a Fm(void)24 b(remove_blanks)e(\(char)h(*s\))-42
3222256 y({)6 312 y(lua_pushstring\(s\);)45 b(/*)24 b(prepare)f(parameter)g
3223(*/)6 369 y(lua_call\("remove_blanks"\);)44 b(/*)24 b(call)f(Lua)h
3224(function)f(*/)6 425 y(strcpy\(s,)g(lua_getstring\(lua_getresu)o
3225(lt\(1\)\)\))o(;)45 b(/*)24 b(copy)f(result)g(back)g(to)h('s')f(*/)-42
3226482 y(})-42 625 y Fp(Ac)n(kno)n(wledgmen)n(ts)-42 726
3227y Fo(The)15 b(authors)f(w)o(ould)f(lik)o(e)h(to)f(thank)h(CENPES/PETR)o
3228(OBR)1053 715 y(\023)1047 726 y(AS)h(whic)o(h,)f(join)o(tly)f(with)h
3229Fa(T)l(eC)1574 740 y(Graf)1656 726 y Fo(,)g(used)h(exten-)-42
3230783 y(siv)o(ely)i(early)g(v)o(ersions)g(of)h(this)f(system)f(and)i(ga)o
3231(v)o(e)f(v)m(aluable)g(commen)o(ts.)25 b(The)18 b(authors)f(w)o(ould)g
3232(also)g(lik)o(e)g(to)-42 839 y(thank)f(Carlos)d(Henrique)j(Levy)l(,)f
3233(who)g(found)h(the)f(name)f(of)h(the)h(game.)i(Lua)d(means)g
3234Fn(mo)n(on)g Fo(in)g(P)o(ortuguese.)-42 982 y Fp(A)68
3235b(Incompatibiliti)q(es)24 b(with)f(Previous)h(V)-6 b(ersions)-42
32361084 y Fo(Although)15 b(great)f(care)h(has)g(b)q(een)h(tak)o(en)f(to)f
3237(a)o(v)o(oid)g(incompatibiliti)o(es)e(with)j(the)g(previous)g(public)g
3238(v)o(ersions)f(of)-42 1140 y(Lua,)i(some)e(di\013erences)h(had)g(to)g
3239(b)q(e)h(in)o(tro)q(duced.)k(Here)15 b(is)g(a)g(list)f(of)h(all)f
3240(these)h(di\013erences.)-42 1262 y Fe(Incompatibilities)21
3241b(with)f(v)n(ersion)f(2.2)27 1348 y Fj(\017)j Fo(F)l(unctions)15
3242b Fm(date)f Fo(and)h Fm(time)f Fo(\(from)f Fm(iolib)p
3243Fo(\))g(ha)o(v)o(e)i(b)q(een)h(sup)q(erseded)g(b)o(y)e(the)h(new)g(v)o
3244(ersion)f(of)h(function)72 1404 y Fm(date)p Fo(.)27 1498
3245y Fj(\017)22 b Fo(F)l(unction)17 b Fm(append)g Fo(\(from)e
3246Fm(iolib)p Fo(\))i(no)o(w)f(returns)i(1)f(whenev)o(er)h(it)e(succeeds,)
3247j(whether)e(the)h(\014le)f(is)g(new)72 1555 y(or)e(not.)27
32481648 y Fj(\017)22 b Fo(F)l(unction)14 b Fm(int2str)g
3249Fo(\(from)f Fm(strlib)p Fo(\))g(has)h(b)q(een)i(sup)q(erseded)g(b)o(y)e
3250(new)h(function)g Fm(format)p Fo(,)e(with)h(param-)72
32511705 y(eter)h Fm("\045c")p Fo(.)27 1799 y Fj(\017)22
3252b Fo(The)15 b(API)h(lo)q(c)o(k)f(mec)o(hanism)d(has)j(b)q(een)h(sup)q
3253(erseded)h(b)o(y)e(the)g(reference)h(mec)o(hanism.)h(Ho)o(w)o(ev)o(er,)
3254d Fm(lua.h)72 1855 y Fo(pro)o(vides)h(compatibilit)n(y)e(macros,)g(so)h
3255(there)i(is)e(no)i(need)g(to)e(c)o(hange)h(programs.)27
32561949 y Fj(\017)22 b Fo(API)16 b(function)f Fm(lua_pushliteral)e
3257Fo(no)o(w)i(is)f(just)h(a)g(macro)f(to)g Fm(lua_pushstring)p
3258Fo(.)-42 2071 y Fe(Incompatibilities)21 b(with)f(v)n(ersion)f(2.1)27
32592156 y Fj(\017)j Fo(The)13 b(function)f Fm(type)g Fo(no)o(w)g(returns)h
3260(the)f(string)g Fm("function")f Fo(b)q(oth)h(for)g(C)g(and)h(Lua)g
3261(functions.)19 b(Because)72 2213 y(Lua)f(functions)g(and)g(C)g
3262(functions)f(are)h(compatible,)e(this)i(b)q(eha)o(vior)f(is)g(usually)h
3263(more)e(useful.)28 b(When)72 2269 y(needed,)20 b(the)e(second)g(result)
3264g(of)f(function)h Fm(type)f Fo(ma)o(y)f(b)q(e)j(used)g(to)e
3265(distinguish)g(b)q(et)o(w)o(een)h(Lua)h(and)f(C)72 2326
3266y(functions.)27 2420 y Fj(\017)k Fo(A)15 b(function)g(de\014nition)g
3267(only)g(assigns)f(the)h(function)g(v)m(alue)g(to)g(the)g(giv)o(en)f(v)m
3268(ariable)h(at)f(execution)h(time.)911 2748 y(32)p eop
3269%%Page: 33 33
327033 32 bop -42 199 a Fe(Incompatibilities)21 b(with)f(v)n(ersion)f(1.1)
327127 285 y Fj(\017)j Fo(The)16 b(equalit)o(y)e(test)g(op)q(erator)h(no)o
3272(w)f(is)h(denoted)h(b)o(y)f Fm(==)p Fo(,)f(instead)h(of)g
3273Fm(=)p Fo(.)27 379 y Fj(\017)22 b Fo(The)13 b(syn)o(tax)f(for)g(table)g
3274(construction)g(has)h(b)q(een)h(greatly)d(simpli\014ed.)18
3275b(The)13 b(old)f Fm(@\(size\))g Fo(has)g(b)q(een)i(sub-)72
3276435 y(stituted)h(b)o(y)h Fm({})p Fo(.)21 b(The)16 b(list)e(constructor)
3277h(\(formerly)e Fm(@[...])p Fo(\))i(and)h(the)f(record)h(constructor)f
3278(\(formerly)72 492 y Fm(@{...})p Fo(\))f(no)o(w)g(are)h(b)q(oth)f(co)q
3279(ded)i(lik)o(e)e Fm({...})p Fo(.)19 b(When)c(the)g(construction)f(in)o
3280(v)o(olv)o(es)g(a)g(function)h(call,)e(lik)o(e)72 548
3281y(in)i Fm(@func{...})p Fo(,)e(the)i(new)g(syn)o(tax)f(do)q(es)i(not)e
3282(use)h(the)g Fm(@)p Fo(.)20 b(More)14 b(imp)q(ortan)o(t,)e
3283Fn(a)17 b(c)n(onstruction)e(function)72 605 y(must)i(now)f(explicitly)g
3284(r)n(eturn)g(the)g(c)n(onstructe)n(d)g(table)p Fo(.)27
3285699 y Fj(\017)22 b Fo(The)16 b(function)f Fm(lua_call)f
3286Fo(no)h(longer)f(has)h(the)h(parameter)d Fm(nparam)p
3287Fo(.)27 792 y Fj(\017)22 b Fo(The)g(function)f Fm(lua_pop)g
3288Fo(is)g(no)h(longer)e(a)o(v)m(ailable,)i(since)g(it)f(could)g(lead)g
3289(to)g(strange)g(b)q(eha)o(vior.)39 b(In)72 849 y(particular,)18
3290b(to)h(access)g(results)g(returned)g(from)f(a)g(Lua)i(function,)f(the)h
3291(new)f(macro)e Fm(lua_getresult)72 905 y Fo(should)e(b)q(e)h(used.)27
3292999 y Fj(\017)22 b Fo(The)16 b(old)e(functions)h Fm(lua_storefield)f
3293Fo(and)h Fm(lua_storeindexed)e Fo(ha)o(v)o(e)i(b)q(een)h(replaced)f(b)o
3294(y)72 1112 y Fm(int)24 b(lua_storesubscript)d(\(void\);)72
32951224 y Fo(with)15 b(the)g(parameters)e(explicitly)h(pushed)j(on)e(the)g
3296(stac)o(k.)27 1318 y Fj(\017)22 b Fo(The)12 b(functionalit)o(y)e(of)i
3297(the)g(function)f Fm(lua_errorfunction)f Fo(has)h(b)q(een)i(replaced)f
3298(b)o(y)g(the)g Fn(fal)r(lb)n(ack)f Fo(mec)o(h-)72 1374
3299y(anism;)i(see)j(Section)f(4.8.)27 1468 y Fj(\017)22
3300b Fo(When)16 b(calling)e(a)h(function)h(from)d(the)j(Lua)g(library)l(,)
3301e(parameters)g(passed)h(through)h(the)f(stac)o(k)g(m)o(ust)f(b)q(e)72
33021525 y(pushed)20 b(just)f(b)q(efore)g(the)g(corresp)q(onden)o(t)g
3303(call,)f(with)g(no)h(in)o(termediate)e(calls)g(to)i(Lua.)31
3304b(Sp)q(ecial)19 b(care)72 1581 y(should)c(b)q(e)h(tak)o(en)f(with)f
3305(macros)g(lik)o(e)g Fm(lua_getindexed)f Fo(and)j Fm(lua_getfield)p
3306Fo(.)911 2748 y(33)p eop
3307%%Page: 34 34
330834 33 bop -42 264 a Fp(Index)-42 354 y Fo(..)20 b(6)-42
3309411 y(abs)c(19)-42 467 y(acos)f(19)-42 524 y(Adjustmen)o(t)f(4)-42
3310580 y(and)i(6)-42 637 y(app)q(endto)g(20)-42 693 y(argumen)o(ts)e(8)-42
3311749 y(arithmetic)f(fallbac)o(k)h(9)-42 806 y(arithmetic)f(op)q(erators)
3312i(6)-42 862 y(arra)o(ys)f(3)-42 919 y(ascii)h(19)-42
3313975 y(asin)g(19)-42 1032 y(assert)g(17)-42 1088 y(Assignmen)o(t)f(4)-42
33141145 y(asso)q(ciativ)o(e)g(arra)o(ys)g(3)-42 1201 y(atan)h(19)-42
33151258 y(atan2)g(19)-42 1314 y(basic)g(t)o(yp)q(es)h(2)-42
33161370 y(blo)q(c)o(k)f(4)-42 1427 y(C)g(p)q(oin)o(ters)g(2)-42
33171483 y(ceil)g(19)-42 1540 y(CF)l(unction)g(2)-42 1596
3318y(c)o(h)o(unk)h(2)-42 1653 y(clone)g(24)-42 1709 y(closing)f(a)g
3319(\014le)g(20)-42 1766 y(Co)q(ercion)g(3)-42 1822 y(Commen)o(ts)e(3)-42
33201879 y(concatenation)i(fallbac)o(k)f(10)-42 1935 y(concatenation)h(6)
3321-42 1991 y(condition)g(expression)g(5)-42 2048 y(constructors)g(7)-42
33222104 y(cos)g(19)-42 2161 y(Data)f(Structures)i(24)-42
33232217 y(date)f(22)-42 2274 y(debug)h(pragma)e(11)-42 2330
3324y(do\014le)i(16)-42 2387 y(dostring)f(16)-42 2443 y(error)g(fallbac)o
3325(k)f(10)-42 2500 y(error)h(18)-42 2556 y(exit)g(22)-42
33262612 y(exp)q(onen)o(tiation)g(6)1006 354 y(Expressions)g(5)1006
3327411 y(fallbac)o(ks)f(9)1006 467 y(\015o)q(or)h(19)1006
3328524 y(format)e(19)1006 580 y(function)i(call)f(8)1006
3329637 y(F)l(unction)h(De\014nitions)g(8)1006 693 y(function)g(falbac)o(k)
3330f(10)1006 749 y(function)h(2)1006 806 y(functions)g(in)g(C)g(30)1006
3331862 y(getglobal)f(18)1006 919 y(gettable)g(fallbac)o(k)g(10)1006
3332975 y(global)g(en)o(vironmen)o(t)f(2)1006 1032 y(Global)h(v)m(ariables)
3333g(2)1006 1088 y(Iden)o(ti\014ers)i(3)1006 1145 y(if-then-else)f(5)1006
33341201 y(index)h(fallbac)o(k)e(10)1006 1258 y(index)i(getglobal)d(10)1006
33351314 y(inheritance)i(27)1006 1370 y(Literal)f(strings)g(3)1006
33361427 y(Lo)q(cal)h(v)m(ariables)g(5)1006 1483 y(log10)f(19)1006
33371540 y(log)g(19)1006 1596 y(logical)g(op)q(erators)g(6)1006
33381653 y(luac)h(11)1006 1709 y(luac)g(2)1006 1766 y(lua)p
33391070 1766 14 2 v 16 w(call)f(14)1006 1822 y(lua)p 1070
33401822 V 16 w(callfunction)g(14)1006 1879 y(lua)p 1070
33411879 V 16 w(CF)l(unction)h(15)1006 1935 y(lua)p 1070
33421935 V 16 w(createtable)g(13)1006 1991 y(lua)p 1070 1991
3343V 16 w(do\014le)g(11)1006 2048 y(lua)p 1070 2048 V 16
3344w(dostring)f(11)1006 2104 y(lua)p 1070 2104 V 16 w(error)h(14)1006
33452161 y(lua)p 1070 2161 V 16 w(getcfunction)g(12)1006
33462217 y(lua)p 1070 2217 V 16 w(getglobal)f(13)1006 2274
3347y(lua)p 1070 2274 V 16 w(getn)o(um)o(b)q(er)g(12)1006
33482330 y(lua)p 1070 2330 V 16 w(getparam)f(15)1006 2387
3349y(lua)p 1070 2387 V 16 w(getref)i(15)1006 2443 y(lua)p
33501070 2443 V 16 w(getresult)f(14)1006 2500 y(lua)p 1070
33512500 V 16 w(getstring)g(12)1006 2556 y(lua)p 1070 2556
3352V 16 w(getsubscript)h(13)1006 2612 y(lua)p 1070 2612
3353V 16 w(getuserdata)f(12)911 2748 y(34)p eop
3354%%Page: 35 35
335535 34 bop -42 199 a Fo(lua)p 22 199 14 2 v 16 w(iscfunction)15
3356b(12)-42 256 y(lua)p 22 256 V 16 w(isfunction)g(12)-42
3357312 y(lua)p 22 312 V 16 w(isnil)g(12)-42 369 y(lua)p
335822 369 V 16 w(isn)o(um)o(b)q(er)g(12)-42 425 y(lua)p
335922 425 V 16 w(isstring)f(12)-42 482 y(lua)p 22 482 V
336016 w(istable)h(12)-42 538 y(lua)p 22 538 V 16 w(isuserdata)g(12)-42
3361594 y(LUA)p 57 594 V 17 w(NOOBJECT)i(15)-42 651 y(lua)p
336222 651 V 16 w(Ob)s(ject)f(11)-42 707 y(lua)p 22 707 V
336316 w(pushcfunction)g(13)-42 764 y(lua)p 22 764 V 16 w(pushnil)g(13)-42
3364820 y(lua)p 22 820 V 16 w(pushn)o(um)o(b)q(er)g(13)-42
3365877 y(lua)p 22 877 V 16 w(pushob)s(ject)g(13)-42 933
3366y(lua)p 22 933 V 16 w(pushref)g(15)-42 990 y(lua)p 22
3367990 V 16 w(pushstring)f(13)-42 1046 y(lua)p 22 1046 V
336816 w(push)o(userdata)h(13)-42 1103 y(lua)p 22 1103 V
336916 w(push)o(usertag)f(13)-42 1159 y(lua)p 22 1159 V 16
3370w(ref)h(15)-42 1215 y(lua)p 22 1215 V 16 w(register)f(15)-42
33711272 y(lua)p 22 1272 V 16 w(setfallbac)o(k)f(15)-42 1328
3372y(lua)p 22 1328 V 16 w(storeglobal)g(13)-42 1385 y(lua)p
337322 1385 V 16 w(storesubscript)h(13)-42 1441 y(lua)p 22
33741441 V 16 w(t)o(yp)q(e)h(12)-42 1498 y(lua)p 22 1498
3375V 16 w(unref)g(15)-42 1554 y(max)e(19)-42 1611 y(metho)q(ds)h(9)-42
33761667 y(min)f(19)-42 1724 y(mo)q(d)h(19)-42 1780 y(Mo)q(dules)h(29)-42
33771836 y(m)o(ultiple)e(assignmen)o(t)f(4)-42 1893 y(next)j(16)-42
33781949 y(next)g(24)-42 2006 y(nextv)m(ar)g(17)-42 2062
3379y(nextv)m(ar)g(24)-42 2119 y(nil)f(2)-42 2175 y(not)g(6)-42
33802232 y(n)o(um)o(b)q(er)g(2)-42 2288 y(Numerical)f(constan)o(ts)g(3)-42
33812345 y(Op)q(erator)h(precedence)i(7)-42 2401 y(or)e(6)-42
33822457 y(order)g(fallbac)o(k)f(9)-42 2514 y(P)o(ersistence)h(26)-42
33832570 y(pip)q(ed)h(input)g(20)1006 199 y(pip)q(ed)g(output)f(20)1006
3384256 y(p)q(op)q(en)h(20)1006 312 y(p)q(op)q(en)g(20)1006
3385369 y(pre-compilation)d(2)1006 425 y(prede\014ned)k(functions)e(16)1006
3386482 y(prin)o(t)g(17)1006 538 y(Programmi)o(ng)d(with)j(Classes)f(27)
33871006 594 y(random)g(19)1006 651 y(randomseed)h(19)1006
3388707 y(read)g(20)1006 764 y(readfrom)f(20)1006 820 y(readun)o(til)g(21)
33891006 877 y(records)h(3)1006 933 y(reference)h(15)1006
3390990 y(re\015exivit)o(y)e(16)1006 1046 y(relational)f(op)q(erators)i(6)
33911006 1103 y(remo)o(v)o(e)f(20)1006 1159 y(rename)g(20)1006
33921215 y(rep)q(eat-un)o(til)h(5)1006 1272 y(reserv)o(ed)g(w)o(ords)g(3)
33931006 1328 y(return)g(statemen)o(t)e(4)1006 1385 y(return)i(statemen)o
3394(t)e(5)1006 1441 y(self)i(9)1006 1498 y(setfallbac)o(k)f(10)1006
33951554 y(setfallbac)o(k)g(18)1006 1611 y(setglobal)g(18)1006
33961667 y(settable)h(fallbac)o(k)f(10)1006 1724 y(short-cut)h(ev)m
3397(aluation)f(6)1006 1780 y(Simple)g(Expressions)h(5)1006
33981836 y(sin)g(19)1006 1893 y(sqrt)g(19)1006 1949 y(statemen)o(ts)e(4)
33991006 2006 y(str\014nd)i(18)1006 2062 y(string)f(2)1006
34002119 y(strlen)h(18)1006 2175 y(strlo)o(w)o(er)e(18)1006
34012232 y(strsub)i(18)1006 2288 y(strupp)q(er)h(19)1006
34022345 y(table)f(2)1006 2401 y(tag)f(17)1006 2457 y(tan)h(19)1006
34032514 y(tmpname)e(20)1006 2570 y(tok)o(ens)i(3)911 2748
3404y(35)p eop
3405%%Page: 36 36
340636 35 bop -42 199 a Fo(ton)o(um)o(b)q(er)14 b(17)-42
3407256 y(tostring)g(17)-42 312 y(t)o(yp)q(e)i(17)-42 369
3408y(T)o(yp)q(es)g(2)-42 425 y(userdata)f(2)-42 482 y(V)l(ariable)g(n)o
3409(um)o(b)q(er)f(of)h(argumen)o(ts)f(25)-42 538 y(v)o(ersion)h(1.1)f(33)
3410-42 594 y(v)o(ersion)h(2.1)f(32)-42 651 y(v)o(ersion)h(2.2)f(32)-42
3411707 y(while-do)h(5)-42 764 y(write)g(21)-42 820 y(writeto)f(20)911
34122748 y(36)p eop
3413%%Page: 37 37
341437 36 bop -42 199 a Fp(Con)n(ten)n(ts)-42 301 y Fl(1)43
3415b(In)o(tro)q(duction)1567 b(1)-42 403 y(2)43 b(En)o(vironmen)o(t)14
3416b(and)k(Ch)o(unks)1268 b(2)-42 505 y(3)43 b(T)o(yp)q(es)1717
3417b(2)-42 607 y(4)43 b(The)17 b(Language)1534 b(3)27 663
3418y Fo(4.1)45 b(Lexical)15 b(Con)o(v)o(en)o(tions)40 b(.)22
3419b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
3420(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
342165 b(3)27 720 y(4.2)45 b(Co)q(ercion)16 b(.)23 b(.)f(.)g(.)h(.)f(.)h(.)
3422f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
3423(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
3424g(.)65 b(3)27 776 y(4.3)45 b(Adjustmen)o(t)28 b(.)22
3425b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g
3426(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
3427h(.)f(.)h(.)f(.)g(.)65 b(4)27 833 y(4.4)45 b(Statemen)o(ts)40
3428b(.)22 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
3429f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3430(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(4)131 889 y(4.4.1)51
3431b(Blo)q(c)o(ks)22 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3432(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
3433g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(4)131 946 y(4.4.2)51
3434b(Assignmen)o(t)27 b(.)22 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
3435(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
3436f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(4)131 1002 y(4.4.3)51
3437b(Con)o(trol)13 b(Structures)30 b(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
3438f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3439(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(5)131 1059 y(4.4.4)51
3440b(F)l(unction)15 b(Calls)f(as)g(Statemen)o(ts)30 b(.)22
3441b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g
3442(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(5)131 1115 y(4.4.5)51
3443b(Lo)q(cal)15 b(Declarations)28 b(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
3444f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3445(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(5)27 1171 y(4.5)45 b(Expressions)30
3446b(.)22 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
3447f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3448(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(5)131 1228 y(4.5.1)51
3449b(Simple)14 b(Expressions)k(.)k(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
3450(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
3451f(.)h(.)f(.)g(.)65 b(5)131 1284 y(4.5.2)51 b(Arithmetic)13
3452b(Op)q(erators)41 b(.)22 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f
3453(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
3454g(.)65 b(6)131 1341 y(4.5.3)51 b(Relational)13 b(Op)q(erators)19
3455b(.)k(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
3456(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65
3457b(6)131 1397 y(4.5.4)51 b(Logical)14 b(Op)q(erators)44
3458b(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
3459f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65
3460b(6)131 1454 y(4.5.5)51 b(Concatenation)40 b(.)23 b(.)f(.)g(.)h(.)f(.)g
3461(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
3462h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(6)131
34631510 y(4.5.6)51 b(Precedence)40 b(.)22 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
3464h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
3465(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(7)131
34661567 y(4.5.7)51 b(T)l(able)15 b(Constructors)j(.)k(.)h(.)f(.)g(.)h(.)f
3467(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
3468g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(7)131 1623 y(4.5.8)51
3469b(F)l(unction)15 b(Calls)39 b(.)23 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
3470h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
3471(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(8)27 1680 y(4.6)45
3472b(F)l(unction)15 b(De\014nitions)35 b(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g(.)
3473h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
3474(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65 b(8)27
34751736 y(4.7)45 b(F)l(allbac)o(ks)f(.)22 b(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
3476f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
3477(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)65
3478b(9)27 1792 y(4.8)45 b(Error)14 b(Handling)31 b(.)22
3479b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3480(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
3481h(.)f(.)g(.)42 b(10)-42 1894 y Fl(5)h(The)17 b(Application)g(Program)f
3482(In)o(terface)1020 b(11)27 1951 y Fo(5.1)45 b(Executing)15
3483b(Lua)h(Co)q(de)32 b(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3484(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
3485g(.)h(.)f(.)h(.)f(.)g(.)42 b(11)27 2007 y(5.2)j(Con)o(v)o(erting)14
3486b(V)l(alues)h(b)q(et)o(w)o(een)h(C)f(and)g(Lua)27 b(.)c(.)f(.)g(.)h(.)f
3487(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
3488h(.)f(.)g(.)42 b(11)27 2064 y(5.3)j(Manipulating)14 b(Lua)h(Ob)s(jects)
348920 b(.)i(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
3490f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3491b(13)27 2120 y(5.4)j(Calling)14 b(Lua)h(F)l(unctions)34
3492b(.)23 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
3493g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
3494(.)42 b(14)27 2177 y(5.5)j(C)15 b(F)l(unctions)22 b(.)g(.)h(.)f(.)h(.)f
3495(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
3496g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
3497(.)42 b(15)27 2233 y(5.6)j(References)17 b(to)d(Lua)i(Ob)s(jects)21
3498b(.)h(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
3499(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3500b(15)-42 2335 y Fl(6)h(Prede\014ned)16 b(F)l(unctions)h(and)h
3501(Libraries)1024 b(16)27 2391 y Fo(6.1)45 b(Prede\014ned)17
3502b(F)l(unctions)k(.)h(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)
3503h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
3504(.)f(.)h(.)f(.)g(.)42 b(16)27 2448 y(6.2)j(String)15
3505b(Manipulation)35 b(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f
3506(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
3507g(.)h(.)f(.)h(.)f(.)g(.)42 b(18)27 2504 y(6.3)j(Mathematical)12
3508b(F)l(unctions)29 b(.)22 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h
3509(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)
3510f(.)h(.)f(.)g(.)42 b(19)27 2561 y(6.4)j(I/O)16 b(F)l(acilities)31
3511b(.)23 b(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)
3512g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g
3513(.)h(.)f(.)h(.)f(.)g(.)42 b(19)911 2748 y(37)p eop
3514%%Page: 38 38
351538 37 bop -42 199 a Fl(7)43 b(The)17 b(Debuger)h(In)o(terface)1309
3516b(22)27 256 y Fo(7.1)45 b(Stac)o(k)15 b(and)g(F)l(unction)g
3517(Information)e(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h
3518(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3519b(22)27 312 y(7.2)j(Manipulating)14 b(Lo)q(cal)h(V)l(ariables)29
3520b(.)22 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
3521h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3522b(23)27 369 y(7.3)j(Ho)q(oks)34 b(.)22 b(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
3523g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
3524(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
352542 b(23)-42 471 y Fl(8)h(Some)16 b(Examples)1468 b(23)27
3526527 y Fo(8.1)45 b(Data)14 b(Structures)i(.)22 b(.)h(.)f(.)g(.)h(.)f(.)g
3527(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g(.)
3528h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3529b(24)27 583 y(8.2)j(The)16 b(F)l(unctions)f Fm(next)f
3530Fo(and)i Fm(nextvar)i Fo(.)23 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
3531(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
353242 b(24)27 640 y(8.3)j(String)15 b(Manipulation)35 b(.)22
3533b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
3534(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)
353542 b(25)27 696 y(8.4)j(V)l(ariable)15 b(n)o(um)o(b)q(er)f(of)h(argumen)
3536o(ts)d(.)22 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f
3537(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3538b(25)27 753 y(8.5)j(P)o(ersistence)e(.)22 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f
3539(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
3540g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3541b(26)27 809 y(8.6)j(Inheritance)40 b(.)22 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f
3542(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)
3543g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3544b(27)27 866 y(8.7)j(Programmi)o(ng)12 b(with)j(Classes)e(.)22
3545b(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)g
3546(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3547b(27)27 922 y(8.8)j(Mo)q(dules)25 b(.)e(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h
3548(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
3549f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3550b(29)27 979 y(8.9)j(A)15 b(CF)l(unction)41 b(.)23 b(.)f(.)h(.)f(.)g(.)h
3551(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)
3552f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g(.)42
3553b(30)27 1035 y(8.10)22 b(Calling)14 b(Lua)h(F)l(unctions)34
3554b(.)23 b(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)
3555g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)g
3556(.)42 b(30)-42 1137 y Fl(A)29 b(Incompatibilities)14
3557b(with)j(Previous)f(V)l(ersions)899 b(32)911 2748 y Fo(38)p
3558eop
3559%%Trailer
3560end
3561userdict /end-hook known{end-hook}if
3562%%EOF
domake+0−11
@@ -1,11 +0,0 @@
1#!/bin/sh -x
2# makefile for lua hierarchy
3
4VERSION=2.2
5LUA=`pwd`
6export LUA VERSION
7
8cd $LUA/src; make $*
9cd $LUA/include; make $*
10cd $LUA/clients/lib; make $*
11cd $LUA/clients/lua; make $*
include/Makefile+5−3
@@ -1,11 +1,13 @@
1# makefile for lua distribution1# makefile for lua distribution (includes)
2
3LUA= ..
4
5include $(LUA)/config
2 6
3SRCS= lua.h lualib.h luadebug.h7SRCS= lua.h lualib.h luadebug.h
4 8
5all:9all:
6 10
7dynamic:
8
9clean:11clean:
10 12
11co:13co:
include/lua.h+24−16
@@ -2,14 +2,14 @@ · 1 unmodified line
2** LUA - Linguagem para Usuarios de Aplicacao2** LUA - Linguagem para Usuarios de Aplicacao
3** Grupo de Tecnologia em Computacao Grafica3** Grupo de Tecnologia em Computacao Grafica
4** TeCGraf - PUC-Rio4** TeCGraf - PUC-Rio
5** $Id: lua.h,v 3.21 1995/11/13 15:36:52 roberto Exp $5** $Id: lua.h,v 3.28 1996/05/06 14:32:59 roberto Exp $
6*/6*/
7 7
8 8
9#ifndef lua_h9#ifndef lua_h
10#define lua_h10#define lua_h
11 11
12#define LUA_VERSION "Lua 2.2"12#define LUA_VERSION "Lua 2.4"
13#define LUA_COPYRIGHT "Copyright (C) 1994, 1995 TeCGraf"13#define LUA_COPYRIGHT "Copyright (C) 1994, 1995 TeCGraf"
14#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo"14#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
15 15
@@ -52,6 +52,14 @@ void lua_endblock (void); · 36 unmodified lines
52lua_Object lua_getparam (int number);52lua_Object lua_getparam (int number);
53#define lua_getresult(_) lua_getparam(_)53#define lua_getresult(_) lua_getparam(_)
54 54
55#define lua_isnil(_) (lua_type(_)==LUA_T_NIL)
56#define lua_istable(_) (lua_type(_)==LUA_T_ARRAY)
57#define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA)
58#define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION)
59int lua_isnumber (lua_Object object);
60int lua_isstring (lua_Object object);
61int lua_isfunction (lua_Object object);
62
55float lua_getnumber (lua_Object object);63float lua_getnumber (lua_Object object);
56char *lua_getstring (lua_Object object);64char *lua_getstring (lua_Object object);
57lua_CFunction lua_getcfunction (lua_Object object);65lua_CFunction lua_getcfunction (lua_Object object);
@@ -60,7 +68,6 @@ void *lua_getuserdata (lua_Object object); · 2 unmodified lines
60void lua_pushnil (void);68void lua_pushnil (void);
61void lua_pushnumber (float n);69void lua_pushnumber (float n);
62void lua_pushstring (char *s);70void lua_pushstring (char *s);
63void lua_pushliteral (char *s);
64void lua_pushcfunction (lua_CFunction fn);71void lua_pushcfunction (lua_CFunction fn);
65void lua_pushusertag (void *u, int tag);72void lua_pushusertag (void *u, int tag);
66void lua_pushobject (lua_Object object);73void lua_pushobject (lua_Object object);
@@ -73,32 +80,33 @@ lua_Object lua_getsubscript (void); · 6 unmodified lines
73 80
74int lua_type (lua_Object object);81int lua_type (lua_Object object);
75 82
76int lua_lock (void);83
77lua_Object lua_getlocked (int ref);84int lua_ref (int lock);
78void lua_pushlocked (int ref);85lua_Object lua_getref (int ref);
79void lua_unlock (int ref);86void lua_pushref (int ref);
87void lua_unref (int ref);
80 88
81lua_Object lua_createtable (void);89lua_Object lua_createtable (void);
82 90
83 91
84/* some useful macros */92/* some useful macros */
85 93
86#define lua_lockobject(o) (lua_pushobject(o), lua_lock())94#define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l))
87 95
88#define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n))96#define lua_register(n,f) (lua_pushcfunction(f), lua_storeglobal(n))
89 97
90#define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA)98#define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA)
91 99
92#define lua_isnil(_) (lua_type(_)==LUA_T_NIL)
93#define lua_isnumber(_) (lua_type(_)==LUA_T_NUMBER)
94#define lua_isstring(_) (lua_type(_)==LUA_T_STRING)
95#define lua_istable(_) (lua_type(_)==LUA_T_ARRAY)
96#define lua_isfunction(_) (lua_type(_)==LUA_T_FUNCTION)
97#define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION)
98#define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA)
99 100
101/* for compatibility with old versions. Avoid using these macros */
102
103#define lua_lockobject(o) lua_refobject(o,1)
104#define lua_lock() lua_ref(1)
105#define lua_getlocked lua_getref
106#define lua_pushlocked lua_pushref
107#define lua_unlock lua_unref
100 108
101/* for lua 1.1 compatibility. Avoid using these macros */109#define lua_pushliteral(o) lua_pushstring(o)
102 110
103#define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript())111#define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript())
104#define lua_getfield(o,f) (lua_pushobject(o), lua_pushliteral(f), lua_getsubscript())112#define lua_getfield(o,f) (lua_pushobject(o), lua_pushliteral(f), lua_getsubscript())
include/luadebug.h+15−4
@@ -2,7 +2,7 @@ · 1 unmodified line
2** LUA - Linguagem para Usuarios de Aplicacao2** LUA - Linguagem para Usuarios de Aplicacao
3** Grupo de Tecnologia em Computacao Grafica3** Grupo de Tecnologia em Computacao Grafica
4** TeCGraf - PUC-Rio4** TeCGraf - PUC-Rio
5** $Id: luadebug.h,v 1.2 1995/10/26 14:21:56 roberto Exp $5** $Id: luadebug.h,v 1.6 1996/03/20 17:05:44 roberto Exp $
6*/6*/
7 7
8 8
@@ -11,10 +11,21 @@ · 2 unmodified lines
11 11
12#include "lua.h"12#include "lua.h"
13 13
14lua_Object lua_stackedfunction(int level);14typedef lua_Object lua_Function;
15
16typedef void (*lua_LHFunction) (int line);
17typedef void (*lua_CHFunction) (lua_Function func, char *file, int line);
18
19lua_Function lua_stackedfunction (int level);
15void lua_funcinfo (lua_Object func, char **filename, int *linedefined);20void lua_funcinfo (lua_Object func, char **filename, int *linedefined);
16int lua_currentline (lua_Object func);21int lua_currentline (lua_Function func);
17char *getobjname (lua_Object o, char **name);22char *lua_getobjname (lua_Object o, char **name);
23
24lua_Object lua_getlocal (lua_Function func, int local_number, char **name);
25int lua_setlocal (lua_Function func, int local_number);
18 26
27extern lua_LHFunction lua_linehook;
28extern lua_CHFunction lua_callhook;
29extern int lua_debug;
19 30
20#endif31#endif
include/lualib.h+13−2
@@ -2,21 +2,32 @@ · 1 unmodified line
2** Libraries to be used in LUA programs2** Libraries to be used in LUA programs
3** Grupo de Tecnologia em Computacao Grafica3** Grupo de Tecnologia em Computacao Grafica
4** TeCGraf - PUC-Rio4** TeCGraf - PUC-Rio
5** $Id: lualib.h,v 1.4 1995/11/10 17:54:31 roberto Exp $5** $Id: lualib.h,v 1.8 1996/04/30 21:13:55 roberto Exp $
6*/6*/
7 7
8#ifndef lualib_h8#ifndef lualib_h
9#define lualib_h9#define lualib_h
10 10
11#include "lua.h"
12
11void iolib_open (void);13void iolib_open (void);
12void strlib_open (void);14void strlib_open (void);
13void mathlib_open (void);15void mathlib_open (void);
14 16
15 17
16/* auxiliar functions (private) */18/* auxiliar functions (private) */
19
20struct lua_reg {
21 char *name;
22 lua_CFunction func;
23};
24
25void luaI_openlib (struct lua_reg *l, int n);
17void lua_arg_error(char *funcname);26void lua_arg_error(char *funcname);
18char *lua_check_string (int numArg, char *funcname);27char *lua_check_string (int numArg, char *funcname);
19float lua_check_number (int numArg, char *funcname);28double lua_check_number (int numArg, char *funcname);
29char *luaI_addchar (int c);
30void luaI_addquoted (char *s);
20 31
21#endif32#endif
22 33
src/Makefile+47−21
@@ -1,40 +1,66 @@
1# makefile for lua distribution1# makefile for lua distribution (main library)
2 2
3INC= $(LUA)/include3LUA= ..
4LIB= $(LUA)/lib
5 4
6# in SunOs /usr/5include contains prototypes for standard lib5include $(LUA)/config
7INCS= -I/usr/5include -I$(INC)
8WARN= -Wall -Wmissing-prototypes -Wshadow -ansi
9 6
10CC= gcc7OBJS= fallback.o\
11CFLAGS= $(INCS) $(DEFS) $(WARN) -O28 func.o\
9 hash.o\
10 inout.o\
11 lex.o\
12 mem.o\
13 opcode.o\
14 parser.o\
15 table.o\
16 tree.o\
17 undump.o
12 18
13OBJS= fallback.o func.o hash.o inout.o lex.o mem.o opcode.o parser.o table.o tree.o19SRCS= fallback.c\
14SRCS= fallback.c func.c hash.c inout.c lex.c mem.c opcode.c table.c tree.c fallback.h func.h hash.h inout.h mem.h opcode.h table.h tree.h types.h ugly.h lua.stx20 fallback.h\
21 func.c\
22 func.h\
23 hash.c\
24 hash.h\
25 inout.c\
26 inout.h\
27 lex.c\
28 lex.h\
29 mem.c\
30 mem.h\
31 opcode.c\
32 opcode.h\
33 parser.c\
34 parser.h\
35 table.c\
36 table.h\
37 tree.c\
38 tree.h\
39 types.h\
40 undump.c\
41 undump.h\
42 lua.stx
15 43
16SLIB= $(LIB)/liblua.a44SLIB= $(LIB)/liblua.a
17 45
18# dynamic libraries only work for SunOs
19DLIB= $(LIB)/liblua.so.$(VERSION)
20
21all: $(SLIB)46all: $(SLIB)
22 47
23dynamic: $(DLIB)
24
25$(SLIB): $(OBJS)48$(SLIB): $(OBJS)
26 ar rcuv $@ $(OBJS)49 ar rcuv $@ $(OBJS)
27 ranlib $@50 ranlib $@
28 51
29$(DLIB): $(OBJS)
30 ld -o $@ $(OBJS)
31
32clean:52clean:
33 rm -f $(OBJS) $(SLIB) $(DLIB)53 rm -f $(OBJS) $(SLIB)
34 54
35co:55co:
36 co -f -M $(SRCS)56 co -f -M $(SRCS)
37 yacc -d lua.stx ; mv -f y.tab.c parser.c ; mv -f y.tab.h parser.h57
58parser:
59 yacc -d lua.stx
60 rm -f parser.c parser.h
61 sed -e 's/yy/luaY_/g' y.tab.c > parser.c
62 sed -e 's/yy/luaY_/g' y.tab.h > parser.h
63 rm y.tab.c y.tab.h
38 64
39klean: clean65klean: clean
40 rm -f $(SRCS) parser.c parser.h66 rm -f $(SRCS)
src/fallback.c+53−39
@@ -3,7 +3,7 @@ · 2 unmodified lines
3** TecCGraf - PUC-Rio3** TecCGraf - PUC-Rio
4*/4*/
5 5
6char *rcs_fallback="$Id: fallback.c,v 1.17 1995/10/17 14:30:05 roberto Exp $";6char *rcs_fallback="$Id: fallback.c,v 1.25 1996/04/25 14:10:00 roberto Exp $";
7 7
8#include <stdio.h>8#include <stdio.h>
9#include <string.h>9#include <string.h>
@@ -12,6 +12,7 @@ char *rcs_fallback="$Id: fallback.c,v 1.17 1995/10/17 14:30:05 roberto Exp $"; · 2 unmodified lines
12#include "fallback.h"12#include "fallback.h"
13#include "opcode.h"13#include "opcode.h"
14#include "lua.h"14#include "lua.h"
15#include "table.h"
15 16
16 17
17static void errorFB (void);18static void errorFB (void);
@@ -36,8 +37,10 @@ struct FB luaI_fallBacks[] = { · 18 unmodified lines
36{"concat", {LUA_T_CFUNCTION, {concatFB}}, 2, 1},37{"concat", {LUA_T_CFUNCTION, {concatFB}}, 2, 1},
37{"settable", {LUA_T_CFUNCTION, {gettableFB}}, 3, 0},38{"settable", {LUA_T_CFUNCTION, {gettableFB}}, 3, 0},
38{"gc", {LUA_T_CFUNCTION, {GDFB}}, 1, 0},39{"gc", {LUA_T_CFUNCTION, {GDFB}}, 1, 0},
39{"function", {LUA_T_CFUNCTION, {funcFB}}, -1, -1}40{"function", {LUA_T_CFUNCTION, {funcFB}}, -1, -1},
40 /* no fixed number of params or results */41 /* no fixed number of params or results */
42{"getglobal", {LUA_T_CFUNCTION, {indexFB}}, 1, 1}
43 /* same default behavior of index FB */
41};44};
42 45
43#define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB))46#define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB))
@@ -47,7 +50,7 @@ void luaI_setfallback (void) · 3 unmodified lines
47 int i;50 int i;
48 char *name = lua_getstring(lua_getparam(1));51 char *name = lua_getstring(lua_getparam(1));
49 lua_Object func = lua_getparam(2);52 lua_Object func = lua_getparam(2);
50 if (name == NULL || !(lua_isfunction(func) || lua_iscfunction(func)))53 if (name == NULL || !lua_isfunction(func))
51 lua_error("incorrect argument to function `setfallback'");54 lua_error("incorrect argument to function `setfallback'");
52 for (i=0; i<N_FB; i++)55 for (i=0; i<N_FB; i++)
53 {56 {
@@ -110,66 +113,77 @@ static void funcFB (void) · 56 unmodified lines
110 113
111 114
112/*115/*
113** Lock routines116** Reference routines
114*/117*/
115 118
116static Object *lockArray = NULL;119static struct ref {
117static Word lockSize = 0;120 Object o;
121 enum {LOCK, HOLD, FREE, COLLECTED} status;
122} *refArray = NULL;
123static int refSize = 0;
118 124
119int luaI_lock (Object *object)125int luaI_ref (Object *object, int lock)
120{126{
121 Word i;127 int i;
122 Word oldSize;128 int oldSize;
123 if (tag(object) == LUA_T_NIL)129 if (tag(object) == LUA_T_NIL)
124 return -1;130 return -1; /* special ref for nil */
125 for (i=0; i<lockSize; i++)131 for (i=0; i<refSize; i++)
126 if (tag(&lockArray[i]) == LUA_T_NIL)132 if (refArray[i].status == FREE)
127 {133 goto found;
128 lockArray[i] = *object;
129 return i;
130 }
131 /* no more empty spaces */134 /* no more empty spaces */
132 oldSize = lockSize;135 oldSize = refSize;
133 if (lockArray == NULL)136 refSize = growvector(&refArray, refSize, struct ref, refEM, MAX_WORD);
134 {137 for (i=oldSize; i<refSize; i++)
135 lockSize = 10;138 refArray[i].status = FREE;
136 lockArray = newvector(lockSize, Object);139 i = oldSize;
137 }140 found:
138 else141 refArray[i].o = *object;
139 {142 refArray[i].status = lock ? LOCK : HOLD;
140 lockSize = 3*oldSize/2 + 5;143 return i;
141 lockArray = growvector(lockArray, lockSize, Object);
142 }
143 for (i=oldSize; i<lockSize; i++)
144 tag(&lockArray[i]) = LUA_T_NIL;
145 lockArray[oldSize] = *object;
146 return oldSize;
147}144}
148 145
149 146
150void lua_unlock (int ref)147void lua_unref (int ref)
151{148{
152 tag(&lockArray[ref]) = LUA_T_NIL;149 if (ref >= 0 && ref < refSize)
150 refArray[ref].status = FREE;
153}151}
154 152
155 153
156Object *luaI_getlocked (int ref)154Object *luaI_getref (int ref)
157{155{
158 return &lockArray[ref];156 static Object nul = {LUA_T_NIL, {0}};
157 if (ref == -1)
158 return &nul;
159 if (ref >= 0 && ref < refSize &&
160 (refArray[ref].status == LOCK || refArray[ref].status == HOLD))
161 return &refArray[ref].o;
162 else
163 return NULL;
159}164}
160 165
161 166
162void luaI_travlock (int (*fn)(Object *))167void luaI_travlock (int (*fn)(Object *))
163{168{
164 Word i;169 int i;
165 for (i=0; i<lockSize; i++)170 for (i=0; i<refSize; i++)
166 fn(&lockArray[i]);171 if (refArray[i].status == LOCK)
172 fn(&refArray[i].o);
167}173}
168 174
169 175
176void luaI_invalidaterefs (void)
177{
178 int i;
179 for (i=0; i<refSize; i++)
180 if (refArray[i].status == HOLD && !luaI_ismarked(&refArray[i].o))
181 refArray[i].status = COLLECTED;
182}
183
170char *luaI_travfallbacks (int (*fn)(Object *))184char *luaI_travfallbacks (int (*fn)(Object *))
171{185{
172 Word i;186 int i;
173 for (i=0; i<N_FB; i++)187 for (i=0; i<N_FB; i++)
174 if (fn(&luaI_fallBacks[i].function))188 if (fn(&luaI_fallBacks[i].function))
175 return luaI_fallBacks[i].kind;189 return luaI_fallBacks[i].kind;
src/fallback.h+6−3
@@ -1,10 +1,11 @@
1/*1/*
2** $Id: fallback.h,v 1.10 1995/10/17 11:52:38 roberto Exp $2** $Id: fallback.h,v 1.13 1996/04/25 14:10:00 roberto Exp $
3*/3*/
4 4
5#ifndef fallback_h5#ifndef fallback_h
6#define fallback_h6#define fallback_h
7 7
8#include "lua.h"
8#include "opcode.h"9#include "opcode.h"
9 10
10extern struct FB {11extern struct FB {
@@ -23,11 +24,13 @@ extern struct FB { · 12 unmodified lines
23#define FB_SETTABLE 624#define FB_SETTABLE 6
24#define FB_GC 725#define FB_GC 7
25#define FB_FUNCTION 826#define FB_FUNCTION 8
27#define FB_GETGLOBAL 9
26 28
27void luaI_setfallback (void);29void luaI_setfallback (void);
28int luaI_lock (Object *object);30int luaI_ref (Object *object, int lock);
29Object *luaI_getlocked (int ref);31Object *luaI_getref (int ref);
30void luaI_travlock (int (*fn)(Object *));32void luaI_travlock (int (*fn)(Object *));
33void luaI_invalidaterefs (void);
31char *luaI_travfallbacks (int (*fn)(Object *));34char *luaI_travfallbacks (int (*fn)(Object *));
32 35
33#endif36#endif
src/func.c+80−3
@@ -1,4 +1,4 @@
1#include <stdio.h>1#include <stdlib.h>
2 2
3#include "luadebug.h"3#include "luadebug.h"
4#include "table.h"4#include "table.h"
@@ -6,8 +6,26 @@ · 1 unmodified line
6#include "func.h"6#include "func.h"
7#include "opcode.h"7#include "opcode.h"
8 8
9
9static TFunc *function_root = NULL;10static TFunc *function_root = NULL;
11static LocVar *currvars = NULL;
12static int numcurrvars = 0;
13static int maxcurrvars = 0;
14
10 15
16/*
17** Initialize TFunc struct
18*/
19void luaI_initTFunc (TFunc *f)
20{
21 f->next = NULL;
22 f->marked = 0;
23 f->size = 0;
24 f->code = NULL;
25 f->lineDefined = 0;
26 f->fileName = NULL;
27 f->locvars = NULL;
28}
11 29
12/*30/*
13** Insert function in list for GC31** Insert function in list for GC
@@ -24,9 +42,10 @@ void luaI_insertfunction (TFunc *f) · 10 unmodified lines
24/*42/*
25** Free function43** Free function
26*/44*/
27static void freefunc (TFunc *f)45void luaI_freefunc (TFunc *f)
28{46{
29 luaI_free (f->code);47 luaI_free (f->code);
48 luaI_free (f->locvars);
30 luaI_free (f);49 luaI_free (f);
31}50}
32 51
@@ -48,7 +67,7 @@ Long luaI_funccollector (void) · 15 unmodified lines
48 function_root = next;67 function_root = next;
49 else68 else
50 prev->next = next;69 prev->next = next;
51 freefunc (curr);70 luaI_freefunc (curr);
52 ++counter;71 ++counter;
53 }72 }
54 else73 else
@@ -77,3 +96,61 @@ void lua_funcinfo (lua_Object func, char **filename, int *linedefined) · 22 unmodified lines
77 }96 }
78}97}
79 98
99/*
100** Stores information to know that variable has been declared in given line
101*/
102void luaI_registerlocalvar (TaggedString *varname, int line)
103{
104 if (numcurrvars >= maxcurrvars)
105 maxcurrvars = growvector(&currvars, maxcurrvars, LocVar, "", MAX_WORD);
106 currvars[numcurrvars].varname = varname;
107 currvars[numcurrvars].line = line;
108 numcurrvars++;
109}
110
111/*
112** Stores information to know that variable has been out of scope in given line
113*/
114void luaI_unregisterlocalvar (int line)
115{
116 luaI_registerlocalvar(NULL, line);
117}
118
119/*
120** Copies "currvars" into a new area and store it in function header.
121** The values (varname = NULL, line = -1) signal the end of vector.
122*/
123void luaI_closelocalvars (TFunc *func)
124{
125 func->locvars = newvector (numcurrvars+1, LocVar);
126 memcpy (func->locvars, currvars, numcurrvars*sizeof(LocVar));
127 func->locvars[numcurrvars].varname = NULL;
128 func->locvars[numcurrvars].line = -1;
129 numcurrvars = 0; /* prepares for next function */
130}
131
132/*
133** Look for n-esim local variable at line "line" in function "func".
134** Returns NULL if not found.
135*/
136char *luaI_getlocalname (TFunc *func, int local_number, int line)
137{
138 int count = 0;
139 char *varname = NULL;
140 LocVar *lv = func->locvars;
141 if (lv == NULL)
142 return NULL;
143 for (; lv->line != -1 && lv->line < line; lv++)
144 {
145 if (lv->varname) /* register */
146 {
147 if (++count == local_number)
148 varname = lv->varname->str;
149 }
150 else /* unregister */
151 if (--count < local_number)
152 varname = NULL;
153 }
154 return varname;
155}
156
src/func.h+22−2
@@ -1,24 +1,44 @@
1/*
2** $Id: func.h,v 1.8 1996/03/14 15:54:20 roberto Exp $
3*/
4
1#ifndef func_h5#ifndef func_h
2#define func_h6#define func_h
3 7
4#include "types.h"8#include "types.h"
5#include "lua.h"9#include "lua.h"
10#include "tree.h"
11
12typedef struct LocVar
13{
14 TaggedString *varname; /* NULL signals end of scope */
15 int line;
16} LocVar;
17
6 18
7/*19/*
8** Header para funcoes.20** Function Headers
9*/21*/
10typedef struct TFunc22typedef struct TFunc
11{23{
12 struct TFunc *next;24 struct TFunc *next;
13 char marked;25 int marked;
14 int size;26 int size;
15 Byte *code;27 Byte *code;
16 int lineDefined;28 int lineDefined;
17 char *fileName;29 char *fileName;
30 LocVar *locvars;
18} TFunc;31} TFunc;
19 32
20Long luaI_funccollector (void);33Long luaI_funccollector (void);
21void luaI_insertfunction (TFunc *f);34void luaI_insertfunction (TFunc *f);
22 35
36void luaI_initTFunc (TFunc *f);
37void luaI_freefunc (TFunc *f);
38
39void luaI_registerlocalvar (TaggedString *varname, int line);
40void luaI_unregisterlocalvar (int line);
41void luaI_closelocalvars (TFunc *func);
42char *luaI_getlocalname (TFunc *func, int local_number, int line);
23 43
24#endif44#endif
src/hash.c+29−41
@@ -3,9 +3,8 @@ · 2 unmodified lines
3** hash manager for lua3** hash manager for lua
4*/4*/
5 5
6char *rcs_hash="$Id: hash.c,v 2.26 1995/10/04 14:20:26 roberto Exp $";6char *rcs_hash="$Id: hash.c,v 2.30 1996/05/06 14:30:27 roberto Exp $";
7 7
8#include <string.h>
9 8
10#include "mem.h"9#include "mem.h"
11#include "opcode.h"10#include "opcode.h"
@@ -13,7 +12,6 @@ char *rcs_hash="$Id: hash.c,v 2.26 1995/10/04 14:20:26 roberto Exp $"; · 1 unmodified line
13#include "table.h"12#include "table.h"
14#include "lua.h"13#include "lua.h"
15 14
16#define streq(s1,s2) (s1 == s2 || (*(s1) == *(s2) && strcmp(s1,s2)==0))
17 15
18#define nhash(t) ((t)->nhash)16#define nhash(t) ((t)->nhash)
19#define nuse(t) ((t)->nuse)17#define nuse(t) ((t)->nuse)
@@ -24,22 +22,22 @@ char *rcs_hash="$Id: hash.c,v 2.26 1995/10/04 14:20:26 roberto Exp $"; · 4 unmodified lines
24#define val(n) (&(n)->val)22#define val(n) (&(n)->val)
25 23
26 24
27#define REHASH_LIMIT 0.70 /* avoid more than this % full */25#define REHASH_LIMIT 0.70 /* avoid more than this % full */
28 26
29 27
30static Hash *listhead = NULL;28static Hash *listhead = NULL;
31 29
32 30
33
34/* hash dimensions values */31/* hash dimensions values */
35static Word dimensions[] = 32static Long dimensions[] =
36 {3, 5, 7, 11, 23, 47, 97, 197, 397, 797, 1597, 3203, 6421,33 {3L, 5L, 7L, 11L, 23L, 47L, 97L, 197L, 397L, 797L, 1597L, 3203L, 6421L,
37 12853, 25717, 51437, 65521, 0}; /* 65521 == last prime < MAX_WORD */34 12853L, 25717L, 51437L, 102811L, 205619L, 411233L, 822433L,
35 1644817L, 3289613L, 6579211L, 13158023L, MAX_INT};
38 36
39static Word redimension (Word nhash)37int luaI_redimension (int nhash)
40{38{
41 Word i;39 int i;
42 for (i=0; dimensions[i]!=0; i++)40 for (i=0; dimensions[i]<MAX_INT; i++)
43 {41 {
44 if (dimensions[i] > nhash)42 if (dimensions[i] > nhash)
45 return dimensions[i];43 return dimensions[i];
@@ -48,7 +46,7 @@ static Word redimension (Word nhash) · 2 unmodified lines
48 return 0; /* to avoid warnings */46 return 0; /* to avoid warnings */
49}47}
50 48
51static Word hashindex (Hash *t, Object *ref) /* hash function */49static int hashindex (Hash *t, Object *ref) /* hash function */
52{50{
53 switch (tag(ref))51 switch (tag(ref))
54 {52 {
@@ -56,19 +54,9 @@ static Word hashindex (Hash *t, Object *ref) /* hash function */ · 1 unmodified line
56 lua_error ("unexpected type to index table");54 lua_error ("unexpected type to index table");
57 return -1; /* UNREACHEABLE */55 return -1; /* UNREACHEABLE */
58 case LUA_T_NUMBER:56 case LUA_T_NUMBER:
59 return (((Word)nvalue(ref))%nhash(t));57 return (((int)nvalue(ref))%nhash(t));
60 case LUA_T_STRING:58 case LUA_T_STRING:
61 {59 return (int)((tsvalue(ref)->hash)%nhash(t)); /* make it a valid index */
62 unsigned long h = tsvalue(ref)->hash;
63 if (h == 0)
64 {
65 char *name = svalue(ref);
66 while (*name)
67 h = ((h<<5)-h)^(unsigned char)*(name++);
68 tsvalue(ref)->hash = h;
69 }
70 return (Word)h%nhash(t); /* make it a valid index */
71 }
72 case LUA_T_FUNCTION:60 case LUA_T_FUNCTION:
73 return (((IntPoint)ref->value.tf)%nhash(t));61 return (((IntPoint)ref->value.tf)%nhash(t));
74 case LUA_T_CFUNCTION:62 case LUA_T_CFUNCTION:
@@ -80,14 +68,14 @@ static Word hashindex (Hash *t, Object *ref) /* hash function */ · 5 unmodified lines
80 }68 }
81}69}
82 70
83Bool lua_equalObj (Object *t1, Object *t2)71int lua_equalObj (Object *t1, Object *t2)
84{72{
85 if (tag(t1) != tag(t2)) return 0;73 if (tag(t1) != tag(t2)) return 0;
86 switch (tag(t1))74 switch (tag(t1))
87 {75 {
88 case LUA_T_NIL: return 1;76 case LUA_T_NIL: return 1;
89 case LUA_T_NUMBER: return nvalue(t1) == nvalue(t2);77 case LUA_T_NUMBER: return nvalue(t1) == nvalue(t2);
90 case LUA_T_STRING: return streq(svalue(t1), svalue(t2));78 case LUA_T_STRING: return svalue(t1) == svalue(t2);
91 case LUA_T_ARRAY: return avalue(t1) == avalue(t2);79 case LUA_T_ARRAY: return avalue(t1) == avalue(t2);
92 case LUA_T_FUNCTION: return t1->value.tf == t2->value.tf;80 case LUA_T_FUNCTION: return t1->value.tf == t2->value.tf;
93 case LUA_T_CFUNCTION: return fvalue(t1) == fvalue(t2);81 case LUA_T_CFUNCTION: return fvalue(t1) == fvalue(t2);
@@ -95,9 +83,9 @@ Bool lua_equalObj (Object *t1, Object *t2) · 1 unmodified line
95 }83 }
96}84}
97 85
98static Word present (Hash *t, Object *ref)86static int present (Hash *t, Object *ref)
99{ 87{
100 Word h = hashindex(t, ref);88 int h = hashindex(t, ref);
101 while (tag(ref(node(t, h))) != LUA_T_NIL)89 while (tag(ref(node(t, h))) != LUA_T_NIL)
102 {90 {
103 if (lua_equalObj(ref, ref(node(t, h))))91 if (lua_equalObj(ref, ref(node(t, h))))
@@ -111,9 +99,9 @@ static Word present (Hash *t, Object *ref) · 7 unmodified lines
111/*99/*
112** Alloc a vector node 100** Alloc a vector node
113*/101*/
114static Node *hashnodecreate (Word nhash)102static Node *hashnodecreate (int nhash)
115{103{
116 Word i;104 int i;
117 Node *v = newvector (nhash, Node);105 Node *v = newvector (nhash, Node);
118 for (i=0; i<nhash; i++)106 for (i=0; i<nhash; i++)
119 tag(ref(&v[i])) = LUA_T_NIL;107 tag(ref(&v[i])) = LUA_T_NIL;
@@ -123,10 +111,10 @@ static Node *hashnodecreate (Word nhash) · 3 unmodified lines
123/*111/*
124** Create a new hash. Return the hash pointer or NULL on error.112** Create a new hash. Return the hash pointer or NULL on error.
125*/113*/
126static Hash *hashcreate (Word nhash)114static Hash *hashcreate (int nhash)
127{115{
128 Hash *t = new(Hash);116 Hash *t = new(Hash);
129 nhash = redimension((Word)((float)nhash/REHASH_LIMIT));117 nhash = luaI_redimension((int)((float)nhash/REHASH_LIMIT));
130 nodevector(t) = hashnodecreate(nhash);118 nodevector(t) = hashnodecreate(nhash);
131 nhash(t) = nhash;119 nhash(t) = nhash;
132 nuse(t) = 0;120 nuse(t) = 0;
@@ -151,7 +139,7 @@ void lua_hashmark (Hash *h) · 18 unmodified lines
151{139{
152 if (markarray(h) == 0)140 if (markarray(h) == 0)
153 {141 {
154 Word i;142 int i;
155 markarray(h) = 1;143 markarray(h) = 1;
156 for (i=0; i<nhash(h); i++)144 for (i=0; i<nhash(h); i++)
157 {145 {
@@ -218,7 +206,7 @@ Long lua_hashcollector (void) · 60 unmodified lines
218** executes garbage collection if the number of arrays created206** executes garbage collection if the number of arrays created
219** exceed a pre-defined range.207** exceed a pre-defined range.
220*/208*/
221Hash *lua_createarray (Word nhash)209Hash *lua_createarray (int nhash)
222{210{
223 Hash *array;211 Hash *array;
224 lua_pack();212 lua_pack();
@@ -234,10 +222,10 @@ Hash *lua_createarray (Word nhash) · 9 unmodified lines
234*/222*/
235static void rehash (Hash *t)223static void rehash (Hash *t)
236{224{
237 Word i;225 int i;
238 Word nold = nhash(t);226 int nold = nhash(t);
239 Node *vold = nodevector(t);227 Node *vold = nodevector(t);
240 nhash(t) = redimension(nhash(t));228 nhash(t) = luaI_redimension(nhash(t));
241 nodevector(t) = hashnodecreate(nhash(t));229 nodevector(t) = hashnodecreate(nhash(t));
242 for (i=0; i<nold; i++)230 for (i=0; i<nold; i++)
243 {231 {
@@ -254,7 +242,7 @@ static void rehash (Hash *t) · 10 unmodified lines
254*/242*/
255Object *lua_hashget (Hash *t, Object *ref)243Object *lua_hashget (Hash *t, Object *ref)
256{244{
257 Word h = present(t, ref);245 int h = present(t, ref);
258 if (tag(ref(node(t, h))) != LUA_T_NIL) return val(node(t, h));246 if (tag(ref(node(t, h))) != LUA_T_NIL) return val(node(t, h));
259 else return NULL;247 else return NULL;
260}248}
@@ -266,7 +254,7 @@ Object *lua_hashget (Hash *t, Object *ref) · 5 unmodified lines
266*/254*/
267Object *lua_hashdefine (Hash *t, Object *ref)255Object *lua_hashdefine (Hash *t, Object *ref)
268{256{
269 Word h;257 int h;
270 Node *n;258 Node *n;
271 h = present(t, ref);259 h = present(t, ref);
272 n = node(t, h);260 n = node(t, h);
@@ -292,7 +280,7 @@ Object *lua_hashdefine (Hash *t, Object *ref) · 19 unmodified lines
292** in the hash.280** in the hash.
293** This function pushs the element value and its reference to the stack.281** This function pushs the element value and its reference to the stack.
294*/282*/
295static void hashnext (Hash *t, Word i)283static void hashnext (Hash *t, int i)
296{284{
297 if (i >= nhash(t))285 if (i >= nhash(t))
298 {286 {
@@ -329,7 +317,7 @@ void lua_next (void) · 30 unmodified lines
329 }317 }
330 else318 else
331 {319 {
332 Word h = present (t, luaI_Address(r));320 int h = present (t, luaI_Address(r));
333 hashnext(t, h+1);321 hashnext(t, h+1);
334 }322 }
335}323}
src/hash.h+8−7
@@ -1,14 +1,14 @@
1/*1/*
2** hash.h2** hash.h
3** hash manager for lua3** hash manager for lua
4** Luiz Henrique de Figueiredo - 17 Aug 904** $Id: hash.h,v 2.12 1996/05/06 14:30:27 roberto Exp $
5** $Id: hash.h,v 2.8 1995/01/12 14:19:04 roberto Exp $
6*/5*/
7 6
8#ifndef hash_h7#ifndef hash_h
9#define hash_h8#define hash_h
10 9
11#include "types.h"10#include "types.h"
11#include "opcode.h"
12 12
13typedef struct node13typedef struct node
14{14{
@@ -19,15 +19,16 @@ typedef struct node · 4 unmodified lines
19typedef struct Hash19typedef struct Hash
20{20{
21 struct Hash *next;21 struct Hash *next;
22 char mark;
23 Word nhash;
24 Word nuse;
25 Node *node;22 Node *node;
23 int nhash;
24 int nuse;
25 char mark;
26} Hash;26} Hash;
27 27
28 28
29Bool lua_equalObj (Object *t1, Object *t2);29int lua_equalObj (Object *t1, Object *t2);
30Hash *lua_createarray (Word nhash);30int luaI_redimension (int nhash);
31Hash *lua_createarray (int nhash);
31void lua_hashmark (Hash *h);32void lua_hashmark (Hash *h);
32Long lua_hashcollector (void);33Long lua_hashcollector (void);
33Object *lua_hashget (Hash *t, Object *ref);34Object *lua_hashget (Hash *t, Object *ref);
src/inout.c+78−52
@@ -5,31 +5,21 @@ · 4 unmodified lines
5** Also provides some predefined lua functions.5** Also provides some predefined lua functions.
6*/6*/
7 7
8char *rcs_inout="$Id: inout.c,v 2.25 1995/10/25 13:05:51 roberto Exp $";8char *rcs_inout="$Id: inout.c,v 2.36 1996/03/19 22:28:37 roberto Exp $";
9 9
10#include <stdio.h>10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13 11
14#include "mem.h"12#include "lex.h"
15#include "opcode.h"13#include "opcode.h"
16#include "hash.h"
17#include "inout.h"14#include "inout.h"
18#include "table.h"15#include "table.h"
19#include "tree.h"16#include "tree.h"
20#include "lua.h"17#include "lua.h"
21 18#include "mem.h"
22
23#ifndef MAXFUNCSTACK
24#define MAXFUNCSTACK 100
25#endif
26
27#define MAXMESSAGE MAXFUNCSTACK*80
28 19
29 20
30/* Exported variables */21/* Exported variables */
31Word lua_linenumber;22Word lua_linenumber;
32Bool lua_debug = 0;
33char *lua_parsedfile;23char *lua_parsedfile;
34 24
35 25
@@ -54,9 +44,9 @@ static int stringinput (void) · 18 unmodified lines
54 44
55/*45/*
56** Function to open a file to be input unit. 46** Function to open a file to be input unit.
57** Return 0 on success or error message on error.47** Return the file.
58*/48*/
59char *lua_openfile (char *fn)49FILE *lua_openfile (char *fn)
60{50{
61 lua_setinput (fileinput);51 lua_setinput (fileinput);
62 if (fn == NULL)52 if (fn == NULL)
@@ -67,14 +57,10 @@ char *lua_openfile (char *fn) · 4 unmodified lines
67 else57 else
68 fp = fopen (fn, "r");58 fp = fopen (fn, "r");
69 if (fp == NULL)59 if (fp == NULL)
70 {60 return NULL;
71 static char buff[255];
72 sprintf(buff, "unable to open file `%.200s'", fn);
73 return buff;
74 }
75 lua_linenumber = 1;61 lua_linenumber = 1;
76 lua_parsedfile = lua_constcreate(fn)->ts.str;62 lua_parsedfile = luaI_createfixedstring(fn)->str;
77 return NULL;63 return fp;
78}64}
79 65
80/*66/*
@@ -97,7 +83,7 @@ void lua_openstring (char *s) · 16 unmodified lines
97 lua_setinput (stringinput);83 lua_setinput (stringinput);
98 st = s;84 st = s;
99 lua_linenumber = 1;85 lua_linenumber = 1;
100 lua_parsedfile = lua_constcreate("(string)")->ts.str;86 lua_parsedfile = luaI_createfixedstring("(string)")->str;
101}87}
102 88
103/*89/*
@@ -126,33 +112,57 @@ void lua_internaldostring (void) · 22 unmodified lines
126void lua_internaldofile (void)112void lua_internaldofile (void)
127{113{
128 lua_Object obj = lua_getparam (1);114 lua_Object obj = lua_getparam (1);
129 if (lua_isstring(obj) && !lua_dofile(lua_getstring(obj)))115 char *fname = NULL;
116 if (lua_isstring(obj))
117 fname = lua_getstring(obj);
118 else if (obj != LUA_NOOBJECT)
119 lua_error("invalid argument to function `dofile'");
120 /* else fname = NULL */
121 if (!lua_dofile(fname))
130 lua_pushnumber(1);122 lua_pushnumber(1);
131 else123 else
132 lua_pushnil();124 lua_pushnil();
133}125}
134 126
135/*127
136** Internal function: print object values128static char *tostring (lua_Object obj)
137*/
138void lua_print (void)
139{129{
140 int i=1;130 char *buff = luaI_buffer(20);
141 lua_Object obj;131 if (lua_isstring(obj)) /* get strings and numbers */
142 while ((obj=lua_getparam (i++)) != LUA_NOOBJECT)132 return lua_getstring(obj);
143 {133 else switch(lua_type(obj))
144 if (lua_isnumber(obj)) printf("%g\n",lua_getnumber(obj));134 {
145 else if (lua_isstring(obj)) printf("%s\n",lua_getstring(obj));135 case LUA_T_FUNCTION:
146 else if (lua_isfunction(obj)) printf("function: %p\n",(luaI_Address(obj))->value.tf);136 sprintf(buff, "function: %p", (luaI_Address(obj))->value.tf);
147 else if (lua_iscfunction(obj)) printf("cfunction: %p\n",lua_getcfunction(obj)137 break;
148);138 case LUA_T_CFUNCTION:
149 else if (lua_isuserdata(obj)) printf("userdata: %p\n",lua_getuserdata(obj));139 sprintf(buff, "cfunction: %p", lua_getcfunction(obj));
150 else if (lua_istable(obj)) printf("table: %p\n",avalue(luaI_Address(obj)));140 break;
151 else if (lua_isnil(obj)) printf("nil\n");141 case LUA_T_ARRAY:
152 else printf("invalid value to print\n");142 sprintf(buff, "table: %p", avalue(luaI_Address(obj)));
153 }143 break;
144 case LUA_T_NIL:
145 sprintf(buff, "nil");
146 break;
147 default:
148 sprintf(buff, "userdata: %p", lua_getuserdata(obj));
149 break;
150 }
151 return buff;
154}152}
155 153
154void luaI_tostring (void)
155{
156 lua_pushstring(tostring(lua_getparam(1)));
157}
158
159void luaI_print (void)
160{
161 int i = 1;
162 lua_Object obj;
163 while ((obj = lua_getparam(i++)) != LUA_NOOBJECT)
164 printf("%s\n", tostring(obj));
165}
156 166
157/*167/*
158** Internal function: return an object type.168** Internal function: return an object type.
@@ -196,16 +206,7 @@ void lua_obj2number (void) · 37 unmodified lines
196{206{
197 lua_Object o = lua_getparam(1);207 lua_Object o = lua_getparam(1);
198 if (lua_isnumber(o))208 if (lua_isnumber(o))
199 lua_pushobject(o);209 lua_pushnumber(lua_getnumber(o));
200 else if (lua_isstring(o))
201 {
202 char c;
203 float f;
204 if (sscanf(lua_getstring(o),"%f %c",&f,&c) == 1)
205 lua_pushnumber(f);
206 else
207 lua_pushnil();
208 }
209 else210 else
210 lua_pushnil();211 lua_pushnil();
211}212}
@@ -218,3 +219,28 @@ void luaI_error (void) · 6 unmodified lines
218 lua_error(s);219 lua_error(s);
219}220}
220 221
222void luaI_assert (void)
223{
224 lua_Object p = lua_getparam(1);
225 if (p == LUA_NOOBJECT || lua_isnil(p))
226 lua_error("assertion failed!");
227}
228
229void luaI_setglobal (void)
230{
231 lua_Object name = lua_getparam(1);
232 lua_Object value = lua_getparam(2);
233 if (!lua_isstring(name))
234 lua_error("incorrect argument to function `setglobal'");
235 lua_pushobject(value);
236 lua_storeglobal(lua_getstring(name));
237 lua_pushobject(value); /* return given value */
238}
239
240void luaI_getglobal (void)
241{
242 lua_Object name = lua_getparam(1);
243 if (!lua_isstring(name))
244 lua_error("incorrect argument to function `getglobal'");
245 lua_pushobject(lua_getglobal(lua_getstring(name)));
246}
src/inout.h+8−4
@@ -1,5 +1,5 @@
1/*1/*
2** $Id: inout.h,v 1.10 1995/10/17 11:58:41 roberto Exp $2** $Id: inout.h,v 1.15 1996/03/15 18:21:58 roberto Exp $
3*/3*/
4 4
5 5
@@ -7,23 +7,27 @@ · 1 unmodified line
7#define inout_h7#define inout_h
8 8
9#include "types.h"9#include "types.h"
10#include <stdio.h>
10 11
11 12
12extern Word lua_linenumber;13extern Word lua_linenumber;
13extern Bool lua_debug;
14extern Word lua_debugline;14extern Word lua_debugline;
15extern char *lua_parsedfile;15extern char *lua_parsedfile;
16 16
17char *lua_openfile (char *fn);17FILE *lua_openfile (char *fn);
18void lua_closefile (void);18void lua_closefile (void);
19void lua_openstring (char *s);19void lua_openstring (char *s);
20void lua_closestring (void);20void lua_closestring (void);
21 21
22void lua_internaldofile (void);22void lua_internaldofile (void);
23void lua_internaldostring (void);23void lua_internaldostring (void);
24void lua_print (void);24void luaI_tostring (void);
25void luaI_print (void);
25void luaI_type (void);26void luaI_type (void);
26void lua_obj2number (void);27void lua_obj2number (void);
27void luaI_error (void);28void luaI_error (void);
29void luaI_assert (void);
30void luaI_setglobal (void);
31void luaI_getglobal (void);
28 32
29#endif33#endif
src/lex.c+30−61
@@ -1,23 +1,19 @@
1char *rcs_lex = "$Id: lex.c,v 2.21 1995/11/16 20:46:24 roberto Exp $";1char *rcs_lex = "$Id: lex.c,v 2.32 1996/03/21 16:33:47 roberto Exp $";
2 2
3 3
4#include <ctype.h>4#include <ctype.h>
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>5#include <string.h>
8 6
9#include "mem.h"7#include "mem.h"
10#include "tree.h"8#include "tree.h"
11#include "table.h"9#include "table.h"
12#include "opcode.h"10#include "lex.h"
13#include "inout.h"11#include "inout.h"
12#include "luadebug.h"
14#include "parser.h"13#include "parser.h"
15#include "ugly.h"
16 14
17#define MINBUFF 26015#define MINBUFF 260
18 16
19#define lua_strcmp(a,b) (a[0]<b[0]?(-1):(a[0]>b[0]?(1):strcmp(a,b)))
20
21#define next() { current = input(); }17#define next() { current = input(); }
22#define save(x) { *yytextLast++ = (x); }18#define save(x) { *yytextLast++ = (x); }
23#define save_and_next() { save(current); next(); }19#define save_and_next() { save(current); next(); }
@@ -47,7 +43,6 @@ char *lua_lasttext (void) · 23 unmodified lines
47}43}
48 44
49 45
50/* The reserved words must be listed in lexicographic order */
51static struct46static struct
52 {47 {
53 char *name;48 char *name;
@@ -74,30 +69,21 @@ static struct · 20 unmodified lines
74#define RESERVEDSIZE (sizeof(reserved)/sizeof(reserved[0]))69#define RESERVEDSIZE (sizeof(reserved)/sizeof(reserved[0]))
75 70
76 71
77static int findReserved (char *name)72void luaI_addReserved (void)
78{73{
79 int l = 0;74 int i;
80 int h = RESERVEDSIZE - 1;75 for (i=0; i<RESERVEDSIZE; i++)
81 while (l <= h)
82 {76 {
83 int m = (l+h)/2;77 TaggedString *ts = lua_createstring(reserved[i].name);
84 int comp = lua_strcmp(name, reserved[m].name);78 ts->marked = reserved[i].token; /* reserved word (always > 255) */
85 if (comp < 0)
86 h = m-1;
87 else if (comp == 0)
88 return reserved[m].token;
89 else
90 l = m+1;
91 }79 }
92 return 0;
93}80}
94 81
95 82
96static void growtext (void)83static void growtext (void)
97{84{
98 int size = yytextLast - yytext;85 int size = yytextLast - yytext;
99 textsize *= 2;86 textsize = growvector(&yytext, textsize, char, lexEM, MAX_WORD);
100 yytext = growvector(yytext, textsize, char);
101 yytextLast = yytext + size;87 yytextLast = yytext + size;
102}88}
103 89
@@ -144,9 +130,9 @@ static int read_long_string (void) · 40 unmodified lines
144}130}
145 131
146 132
147int yylex (void)133int luaY_lex (void)
148{134{
149 float a;135 double a;
150 static int linelasttoken = 0;136 static int linelasttoken = 0;
151 if (lua_debug)137 if (lua_debug)
152 luaI_codedebugline(linelasttoken);138 luaI_codedebugline(linelasttoken);
@@ -154,9 +140,6 @@ int yylex (void) · 1 unmodified line
154 while (1)140 while (1)
155 {141 {
156 yytextLast = yytext;142 yytextLast = yytext;
157#if 0
158 fprintf(stderr,"'%c' %d\n",current,current);
159#endif
160 switch (current)143 switch (current)
161 {144 {
162 case EOF:145 case EOF:
@@ -174,22 +157,21 @@ int yylex (void) · 11 unmodified lines
174 while (isalnum(current) || current == '_')157 while (isalnum(current) || current == '_')
175 save_and_next();158 save_and_next();
176 *yytextLast = 0;159 *yytextLast = 0;
177 if (lua_strcmp(yytext, "debug") == 0)160 if (strcmp(yytext, "debug") == 0)
178 {161 {
179 yylval.vInt = 1;162 luaY_lval.vInt = 1;
180 return DEBUG;163 return DEBUG;
181 }164 }
182 else if (lua_strcmp(yytext, "nodebug") == 0)165 else if (strcmp(yytext, "nodebug") == 0)
183 {166 {
184 yylval.vInt = 0;167 luaY_lval.vInt = 0;
185 return DEBUG;168 return DEBUG;
186 }169 }
187 return WRONGTOKEN;170 return WRONGTOKEN;
188 171
189 case '-':172 case '-':
190 save_and_next();173 save_and_next();
191 if (current != '-') return '-'; /* else goes through */174 if (current != '-') return '-';
192 case '#':
193 do { next(); } while (current != '\n' && current != 0);175 do { next(); } while (current != '\n' && current != 0);
194 continue;176 continue;
195 177
@@ -203,7 +185,7 @@ int yylex (void) · 7 unmodified lines
203 return WRONGTOKEN;185 return WRONGTOKEN;
204 save_and_next(); /* pass the second ']' */186 save_and_next(); /* pass the second ']' */
205 *(yytextLast-2) = 0; /* erases ']]' */187 *(yytextLast-2) = 0; /* erases ']]' */
206 yylval.vWord = luaI_findconstantbyname(yytext+2);188 luaY_lval.vWord = luaI_findconstantbyname(yytext+2);
207 return STRING;189 return STRING;
208 }190 }
209 191
@@ -254,6 +236,7 @@ int yylex (void) · 44 unmodified lines
254 case 'n': save('\n'); next(); break;236 case 'n': save('\n'); next(); break;
255 case 't': save('\t'); next(); break;237 case 't': save('\t'); next(); break;
256 case 'r': save('\r'); next(); break;238 case 'r': save('\r'); next(); break;
239 case '\n': lua_linenumber++; /* goes through */
257 default : save(current); next(); break;240 default : save(current); next(); break;
258 }241 }
259 break;242 break;
@@ -263,7 +246,7 @@ int yylex (void) · 3 unmodified lines
263 }246 }
264 next(); /* skip the delimiter */247 next(); /* skip the delimiter */
265 *yytextLast = 0;248 *yytextLast = 0;
266 yylval.vWord = luaI_findconstantbyname(yytext);249 luaY_lval.vWord = luaI_findconstantbyname(yytext);
267 return STRING;250 return STRING;
268 }251 }
269 252
@@ -281,12 +264,14 @@ int yylex (void) · 11 unmodified lines
281 case 'Z':264 case 'Z':
282 case '_':265 case '_':
283 {266 {
284 Word res;267 TaggedString *ts;
285 do { save_and_next(); } while (isalnum(current) || current == '_');268 do { save_and_next(); } while (isalnum(current) || current == '_');
286 *yytextLast = 0;269 *yytextLast = 0;
287 res = findReserved(yytext);270 ts = lua_createstring(yytext);
288 if (res) return res;271 if (ts->marked > 2)
289 yylval.pNode = lua_constcreate(yytext);272 return ts->marked; /* reserved word */
273 luaY_lval.pTStr = ts;
274 ts->marked = 2; /* avoid GC */
290 return NAME;275 return NAME;
291 }276 }
292 277
@@ -305,48 +290,32 @@ int yylex (void) · 12 unmodified lines
305 case '0': case '1': case '2': case '3': case '4':290 case '0': case '1': case '2': case '3': case '4':
306 case '5': case '6': case '7': case '8': case '9':291 case '5': case '6': case '7': case '8': case '9':
307 a=0.0;292 a=0.0;
308 do { a=10*a+current-'0'; save_and_next(); } while (isdigit(current));293 do { a=10.0*a+(current-'0'); save_and_next(); } while (isdigit(current));
309 if (current == '.') save_and_next();294 if (current == '.') save_and_next();
310fraction:295fraction:
311 { float da=0.1;296 { double da=0.1;
312 while (isdigit(current))297 while (isdigit(current))
313 {a+=(current-'0')*da; da/=10.0; save_and_next()};298 {a+=(current-'0')*da; da/=10.0; save_and_next()};
314 if (current == 'e' || current == 'E')299 if (current == 'e' || current == 'E')
315 {300 {
316 int e=0;301 int e=0;
317 int neg;302 int neg;
318 float ea;303 double ea;
319 save_and_next();304 save_and_next();
320 neg=(current=='-');305 neg=(current=='-');
321 if (current == '+' || current == '-') save_and_next();306 if (current == '+' || current == '-') save_and_next();
322 if (!isdigit(current)) return WRONGTOKEN;307 if (!isdigit(current)) return WRONGTOKEN;
323 do { e=10*e+current-'0'; save_and_next(); } while (isdigit(current));308 do { e=10.0*e+(current-'0'); save_and_next(); } while (isdigit(current));
324 for (ea=neg?0.1:10.0; e>0; e>>=1) 309 for (ea=neg?0.1:10.0; e>0; e>>=1)
325 {310 {
326 if (e & 1) a*=ea;311 if (e & 1) a*=ea;
327 ea*=ea;312 ea*=ea;
328 }313 }
329 }314 }
330 yylval.vFloat = a;315 luaY_lval.vFloat = a;
331 return NUMBER;316 return NUMBER;
332 }317 }
333 318
334 case U_and: case U_do: case U_else: case U_elseif: case U_end:
335 case U_function: case U_if: case U_local: case U_nil: case U_not:
336 case U_or: case U_repeat: case U_return: case U_then:
337 case U_until: case U_while:
338 {
339 int old = current;
340 next();
341 return reserved[old-U_and].token;
342 }
343
344 case U_eq: next(); return EQ;
345 case U_le: next(); return LE;
346 case U_ge: next(); return GE;
347 case U_ne: next(); return NE;
348 case U_sc: next(); return CONC;
349
350 default: /* also end of file */319 default: /* also end of file */
351 {320 {
352 save_and_next();321 save_and_next();
src/lex.h+19−0
@@ -0,0 +1,19 @@
1/*
2** lex.h
3** TecCGraf - PUC-Rio
4** $Id: lex.h,v 1.2 1996/02/14 13:35:51 roberto Exp $
5*/
6
7#ifndef lex_h
8#define lex_h
9
10
11typedef int (*Input) (void);
12
13void lua_setinput (Input fn);
14char *lua_lasttext (void);
15int luaY_lex (void);
16void luaI_addReserved (void);
17
18
19#endif
src/lua.stx+47−273
@@ -1,12 +1,13 @@
1%{1%{
2 2
3char *rcs_luastx = "$Id: lua.stx,v 3.25 1995/10/26 17:02:50 roberto Exp $";3char *rcs_luastx = "$Id: lua.stx,v 3.36 1996/03/21 16:31:32 roberto Exp $";
4 4
5#include <stdio.h>5#include <stdio.h>
6#include <stdlib.h>6#include <stdlib.h>
7#include <string.h>
8 7
8#include "luadebug.h"
9#include "mem.h"9#include "mem.h"
10#include "lex.h"
10#include "opcode.h"11#include "opcode.h"
11#include "hash.h"12#include "hash.h"
12#include "inout.h"13#include "inout.h"
@@ -30,7 +31,7 @@ int yyparse (void); · 17 unmodified lines
30#endif31#endif
31static int maxcode;32static int maxcode;
32static int maxmain;33static int maxmain;
33static Long maxcurr; /* to allow maxcurr *= 2 without overflow */34static int maxcurr;
34static Byte *funcCode = NULL;35static Byte *funcCode = NULL;
35static Byte **initcode;36static Byte **initcode;
36static Byte *basepc;37static Byte *basepc;
@@ -44,35 +45,32 @@ static Long varbuffer[MAXVAR]; /* variables in an assignment list; · 7 unmodified lines
44static int nvarbuffer=0; /* number of variables at a list */45static int nvarbuffer=0; /* number of variables at a list */
45 46
46#define MAXLOCALS 3247#define MAXLOCALS 32
47static Word localvar[MAXLOCALS]; /* store local variable names */48static TaggedString *localvar[MAXLOCALS]; /* store local variable names */
48static int nlocalvar=0; /* number of local variables */49static int nlocalvar=0; /* number of local variables */
49 50
50#define MAXFIELDS FIELDS_PER_FLUSH*251#define MAXFIELDS FIELDS_PER_FLUSH*2
51static Word fields[MAXFIELDS]; /* fieldnames to be flushed */52static Word fields[MAXFIELDS]; /* fieldnames to be flushed */
52static int nfields=0;53static int nfields=0;
53 54
55int lua_debug = 0;
54 56
55/* Internal functions */57/* Internal functions */
56 58
57static void yyerror (char *s)59static void yyerror (char *s)
58{60{
59 static char msg[256];61 char msg[256];
60 sprintf (msg,"%s near \"%s\" at line %d in file `%s'",62 char *token = lua_lasttext();
61 s, lua_lasttext (), lua_linenumber, lua_parsedfile);63 if (token[0] == 0)
64 token = "<eof>";
65 sprintf (msg,"%s; last token read: \"%s\" at line %d in file `%s'",
66 s, token, lua_linenumber, lua_parsedfile);
62 lua_error (msg);67 lua_error (msg);
63}68}
64 69
65static void code_byte (Byte c)70static void code_byte (Byte c)
66{71{
67 if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */72 if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */
68 {73 maxcurr = growvector(&basepc, maxcurr, Byte, codeEM, MAX_INT);
69 if (maxcurr >= MAX_INT)
70 lua_error("code size overflow");
71 maxcurr *= 2;
72 if (maxcurr >= MAX_INT)
73 maxcurr = MAX_INT;
74 basepc = growvector(basepc, maxcurr, Byte);
75 }
76 basepc[pc++] = c;74 basepc[pc++] = c;
77}75}
78 76
@@ -104,10 +102,12 @@ static void code_code (TFunc *tf) · 25 unmodified lines
104 code_byte(code.m.c4);102 code_byte(code.m.c4);
105}103}
106 104
107static void code_word_at (Byte *p, Word n)105static void code_word_at (Byte *p, int n)
108{106{
109 CodeWord code;107 CodeWord code;
110 code.w = n;108 if ((Word)n != n)
109 yyerror("block too big");
110 code.w = (Word)n;
111 *p++ = code.m.c1;111 *p++ = code.m.c1;
112 *p++ = code.m.c2;112 *p++ = code.m.c2;
113}113}
@@ -117,7 +117,7 @@ static void push_field (Word name) · 3 unmodified lines
117 if (nfields < MAXFIELDS)117 if (nfields < MAXFIELDS)
118 fields[nfields++] = name;118 fields[nfields++] = name;
119 else119 else
120 lua_error ("too many fields in nested constructors");120 yyerror ("too many fields in nested constructors");
121}121}
122 122
123static void flush_record (int n)123static void flush_record (int n)
@@ -142,24 +142,24 @@ static void flush_list (int m, int n) · 18 unmodified lines
142 code_byte(m);142 code_byte(m);
143 }143 }
144 else144 else
145 lua_error ("list constructor too long");145 yyerror ("list constructor too long");
146 code_byte(n);146 code_byte(n);
147}147}
148 148
149static void add_localvar (Word name)149static void store_localvar (TaggedString *name, int n)
150{150{
151 if (nlocalvar < MAXLOCALS)151 if (nlocalvar+n < MAXLOCALS)
152 localvar[nlocalvar++] = name;152 localvar[nlocalvar+n] = name;
153 else153 else
154 lua_error ("too many local variables");154 yyerror ("too many local variables");
155 if (lua_debug)
156 luaI_registerlocalvar(name, lua_linenumber);
155}157}
156 158
157static void store_localvar (Word name, int n)159static void add_localvar (TaggedString *name)
158{160{
159 if (nlocalvar+n < MAXLOCALS)161 store_localvar(name, 0);
160 localvar[nlocalvar+n] = name;162 nlocalvar++;
161 else
162 lua_error ("too many local variables");
163}163}
164 164
165static void add_varbuffer (Long var)165static void add_varbuffer (Long var)
@@ -167,7 +167,7 @@ static void add_varbuffer (Long var) · 1 unmodified line
167 if (nvarbuffer < MAXVAR)167 if (nvarbuffer < MAXVAR)
168 varbuffer[nvarbuffer++] = var;168 varbuffer[nvarbuffer++] = var;
169 else169 else
170 lua_error ("variable buffer overflow");170 yyerror ("variable buffer overflow");
171}171}
172 172
173static void code_number (float f)173static void code_number (float f)
@@ -197,7 +197,7 @@ static void code_number (float f) · 23 unmodified lines
197/*197/*
198** Search a local name and if find return its index. If do not find return -1198** Search a local name and if find return its index. If do not find return -1
199*/199*/
200static int lua_localname (Word n)200static int lua_localname (TaggedString *n)
201{201{
202 int i;202 int i;
203 for (i=nlocalvar-1; i >= 0; i--)203 for (i=nlocalvar-1; i >= 0; i--)
@@ -388,7 +388,6 @@ static void codeIf (Long thenAdd, Long elseAdd) · 184 unmodified lines
388*/388*/
389void lua_parse (TFunc *tf)389void lua_parse (TFunc *tf)
390{390{
391 lua_debug = 0;
392 initcode = &(tf->code);391 initcode = &(tf->code);
393 *initcode = newvector(CODE_BLOCK, Byte);392 *initcode = newvector(CODE_BLOCK, Byte);
394 maincode = 0; 393 maincode = 0;
@@ -416,7 +415,7 @@ void lua_parse (TFunc *tf) · 21 unmodified lines
416 Word vWord;415 Word vWord;
417 Long vLong;416 Long vLong;
418 TFunc *pFunc;417 TFunc *pFunc;
419 TreeNode *pNode;418 TaggedString *pTStr;
420}419}
421 420
422%start functionlist421%start functionlist
@@ -429,7 +428,7 @@ void lua_parse (TFunc *tf) · 6 unmodified lines
429%token FUNCTION428%token FUNCTION
430%token <vFloat> NUMBER429%token <vFloat> NUMBER
431%token <vWord> STRING430%token <vWord> STRING
432%token <pNode> NAME 431%token <pTStr> NAME
433%token <vInt> DEBUG432%token <vInt> DEBUG
434 433
435%type <vLong> PrepJump434%type <vLong> PrepJump
@@ -481,7 +480,7 @@ funcname : var { $$ =$1; init_func(); } · 45 unmodified lines
481 code_word(luaI_findconstant($3));480 code_word(luaI_findconstant($3));
482 $$ = 0; /* indexed variable */481 $$ = 0; /* indexed variable */
483 init_func();482 init_func();
484 add_localvar(luaI_findsymbolbyname("self"));483 add_localvar(luaI_createfixedstring("self"));
485 }484 }
486 ;485 ;
487 486
@@ -489,11 +488,14 @@ body : '(' parlist ')' block END · 1 unmodified line
489 {488 {
490 codereturn();489 codereturn();
491 $$ = new(TFunc);490 $$ = new(TFunc);
491 luaI_initTFunc($$);
492 $$->size = pc;492 $$->size = pc;
493 $$->code = newvector(pc, Byte);493 $$->code = newvector(pc, Byte);
494 $$->fileName = lua_parsedfile;494 $$->fileName = lua_parsedfile;
495 $$->lineDefined = $2;495 $$->lineDefined = $2;
496 memcpy($$->code, basepc, pc*sizeof(Byte));496 memcpy($$->code, basepc, pc*sizeof(Byte));
497 if (lua_debug)
498 luaI_closelocalvars($$);
497 /* save func values */499 /* save func values */
498 funcCode = basepc; maxcode=maxcurr;500 funcCode = basepc; maxcode=maxcurr;
499#if LISTING501#if LISTING
@@ -554,7 +556,11 @@ block : {$<vInt>$ = nlocalvar;} statlist ret · 54 unmodified lines
554 {556 {
555 if (nlocalvar != $<vInt>1)557 if (nlocalvar != $<vInt>1)
556 {558 {
557 nlocalvar = $<vInt>1;559 if (lua_debug)
560 for (; nlocalvar > $<vInt>1; nlocalvar--)
561 luaI_unregisterlocalvar(lua_linenumber);
562 else
563 nlocalvar = $<vInt>1;
558 lua_codeadjust (0);564 lua_codeadjust (0);
559 }565 }
560 }566 }
@@ -672,14 +678,8 @@ parlist : /* empty */ { lua_codeadjust(0); $$ = lua_linenumber; } · 111 unmodified lines
672 | parlist1 { lua_codeadjust(0); $$ = lua_linenumber; }678 | parlist1 { lua_codeadjust(0); $$ = lua_linenumber; }
673 ;679 ;
674 680
675parlist1 : NAME 681parlist1 : NAME { add_localvar($1); }
676 {682 | parlist1 ',' NAME { add_localvar($3); }
677 add_localvar(luaI_findsymbol($1));
678 }
679 | parlist1 ',' NAME
680 {
681 add_localvar(luaI_findsymbol($3));
682 }
683 ;683 ;
684 684
685fieldlist : lfieldlist685fieldlist : lfieldlist
@@ -759,10 +759,9 @@ var : singlevar { $$ = $1; } · 73 unmodified lines
759 759
760singlevar : NAME760singlevar : NAME
761 {761 {
762 Word s = luaI_findsymbol($1);762 int local = lua_localname($1);
763 int local = lua_localname (s);
764 if (local == -1) /* global var */763 if (local == -1) /* global var */
765 $$ = s + 1; /* return positive value */764 $$ = luaI_findsymbol($1)+1; /* return positive value */
766 else765 else
767 $$ = -(local+1); /* return negative value */766 $$ = -(local+1); /* return negative value */
768 }767 }
@@ -771,10 +770,10 @@ singlevar : NAME · 2 unmodified lines
771varexp : var { lua_pushvar($1); }770varexp : var { lua_pushvar($1); }
772 ;771 ;
773 772
774localdeclist : NAME {store_localvar(luaI_findsymbol($1), 0); $$ = 1;}773localdeclist : NAME {store_localvar($1, 0); $$ = 1;}
775 | localdeclist ',' NAME 774 | localdeclist ',' NAME
776 {775 {
777 store_localvar(luaI_findsymbol($3), $1);776 store_localvar($3, $1);
778 $$ = $1+1;777 $$ = $1+1;
779 }778 }
780 ;779 ;
@@ -787,228 +786,3 @@ setdebug : DEBUG { lua_debug = $1; } · 6 unmodified lines
787 ;786 ;
788 787
789%%788%%
790
791#if LISTING
792
793static void PrintCode (Byte *code, Byte *end)
794{
795 Byte *p = code;
796 printf ("\n\nCODE\n");
797 while (p != end)
798 {
799 switch ((OpCode)*p)
800 {
801 case PUSHNIL: printf ("%d PUSHNIL\n", (p++)-code); break;
802 case PUSH0: case PUSH1: case PUSH2:
803 printf ("%d PUSH%c\n", p-code, *p-PUSH0+'0');
804 p++;
805 break;
806 case PUSHBYTE:
807 printf ("%d PUSHBYTE %d\n", p-code, *(++p));
808 p++;
809 break;
810 case PUSHWORD:
811 {
812 CodeWord c;
813 int n = p-code;
814 p++;
815 get_word(c,p);
816 printf ("%d PUSHWORD %d\n", n, c.w);
817 }
818 break;
819 case PUSHFLOAT:
820 {
821 CodeFloat c;
822 int n = p-code;
823 p++;
824 get_float(c,p);
825 printf ("%d PUSHFLOAT %f\n", n, c.f);
826 }
827 break;
828 case PUSHSTRING:
829 {
830 CodeWord c;
831 int n = p-code;
832 p++;
833 get_word(c,p);
834 printf ("%d PUSHSTRING %d\n", n, c.w);
835 }
836 break;
837 case PUSHFUNCTION:
838 {
839 CodeCode c;
840 int n = p-code;
841 p++;
842 get_code(c,p);
843 printf ("%d PUSHFUNCTION %p\n", n, c.tf);
844 }
845 break;
846
847 case PUSHLOCAL0: case PUSHLOCAL1: case PUSHLOCAL2: case PUSHLOCAL3:
848 case PUSHLOCAL4: case PUSHLOCAL5: case PUSHLOCAL6: case PUSHLOCAL7:
849 case PUSHLOCAL8: case PUSHLOCAL9:
850 printf ("%d PUSHLOCAL%c\n", p-code, *p-PUSHLOCAL0+'0');
851 p++;
852 break;
853 case PUSHLOCAL: printf ("%d PUSHLOCAL %d\n", p-code, *(++p));
854 p++;
855 break;
856 case PUSHGLOBAL:
857 {
858 CodeWord c;
859 int n = p-code;
860 p++;
861 get_word(c,p);
862 printf ("%d PUSHGLOBAL %d\n", n, c.w);
863 }
864 break;
865 case PUSHINDEXED: printf ("%d PUSHINDEXED\n", (p++)-code); break;
866 case STORELOCAL0: case STORELOCAL1: case STORELOCAL2: case STORELOCAL3:
867 case STORELOCAL4: case STORELOCAL5: case STORELOCAL6: case STORELOCAL7:
868 case STORELOCAL8: case STORELOCAL9:
869 printf ("%d STORELOCAL%c\n", p-code, *p-STORELOCAL0+'0');
870 p++;
871 break;
872 case STORELOCAL:
873 printf ("%d STORELOCAL %d\n", p-code, *(++p));
874 p++;
875 break;
876 case STOREGLOBAL:
877 {
878 CodeWord c;
879 int n = p-code;
880 p++;
881 get_word(c,p);
882 printf ("%d STOREGLOBAL %d\n", n, c.w);
883 }
884 break;
885 case PUSHSELF:
886 {
887 CodeWord c;
888 int n = p-code;
889 p++;
890 get_word(c,p);
891 printf ("%d PUSHSELF %d\n", n, c.w);
892 }
893 break;
894 case STOREINDEXED0: printf ("%d STOREINDEXED0\n", (p++)-code); break;
895 case STOREINDEXED: printf ("%d STOREINDEXED %d\n", p-code, *(++p));
896 p++;
897 break;
898 case STORELIST0:
899 printf("%d STORELIST0 %d\n", p-code, *(++p));
900 p++;
901 break;
902 case STORELIST:
903 printf("%d STORELIST %d %d\n", p-code, *(p+1), *(p+2));
904 p+=3;
905 break;
906 case STORERECORD:
907 printf("%d STORERECORD %d\n", p-code, *(++p));
908 p += *p*sizeof(Word) + 1;
909 break;
910 case ADJUST0: printf ("%d ADJUST0\n", (p++)-code); break;
911 case ADJUST:
912 printf ("%d ADJUST %d\n", p-code, *(++p));
913 p++;
914 break;
915 case CREATEARRAY:
916 {
917 CodeWord c;
918 int n = p-code;
919 p++;
920 get_word(c,p);
921 printf ("%d CREATEARRAY %d\n", n, c.w);
922 break;
923 }
924 case EQOP: printf ("%d EQOP\n", (p++)-code); break;
925 case LTOP: printf ("%d LTOP\n", (p++)-code); break;
926 case LEOP: printf ("%d LEOP\n", (p++)-code); break;
927 case ADDOP: printf ("%d ADDOP\n", (p++)-code); break;
928 case SUBOP: printf ("%d SUBOP\n", (p++)-code); break;
929 case MULTOP: printf ("%d MULTOP\n", (p++)-code); break;
930 case DIVOP: printf ("%d DIVOP\n", (p++)-code); break;
931 case POWOP: printf ("%d POWOP\n", (p++)-code); break;
932 case CONCOP: printf ("%d CONCOP\n", (p++)-code); break;
933 case MINUSOP: printf ("%d MINUSOP\n", (p++)-code); break;
934 case NOTOP: printf ("%d NOTOP\n", (p++)-code); break;
935 case ONTJMP:
936 {
937 CodeWord c;
938 int n = p-code;
939 p++;
940 get_word(c,p);
941 printf ("%d ONTJMP %d\n", n, c.w);
942 }
943 break;
944 case ONFJMP:
945 {
946 CodeWord c;
947 int n = p-code;
948 p++;
949 get_word(c,p);
950 printf ("%d ONFJMP %d\n", n, c.w);
951 }
952 break;
953 case JMP:
954 {
955 CodeWord c;
956 int n = p-code;
957 p++;
958 get_word(c,p);
959 printf ("%d JMP %d\n", n, c.w);
960 }
961 break;
962 case UPJMP:
963 {
964 CodeWord c;
965 int n = p-code;
966 p++;
967 get_word(c,p);
968 printf ("%d UPJMP %d\n", n, c.w);
969 }
970 break;
971 case IFFJMP:
972 {
973 CodeWord c;
974 int n = p-code;
975 p++;
976 get_word(c,p);
977 printf ("%d IFFJMP %d\n", n, c.w);
978 }
979 break;
980 case IFFUPJMP:
981 {
982 CodeWord c;
983 int n = p-code;
984 p++;
985 get_word(c,p);
986 printf ("%d IFFUPJMP %d\n", n, c.w);
987 }
988 break;
989 case POP: printf ("%d POP\n", (p++)-code); break;
990 case CALLFUNC:
991 printf ("%d CALLFUNC %d %d\n", p-code, *(p+1), *(p+2));
992 p+=3;
993 break;
994 case RETCODE0: printf ("%d RETCODE0\n", (p++)-code); break;
995 case RETCODE:
996 printf ("%d RETCODE %d\n", p-code, *(++p));
997 p++;
998 break;
999 case SETLINE:
1000 {
1001 CodeWord c;
1002 int n = p-code;
1003 p++;
1004 get_word(c,p);
1005 printf ("%d SETLINE %d\n", n, c.w);
1006 }
1007 break;
1008
1009 default: printf ("%d Cannot happen: code %d\n", (p++)-code, *(p-1)); break;
1010 }
1011 }
1012}
1013#endif
1014
src/luac/Makefile+24−0
@@ -0,0 +1,24 @@
1# makefile for lua distribution (compiler)
2
3LUA= ../..
4
5include $(LUA)/config
6
7INCS= -I$(INC) $(EXTRA_INCS) -I..
8OBJS= dump.o luac.o print.o
9SRCS= dump.c luac.c print.c luac.h print.h
10T=$(BIN)/luac
11
12all: $T
13
14$T: $(OBJS)
15 $(CC) -o $@ $(OBJS) -L$(LIB) -llua
16
17clean:
18 rm -f $(OBJS) $T
19
20co:
21 co -f -M $(SRCS)
22
23klean: clean
24 rm -f $(SRCS)
src/luac/dump.c+247−0
@@ -0,0 +1,247 @@
1/*
2** dump.c
3** thread and save bytecodes to file
4*/
5
6char* rcs_dump="$Id: dump.c,v 1.12 1996/03/12 20:00:03 lhf Exp $";
7
8#include <stdio.h>
9#include <string.h>
10#include "luac.h"
11
12static TFunc* lastF=NULL; /* list of functions seen in code */
13
14static int SawVar(int i, int at)
15{
16 int old=VarLoc(i);
17 VarLoc(i)=at;
18 return old;
19}
20
21static int SawStr(int i, int at)
22{
23 int old=StrLoc(i);
24 StrLoc(i)=at;
25 return old;
26}
27
28static void ThreadCode(Byte* code, Byte* end)
29{
30 Byte* p;
31 int i;
32 for (i=0; i<lua_ntable; i++) VarLoc(i)=0;
33 for (i=0; i<lua_nconstant; i++) StrLoc(i)=0;
34 for (p=code; p!=end;)
35 {
36 OpCode op=(OpCode)*p;
37 int at=p-code+1;
38 switch (op)
39 {
40 case PUSHNIL:
41 case PUSH0:
42 case PUSH1:
43 case PUSH2:
44 case PUSHLOCAL0:
45 case PUSHLOCAL1:
46 case PUSHLOCAL2:
47 case PUSHLOCAL3:
48 case PUSHLOCAL4:
49 case PUSHLOCAL5:
50 case PUSHLOCAL6:
51 case PUSHLOCAL7:
52 case PUSHLOCAL8:
53 case PUSHLOCAL9:
54 case PUSHINDEXED:
55 case STORELOCAL0:
56 case STORELOCAL1:
57 case STORELOCAL2:
58 case STORELOCAL3:
59 case STORELOCAL4:
60 case STORELOCAL5:
61 case STORELOCAL6:
62 case STORELOCAL7:
63 case STORELOCAL8:
64 case STORELOCAL9:
65 case STOREINDEXED0:
66 case ADJUST0:
67 case EQOP:
68 case LTOP:
69 case LEOP:
70 case GTOP:
71 case GEOP:
72 case ADDOP:
73 case SUBOP:
74 case MULTOP:
75 case DIVOP:
76 case POWOP:
77 case CONCOP:
78 case MINUSOP:
79 case NOTOP:
80 case POP:
81 case RETCODE0:
82 p++;
83 break;
84 case PUSHBYTE:
85 case PUSHLOCAL:
86 case STORELOCAL:
87 case STOREINDEXED:
88 case STORELIST0:
89 case ADJUST:
90 case RETCODE:
91 p+=2;
92 break;
93 case PUSHWORD:
94 case CREATEARRAY:
95 case ONTJMP:
96 case ONFJMP:
97 case JMP:
98 case UPJMP:
99 case IFFJMP:
100 case IFFUPJMP:
101 case SETLINE:
102 case STORELIST:
103 case CALLFUNC:
104 p+=3;
105 break;
106 case PUSHFLOAT:
107 p+=5;
108 break;
109 case PUSHSELF:
110 case PUSHSTRING:
111 {
112 CodeWord c;
113 p++;
114 get_word(c,p);
115 c.w=SawStr(c.w,at);
116 p[-2]=c.m.c1;
117 p[-1]=c.m.c2;
118 break;
119 }
120 case PUSHFUNCTION:
121 {
122 CodeCode c;
123 p++;
124 get_code(c,p);
125 c.tf->marked=at;
126 c.tf->next=NULL; /* TODO: remove? */
127 lastF=lastF->next=c.tf;
128 break;
129 }
130 case PUSHGLOBAL:
131 case STOREGLOBAL:
132 {
133 CodeWord c;
134 p++;
135 get_word(c,p);
136 c.w=SawVar(c.w,at);
137 p[-2]=c.m.c1;
138 p[-1]=c.m.c2;
139 break;
140 }
141 case STORERECORD:
142 {
143 int n=*++p;
144 p++;
145 while (n--)
146 {
147 CodeWord c;
148 at=p-code;
149 get_word(c,p);
150 c.w=SawStr(c.w,at);
151 p[-2]=c.m.c1;
152 p[-1]=c.m.c2;
153 }
154 break;
155 }
156 default:
157 fprintf(stderr,"luac: cannot happen: opcode=%d",*p);
158 exit(1);
159 break;
160 }
161 }
162}
163
164static void DumpWord(int i, FILE* D)
165{
166 Word w=i;
167 fwrite(&w,sizeof(w),1,D);
168}
169
170static void DumpBlock(char* b, int size, FILE* D)
171{
172 fwrite(b,size,1,D);
173}
174
175static void DumpSize(int i, FILE* D)
176{
177 Word lo=i&0x0FFFF;
178 Word hi=(i>>16)&0x0FFFF;
179 fwrite(&hi,sizeof(hi),1,D);
180 fwrite(&lo,sizeof(lo),1,D);
181 if (hi!=0)
182 fprintf(stderr,
183 "luac: warning: code too long for 16-bit machines (%d bytes)\n",i);
184}
185
186static void DumpString(char* s, FILE* D)
187{
188 int n=strlen(s)+1;
189 if ((Word)n != n)
190 {
191 fprintf(stderr,"luac: string too long: \"%.32s...\"\n",s);
192 exit(1);
193 }
194 DumpWord(n,D);
195 DumpBlock(s,n,D);
196}
197
198static void DumpStrings(FILE* D)
199{
200 int i;
201 for (i=0; i<lua_ntable; i++)
202 {
203 if (VarLoc(i)!=0)
204 {
205 fputc(ID_VAR,D);
206 DumpWord(VarLoc(i),D);
207 DumpString(VarStr(i),D);
208 }
209 VarLoc(i)=i;
210 }
211 for (i=0; i<lua_nconstant; i++)
212 {
213 if (StrLoc(i)!=0)
214 {
215 fputc(ID_STR,D);
216 DumpWord(StrLoc(i),D);
217 DumpString(StrStr(i),D);
218 }
219 StrLoc(i)=i;
220 }
221}
222
223void DumpFunction(TFunc* tf, FILE* D)
224{
225 lastF=tf;
226 ThreadCode(tf->code,tf->code+tf->size);
227 fputc(ID_FUN,D);
228 DumpSize(tf->size,D);
229 DumpWord(tf->lineDefined,D);
230 if (IsMain(tf))
231 DumpString(tf->fileName,D);
232 else
233 DumpWord(tf->marked,D);
234 DumpBlock(tf->code,tf->size,D);
235 DumpStrings(D);
236}
237
238void DumpHeader(FILE* D)
239{
240 Word w=TEST_WORD;
241 float f=TEST_FLOAT;
242 fputc(ID_CHUNK,D);
243 fputs(SIGNATURE,D);
244 fputc(VERSION,D);
245 fwrite(&w,sizeof(w),1,D);
246 fwrite(&f,sizeof(f),1,D);
247}
src/luac/luac.c+104−0
@@ -0,0 +1,104 @@
1/*
2** luac.c
3** lua compiler (saves bytecodes to files)
4*/
5
6char* rcs_luac="$Id: luac.c,v 1.16 1996/03/13 17:33:03 lhf Exp $";
7
8#include <stdio.h>
9#include <string.h>
10#include "luac.h"
11
12static void compile(char* filename);
13
14static int listing=0; /* list bytecodes? */
15static int dumping=1; /* dump bytecodes? */
16static FILE* D; /* output file */
17
18static void usage(void)
19{
20 fprintf(stderr,"usage: luac [-dlpv] [-o output] file ...\n");
21 exit(0);
22}
23
24#define IS(s) (strcmp(argv[i],s)==0)
25
26int main(int argc, char* argv[])
27{
28 char* d="luac.out"; /* default output file */
29 int i;
30 for (i=1; i<argc; i++)
31 {
32 if (argv[i][0]!='-') /* end of options */
33 break;
34 else if (IS("-")) /* use stdin */
35 break;
36 else if (IS("-d")) /* debug */
37 lua_debug=1;
38 else if (IS("-l")) /* list */
39 listing=1;
40 else if (IS("-o")) /* output file */
41 d=argv[++i];
42 else if (IS("-p")) /* parse only (for timing purposes) */
43 dumping=0;
44 else if (IS("-v")) /* show version */
45 printf("%s %s\n(written by %s)\n\n",LUA_VERSION,LUA_COPYRIGHT,LUA_AUTHORS);
46 else /* unknown option */
47 usage();
48 }
49 --i; /* fake new argv[0] */
50 argc-=i;
51 argv+=i;
52 if (argc<2) usage();
53 for (i=1; i<argc; i++)
54 if (IS(d))
55 {
56 fprintf(stderr,"luac: will not overwrite input file \"%s\"\n",d);
57 exit(1);
58 }
59 D=(dumping) ? fopen(d,"wb") : stdout; /* must open in binary mode */
60 if (D==NULL)
61 {
62 fprintf(stderr,"luac: cannot open ");
63 perror(d);
64 exit(1);
65 }
66 for (i=1; i<argc; i++) compile(IS("-")? NULL : argv[i]);
67 fclose(D);
68 return 0;
69}
70
71static void do_dump(TFunc* tf) /* only for tf==main */
72{
73 if (dumping) DumpHeader(D);
74 while (tf!=NULL)
75 {
76 TFunc* nf;
77 if (listing) PrintFunction(tf);
78 if (dumping) DumpFunction(tf,D);
79 nf=tf->next; /* list only built after first main */
80 luaI_freefunc(tf);
81 tf=nf;
82 }
83}
84
85static void do_compile(void)
86{
87 TFunc* tf=new(TFunc);
88 luaI_initTFunc(tf);
89 tf->fileName = lua_parsedfile;
90 lua_parse(tf);
91 do_dump(tf);
92}
93
94static void compile(char* filename)
95{
96 if (lua_openfile(filename)==NULL)
97 {
98 fprintf(stderr,"luac: cannot open ");
99 perror(filename);
100 exit(1);
101 }
102 do_compile();
103 lua_closefile();
104}
src/luac/luac.h+24−0
@@ -0,0 +1,24 @@
1/*
2** luac.h
3** definitions for luac compiler
4** $Id: luac.h,v 1.5 1996/03/08 21:41:47 lhf Exp $
5*/
6
7#include "inout.h"
8#include "mem.h"
9#include "opcode.h"
10#include "table.h"
11#include "undump.h"
12
13#define VarStr(i) (lua_table[i].varname->str)
14#define VarLoc(i) (lua_table[i].varname->varindex)
15#define StrStr(i) (lua_constant[i]->str)
16#define StrLoc(i) (lua_constant[i]->constindex)
17
18extern Word lua_ntable;
19extern Word lua_nconstant;
20extern int lua_debug;
21
22void DumpHeader(FILE* D);
23void DumpFunction(TFunc* tf, FILE* D);
24void PrintFunction(TFunc* tf);
src/luac/print.c+189−0
@@ -0,0 +1,189 @@
1/*
2** print.c
3** print bytecodes
4*/
5
6char* rcs_print="$Id: print.c,v 1.6 1996/03/12 20:00:24 lhf Exp $";
7
8#include <stdio.h>
9#include <string.h>
10#include "luac.h"
11#include "print.h"
12
13static LocVar* V=NULL;
14
15static char* LocStr(int i)
16{
17 if (V==NULL) return ""; else return V[i].varname->str;
18}
19
20static void PrintCode(Byte* code, Byte* end)
21{
22 Byte* p;
23 for (p=code; p!=end;)
24 {
25 OpCode op=(OpCode)*p;
26 if (op>SETLINE) op=SETLINE+1;
27 printf("%6d\t%s",p-code,OpCodeName[op]);
28 switch (op)
29 {
30 case PUSHNIL:
31 case PUSH0:
32 case PUSH1:
33 case PUSH2:
34 case PUSHINDEXED:
35 case STOREINDEXED0:
36 case ADJUST0:
37 case EQOP:
38 case LTOP:
39 case LEOP:
40 case GTOP:
41 case GEOP:
42 case ADDOP:
43 case SUBOP:
44 case MULTOP:
45 case DIVOP:
46 case POWOP:
47 case CONCOP:
48 case MINUSOP:
49 case NOTOP:
50 case POP:
51 case RETCODE0:
52 p++;
53 break;
54 case PUSHLOCAL0:
55 case PUSHLOCAL1:
56 case PUSHLOCAL2:
57 case PUSHLOCAL3:
58 case PUSHLOCAL4:
59 case PUSHLOCAL5:
60 case PUSHLOCAL6:
61 case PUSHLOCAL7:
62 case PUSHLOCAL8:
63 case PUSHLOCAL9:
64 {
65 int i=op-PUSHLOCAL0;
66 printf("\t%d\t; %s",i,LocStr(i));
67 p++;
68 break;
69 }
70 case STORELOCAL0:
71 case STORELOCAL1:
72 case STORELOCAL2:
73 case STORELOCAL3:
74 case STORELOCAL4:
75 case STORELOCAL5:
76 case STORELOCAL6:
77 case STORELOCAL7:
78 case STORELOCAL8:
79 case STORELOCAL9:
80 {
81 int i=op-STORELOCAL0;
82 printf("\t%d\t; %s",i,LocStr(i));
83 p++;
84 break;
85 }
86 case PUSHLOCAL:
87 case STORELOCAL:
88 {
89 int i=*(p+1);
90 printf("\t%d\t; %s",i,LocStr(i));
91 p+=2;
92 break;
93 }
94 case PUSHBYTE:
95 case STOREINDEXED:
96 case STORELIST0:
97 case ADJUST:
98 case RETCODE:
99 printf("\t%d",*(p+1));
100 p+=2;
101 break;
102 case PUSHWORD:
103 case CREATEARRAY:
104 case ONTJMP:
105 case ONFJMP:
106 case JMP:
107 case UPJMP:
108 case IFFJMP:
109 case IFFUPJMP:
110 case SETLINE:
111 {
112 CodeWord c;
113 p++;
114 get_word(c,p);
115 printf("\t%d",c.w);
116 break;
117 }
118 case PUSHFLOAT:
119 {
120 CodeFloat c;
121 p++;
122 get_float(c,p);
123 printf("\t%g",c.f);
124 break;
125 }
126 case PUSHSELF:
127 case PUSHSTRING:
128 {
129 CodeWord c;
130 p++;
131 get_word(c,p);
132 printf("\t%d\t; \"%s\"",c.w,StrStr(c.w));
133 break;
134 }
135 case PUSHFUNCTION:
136 {
137 CodeCode c;
138 p++;
139 get_code(c,p);
140 printf("\t%p\t; \"%s\":%d",c.tf,c.tf->fileName,c.tf->lineDefined);
141 break;
142 }
143 case PUSHGLOBAL:
144 case STOREGLOBAL:
145 {
146 CodeWord c;
147 p++;
148 get_word(c,p);
149 printf("\t%d\t; %s",c.w,VarStr(c.w));
150 break;
151 }
152 case STORELIST:
153 case CALLFUNC:
154 printf("\t%d %d",*(p+1),*(p+2));
155 p+=3;
156 break;
157 case STORERECORD:
158 {
159 int n=*++p;
160 printf("\t%d",n);
161 p++;
162 while (n--)
163 {
164 CodeWord c;
165 printf("\n%6d\t FIELD",p-code);
166 get_word(c,p);
167 printf("\t%d\t; \"%s\"",c.w,StrStr(c.w));
168 }
169 break;
170 }
171 default:
172 printf("\tcannot happen: opcode=%d",*p);
173 exit(1);
174 break;
175 }
176 printf("\n");
177 }
178}
179
180void PrintFunction(TFunc* tf)
181{
182 if (IsMain(tf))
183 printf("\nmain of \"%s\" (%d bytes at %p)\n",tf->fileName,tf->size,tf);
184 else
185 printf("\nfunction \"%s\":%d (%d bytes at %p); used at main+%d\n",
186 tf->fileName,tf->lineDefined,tf->size,tf,tf->marked);
187 V=tf->locvars;
188 PrintCode(tf->code,tf->code+tf->size);
189}
src/luac/print.h+76−0
@@ -0,0 +1,76 @@
1/*
2** print.h
3** opcode names
4** $Id: print.h,v 1.1 1996/02/23 19:04:13 lhf Exp $
5*/
6
7static char* OpCodeName[]={ /* attention: same order as enum in opcode.h */
8 "PUSHNIL",
9 "PUSH0",
10 "PUSH1",
11 "PUSH2",
12 "PUSHBYTE",
13 "PUSHWORD",
14 "PUSHFLOAT",
15 "PUSHSTRING",
16 "PUSHFUNCTION",
17 "PUSHLOCAL0",
18 "PUSHLOCAL1",
19 "PUSHLOCAL2",
20 "PUSHLOCAL3",
21 "PUSHLOCAL4",
22 "PUSHLOCAL5",
23 "PUSHLOCAL6",
24 "PUSHLOCAL7",
25 "PUSHLOCAL8",
26 "PUSHLOCAL9",
27 "PUSHLOCAL",
28 "PUSHGLOBAL",
29 "PUSHINDEXED",
30 "PUSHSELF",
31 "STORELOCAL0",
32 "STORELOCAL1",
33 "STORELOCAL2",
34 "STORELOCAL3",
35 "STORELOCAL4",
36 "STORELOCAL5",
37 "STORELOCAL6",
38 "STORELOCAL7",
39 "STORELOCAL8",
40 "STORELOCAL9",
41 "STORELOCAL",
42 "STOREGLOBAL",
43 "STOREINDEXED0",
44 "STOREINDEXED",
45 "STORELIST0",
46 "STORELIST",
47 "STORERECORD",
48 "ADJUST0",
49 "ADJUST",
50 "CREATEARRAY",
51 "EQOP",
52 "LTOP",
53 "LEOP",
54 "GTOP",
55 "GEOP",
56 "ADDOP",
57 "SUBOP",
58 "MULTOP",
59 "DIVOP",
60 "POWOP",
61 "CONCOP",
62 "MINUSOP",
63 "NOTOP",
64 "ONTJMP",
65 "ONFJMP",
66 "JMP",
67 "UPJMP",
68 "IFFJMP",
69 "IFFUPJMP",
70 "POP",
71 "CALLFUNC",
72 "RETCODE0",
73 "RETCODE",
74 "SETLINE",
75 ""
76};
src/mem.c+34−11
@@ -3,18 +3,24 @@ · 2 unmodified lines
3** TecCGraf - PUC-Rio3** TecCGraf - PUC-Rio
4*/4*/
5 5
6char *rcs_mem = "$Id: mem.c,v 1.5 1995/02/06 19:34:03 roberto Exp $";6char *rcs_mem = "$Id: mem.c,v 1.12 1996/05/06 16:59:00 roberto Exp $";
7 7
8#include <stdlib.h>8#include <stdlib.h>
9#include <string.h>
10 9
11#include "mem.h"10#include "mem.h"
12#include "lua.h"11#include "lua.h"
13 12
13
14#define mem_error() lua_error(memEM)
15
16
14void luaI_free (void *block)17void luaI_free (void *block)
15{18{
16 *((int *)block) = -1; /* to catch errors */19 if (block)
17 free(block);20 {
21 *((int *)block) = -1; /* to catch errors */
22 free(block);
23 }
18}24}
19 25
20 26
@@ -22,23 +28,40 @@ void *luaI_malloc (unsigned long size) · 1 unmodified line
22{28{
23 void *block = malloc((size_t)size);29 void *block = malloc((size_t)size);
24 if (block == NULL)30 if (block == NULL)
25 lua_error("not enough memory");31 mem_error();
26 return block;32 return block;
27}33}
28 34
29 35
30void *luaI_realloc (void *oldblock, unsigned long size)36void *luaI_realloc (void *oldblock, unsigned long size)
31{37{
32 void *block = realloc(oldblock, (size_t)size);38 void *block = oldblock ? realloc(oldblock, (size_t)size) :
39 malloc((size_t)size);
33 if (block == NULL)40 if (block == NULL)
34 lua_error("not enough memory");41 mem_error();
35 return block;42 return block;
36}43}
37 44
38 45
39char *luaI_strdup (char *str)46int luaI_growvector (void **block, unsigned long nelems, int size,
47 char *errormsg, unsigned long limit)
40{48{
41 char *newstr = luaI_malloc(strlen(str)+1);49 if (nelems >= limit)
42 strcpy(newstr, str);50 lua_error(errormsg);
43 return newstr;51 nelems = (nelems == 0) ? 20 : nelems*2;
52 if (nelems > limit)
53 nelems = limit;
54 *block = luaI_realloc(*block, nelems*size);
55 return (int) nelems;
44}56}
57
58
59void* luaI_buffer (unsigned long size)
60{
61 static unsigned long buffsize = 0;
62 static char* buffer = NULL;
63 if (size > buffsize)
64 buffer = luaI_realloc(buffer, buffsize=size);
65 return buffer;
66}
67
src/mem.h+18−4
@@ -1,7 +1,7 @@
1/*1/*
2** mem.c2** mem.c
3** memory manager for lua3** memory manager for lua
4** $Id: mem.h,v 1.2 1995/01/13 22:11:12 roberto Exp $4** $Id: mem.h,v 1.7 1996/04/22 18:00:37 roberto Exp $
5*/5*/
6 6
7#ifndef mem_h7#ifndef mem_h
@@ -11,15 +11,29 @@ · 3 unmodified lines
11#define NULL 011#define NULL 0
12#endif12#endif
13 13
14
15/* memory error messages */
16#define codeEM "code size overflow"
17#define symbolEM "symbol table overflow"
18#define constantEM "constant table overflow"
19#define stackEM "stack size overflow"
20#define lexEM "lex buffer overflow"
21#define refEM "reference table overflow"
22#define tableEM "table overflow"
23#define memEM "not enough memory"
24
25
14void luaI_free (void *block);26void luaI_free (void *block);
15void *luaI_malloc (unsigned long size);27void *luaI_malloc (unsigned long size);
16void *luaI_realloc (void *oldblock, unsigned long size);28void *luaI_realloc (void *oldblock, unsigned long size);
17 29void *luaI_buffer (unsigned long size);
18char *luaI_strdup (char *str);30int luaI_growvector (void **block, unsigned long nelems, int size,
31 char *errormsg, unsigned long limit);
19 32
20#define new(s) ((s *)luaI_malloc(sizeof(s)))33#define new(s) ((s *)luaI_malloc(sizeof(s)))
21#define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s)))34#define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s)))
22#define growvector(old,n,s) ((s *)luaI_realloc(old,(n)*sizeof(s)))35#define growvector(old,n,s,e,l) \
36 (luaI_growvector((void**)old,n,sizeof(s),e,l))
23 37
24#endif 38#endif
25 39
src/opcode.c+202−89
@@ -3,10 +3,9 @@ · 2 unmodified lines
3** TecCGraf - PUC-Rio3** TecCGraf - PUC-Rio
4*/4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 3.50 1995/11/16 20:46:24 roberto Exp $";6char *rcs_opcode="$Id: opcode.c,v 3.68 1996/04/25 14:10:00 roberto Exp $";
7 7
8#include <setjmp.h>8#include <setjmp.h>
9#include <stdlib.h>
10#include <stdio.h>9#include <stdio.h>
11#include <string.h>10#include <string.h>
12 11
@@ -18,6 +17,7 @@ char *rcs_opcode="$Id: opcode.c,v 3.50 1995/11/16 20:46:24 roberto Exp $"; · 5 unmodified lines
18#include "table.h"17#include "table.h"
19#include "lua.h"18#include "lua.h"
20#include "fallback.h"19#include "fallback.h"
20#include "undump.h"
21 21
22#define tonumber(o) ((tag(o) != LUA_T_NUMBER) && (lua_tonumber(o) != 0))22#define tonumber(o) ((tag(o) != LUA_T_NUMBER) && (lua_tonumber(o) != 0))
23#define tostring(o) ((tag(o) != LUA_T_STRING) && (lua_tostring(o) != 0))23#define tostring(o) ((tag(o) != LUA_T_STRING) && (lua_tostring(o) != 0))
@@ -25,6 +25,10 @@ char *rcs_opcode="$Id: opcode.c,v 3.50 1995/11/16 20:46:24 roberto Exp $"; · 1 unmodified line
25 25
26#define STACK_SIZE 12826#define STACK_SIZE 128
27 27
28#ifndef STACK_LIMIT
29#define STACK_LIMIT 6000
30#endif
31
28typedef int StkId; /* index to stack elements */32typedef int StkId; /* index to stack elements */
29 33
30static Object initial_stack;34static Object initial_stack;
@@ -53,6 +57,11 @@ static int CnResults = 0; /* when Lua calls C, has the number of parameters; */ · 22 unmodified lines
53static jmp_buf *errorJmp = NULL; /* current error recover point */57static jmp_buf *errorJmp = NULL; /* current error recover point */
54 58
55 59
60/* Hooks */
61lua_LHFunction lua_linehook = NULL;
62lua_CHFunction lua_callhook = NULL;
63
64
56static StkId lua_execute (Byte *pc, StkId base);65static StkId lua_execute (Byte *pc, StkId base);
57static void do_call (StkId base, int nResults);66static void do_call (StkId base, int nResults);
58 67
@@ -64,7 +73,6 @@ Object *luaI_Address (lua_Object o) · 5 unmodified lines
64}73}
65 74
66 75
67
68/*76/*
69** Init stack77** Init stack
70*/78*/
@@ -89,14 +97,17 @@ static void growstack (void) · 18 unmodified lines
89 lua_initstack();97 lua_initstack();
90 else98 else
91 {99 {
100 static int limit = STACK_LIMIT;
92 StkId t = top-stack;101 StkId t = top-stack;
93 Long maxstack = stackLimit - stack;102 Long stacksize = stackLimit - stack;
94 maxstack *= 2;103 stacksize = growvector(&stack, stacksize, Object, stackEM, limit+100);
95 stack = growvector(stack, maxstack, Object);104 stackLimit = stack+stacksize;
96 stackLimit = stack+maxstack;
97 top = stack + t;105 top = stack + t;
98 if (maxstack >= MAX_WORD/2)106 if (stacksize >= limit)
99 lua_error("stack size overflow");107 {
108 limit = stacksize;
109 lua_error(stackEM);
110 }
100 }111 }
101}112}
102 113
@@ -106,18 +117,9 @@ static void growstack (void) · 3 unmodified lines
106*/117*/
107static char *lua_strconc (char *l, char *r)118static char *lua_strconc (char *l, char *r)
108{119{
109 static char *buffer = NULL;120 int nl = strlen(l);
110 static int buffer_size = 0;121 char *buffer = luaI_buffer(nl+strlen(r)+1);
111 int nl = strlen(l);122 strcpy(buffer, l);
112 int n = nl+strlen(r)+1;
113 if (n > buffer_size)
114 {
115 buffer_size = n;
116 if (buffer != NULL)
117 luaI_free(buffer);
118 buffer = newvector(buffer_size, char);
119 }
120 strcpy(buffer,l);
121 strcpy(buffer+nl, r);123 strcpy(buffer+nl, r);
122 return buffer;124 return buffer;
123}125}
@@ -150,7 +152,7 @@ static int lua_tonumber (Object *obj) · 26 unmodified lines
150*/152*/
151static int lua_tostring (Object *obj)153static int lua_tostring (Object *obj)
152{154{
153 static char s[256];155 char s[256];
154 if (tag(obj) != LUA_T_NUMBER)156 if (tag(obj) != LUA_T_NUMBER)
155 return 1;157 return 1;
156 if ((int) nvalue(obj) == nvalue(obj))158 if ((int) nvalue(obj) == nvalue(obj))
@@ -158,8 +160,6 @@ static int lua_tostring (Object *obj) · 1 unmodified line
158 else160 else
159 sprintf (s, "%g", nvalue(obj));161 sprintf (s, "%g", nvalue(obj));
160 tsvalue(obj) = lua_createstring(s);162 tsvalue(obj) = lua_createstring(s);
161 if (tsvalue(obj) == NULL)
162 return 1;
163 tag(obj) = LUA_T_STRING;163 tag(obj) = LUA_T_STRING;
164 return 0;164 return 0;
165}165}
@@ -192,6 +192,48 @@ static void open_stack (int nelems) · 26 unmodified lines
192}192}
193 193
194 194
195/*
196** call Line hook
197*/
198static void lineHook (int line)
199{
200 StkId oldBase = CBase;
201 int oldCnResults = CnResults;
202 StkId old_top = CBase = top-stack;
203 CnResults = 0;
204 (*lua_linehook)(line);
205 top = stack+old_top;
206 CnResults = oldCnResults;
207 CBase = oldBase;
208}
209
210
211/*
212** Call hook
213** The function being called is in [stack+base-1]
214*/
215static void callHook (StkId base, lua_Type type, int isreturn)
216{
217 StkId oldBase = CBase;
218 int oldCnResults = CnResults;
219 StkId old_top = CBase = top-stack;
220 CnResults = 0;
221 if (isreturn)
222 (*lua_callhook)(LUA_NOOBJECT, "(return)", 0);
223 else
224 {
225 Object *f = stack+base-1;
226 if (type == LUA_T_MARK)
227 (*lua_callhook)(Ref(f), f->value.tf->fileName, f->value.tf->lineDefined);
228 else
229 (*lua_callhook)(Ref(f), "(C)", -1);
230 }
231 top = stack+old_top;
232 CnResults = oldCnResults;
233 CBase = oldBase;
234}
235
236
195/*237/*
196** Call a C function. CBase will point to the top of the stack,238** Call a C function. CBase will point to the top of the stack,
197** and CnResults is the number of parameters. Returns an index239** and CnResults is the number of parameters. Returns an index
@@ -204,8 +246,12 @@ static StkId callC (lua_CFunction func, StkId base) · 6 unmodified lines
204 StkId firstResult;246 StkId firstResult;
205 CnResults = (top-stack) - base;247 CnResults = (top-stack) - base;
206 /* incorporate parameters on the stack */248 /* incorporate parameters on the stack */
207 CBase = base+CnResults;249 CBase = base+CnResults; /* == top-stack */
250 if (lua_callhook)
251 callHook(base, LUA_T_CMARK, 0);
208 (*func)();252 (*func)();
253 if (lua_callhook) /* func may have changed lua_callhook */
254 callHook(base, LUA_T_CMARK, 1);
209 firstResult = CBase;255 firstResult = CBase;
210 CBase = oldBase;256 CBase = oldBase;
211 CnResults = oldCnResults;257 CnResults = oldCnResults;
@@ -303,6 +349,18 @@ static void storesubscript (void) · 91 unmodified lines
303}349}
304 350
305 351
352static void getglobal (Word n)
353{
354 *top = lua_table[n].object;
355 incr_top;
356 if (tag(top-1) == LUA_T_NIL)
357 { /* must call getglobal fallback */
358 tag(top-1) = LUA_T_STRING;
359 tsvalue(top-1) = lua_table[n].varname;
360 callFB(FB_GETGLOBAL);
361 }
362}
363
306/*364/*
307** Traverse all objects on stack365** Traverse all objects on stack
308*/366*/
@@ -340,7 +398,7 @@ void lua_error (char *s) · 31 unmodified lines
340}398}
341 399
342 400
343lua_Object lua_stackedfunction (int level)401lua_Function lua_stackedfunction (int level)
344{402{
345 Object *p = top;403 Object *p = top;
346 while (--p >= stack)404 while (--p >= stack)
@@ -351,13 +409,45 @@ lua_Object lua_stackedfunction (int level) · 4 unmodified lines
351}409}
352 410
353 411
354int lua_currentline (lua_Object func)412int lua_currentline (lua_Function func)
355{413{
356 Object *f = Address(func);414 Object *f = Address(func);
357 return (f+1 < top && (f+1)->tag == LUA_T_LINE) ? (f+1)->value.i : -1;415 return (f+1 < top && (f+1)->tag == LUA_T_LINE) ? (f+1)->value.i : -1;
358}416}
359 417
360 418
419lua_Object lua_getlocal (lua_Function func, int local_number, char **name)
420{
421 Object *f = luaI_Address(func);
422 *name = luaI_getlocalname(f->value.tf, local_number, lua_currentline(func));
423 if (*name)
424 {
425 /* if "*name", there must be a LUA_T_LINE */
426 /* therefore, f+2 points to function base */
427 return Ref((f+2)+(local_number-1));
428 }
429 else
430 return LUA_NOOBJECT;
431}
432
433int lua_setlocal (lua_Function func, int local_number)
434{
435 Object *f = Address(func);
436 char *name = luaI_getlocalname(f->value.tf, local_number, lua_currentline(func));
437 adjustC(1);
438 --top;
439 if (name)
440 {
441 /* if "name", there must be a LUA_T_LINE */
442 /* therefore, f+2 points to function base */
443 *((f+2)+(local_number-1)) = *top;
444 return 1;
445 }
446 else
447 return 0;
448}
449
450
361/*451/*
362** Execute a protected call. Assumes that function is at CBase and452** Execute a protected call. Assumes that function is at CBase and
363** parameters are on top of it. Leave nResults on the stack. 453** parameters are on top of it. Leave nResults on the stack.
@@ -386,6 +476,16 @@ static int do_protectedrun (int nResults) · 22 unmodified lines
386 return status;476 return status;
387}477}
388 478
479int luaI_dorun (TFunc *tf)
480{
481 int status;
482 adjustC(1); /* one slot for the pseudo-function */
483 stack[CBase].tag = LUA_T_FUNCTION;
484 stack[CBase].value.tf = tf;
485 status = do_protectedrun(0);
486 adjustC(0);
487 return status;
488}
389 489
390static int do_protectedmain (void)490static int do_protectedmain (void)
391{491{
@@ -394,16 +494,12 @@ static int do_protectedmain (void) · 2 unmodified lines
394 jmp_buf myErrorJmp;494 jmp_buf myErrorJmp;
395 jmp_buf *oldErr = errorJmp;495 jmp_buf *oldErr = errorJmp;
396 errorJmp = &myErrorJmp;496 errorJmp = &myErrorJmp;
397 adjustC(1); /* one slot for the pseudo-function */497 luaI_initTFunc(&tf);
398 stack[CBase].tag = LUA_T_FUNCTION;
399 stack[CBase].value.tf = &tf;
400 tf.lineDefined = 0;
401 tf.fileName = lua_parsedfile;498 tf.fileName = lua_parsedfile;
402 tf.code = NULL;
403 if (setjmp(myErrorJmp) == 0)499 if (setjmp(myErrorJmp) == 0)
404 {500 {
405 lua_parse(&tf);501 lua_parse(&tf);
406 status = do_protectedrun(0);502 status = luaI_dorun(&tf);
407 }503 }
408 else504 else
409 {505 {
@@ -411,8 +507,7 @@ static int do_protectedmain (void) · 1 unmodified line
411 adjustC(0); /* erase extra slot */507 adjustC(0); /* erase extra slot */
412 }508 }
413 errorJmp = oldErr;509 errorJmp = oldErr;
414 if (tf.code)510 luaI_free(tf.code);
415 luaI_free(tf.code);
416 return status;511 return status;
417}512}
418 513
@@ -449,13 +544,13 @@ int lua_call (char *funcname) · 30 unmodified lines
449int lua_dofile (char *filename)544int lua_dofile (char *filename)
450{545{
451 int status;546 int status;
452 char *message = lua_openfile (filename);547 int c;
453 if (message)548 FILE *f = lua_openfile(filename);
454 {549 if (f == NULL)
455 lua_message(message);
456 return 1;550 return 1;
457 }551 c = fgetc(f);
458 status = do_protectedmain();552 ungetc(c, f);
553 status = (c == ID_CHUNK) ? luaI_undump(f) : do_protectedmain();
459 lua_closefile();554 lua_closefile();
460 return status;555 return status;
461}556}
@@ -514,8 +609,9 @@ static StkId Cblocks[MAX_C_BLOCKS]; · 52 unmodified lines
514*/609*/
515void lua_beginblock (void)610void lua_beginblock (void)
516{611{
517 if (numCblocks < MAX_C_BLOCKS)612 if (numCblocks >= MAX_C_BLOCKS)
518 Cblocks[numCblocks] = CBase;613 lua_error("`lua_beginblock': too many nested blocks");
614 Cblocks[numCblocks] = CBase;
519 numCblocks++;615 numCblocks++;
520}616}
521 617
@@ -525,11 +621,8 @@ void lua_beginblock (void) · 3 unmodified lines
525void lua_endblock (void)621void lua_endblock (void)
526{622{
527 --numCblocks;623 --numCblocks;
528 if (numCblocks < MAX_C_BLOCKS)624 CBase = Cblocks[numCblocks];
529 {625 adjustC(0);
530 CBase = Cblocks[numCblocks];
531 adjustC(0);
532 }
533}626}
534 627
535/* 628/*
@@ -566,6 +659,23 @@ lua_Object lua_getparam (int number) · 30 unmodified lines
566 return CBase-CnResults+number;659 return CBase-CnResults+number;
567}660}
568 661
662int lua_isnumber (lua_Object object)
663{
664 return (object != LUA_NOOBJECT) && (tonumber(Address(object)) == 0);
665}
666
667int lua_isstring (lua_Object object)
668{
669 int t = lua_type(object);
670 return (t == LUA_T_STRING) || (t == LUA_T_NUMBER);
671}
672
673int lua_isfunction (lua_Object object)
674{
675 int t = lua_type(object);
676 return (t == LUA_T_FUNCTION) || (t == LUA_T_CFUNCTION);
677}
678
569/*679/*
570** Given an object handle, return its number value. On error, return 0.0.680** Given an object handle, return its number value. On error, return 0.0.
571*/681*/
@@ -607,27 +717,31 @@ void *lua_getuserdata (lua_Object object) · 35 unmodified lines
607}717}
608 718
609 719
610lua_Object lua_getlocked (int ref)720lua_Object lua_getref (int ref)
611{721{
612 adjustC(0);722 Object *o = luaI_getref(ref);
613 *top = *luaI_getlocked(ref);723 if (o == NULL)
614 incr_top;724 return LUA_NOOBJECT;
615 CBase++; /* incorporate object in the stack */725 adjustC(0);
616 return Ref(top-1);726 luaI_pushobject(o);
727 CBase++; /* incorporate object in the stack */
728 return Ref(top-1);
617}729}
618 730
619 731
620void lua_pushlocked (int ref)732void lua_pushref (int ref)
621{733{
622 *top = *luaI_getlocked(ref);734 Object *o = luaI_getref(ref);
623 incr_top;735 if (o == NULL)
736 lua_error("access to invalid (possibly garbage collected) reference");
737 luaI_pushobject(o);
624}738}
625 739
626 740
627int lua_lock (void)741int lua_ref (int lock)
628{742{
629 adjustC(1);743 adjustC(1);
630 return luaI_lock(--top);744 return luaI_ref(--top, lock);
631}745}
632 746
633 747
@@ -637,10 +751,8 @@ int lua_lock (void) · 3 unmodified lines
637*/751*/
638lua_Object lua_getglobal (char *name)752lua_Object lua_getglobal (char *name)
639{753{
640 Word n = luaI_findsymbolbyname(name);
641 adjustC(0);754 adjustC(0);
642 *top = s_object(n);755 getglobal(luaI_findsymbolbyname(name));
643 incr_top;
644 CBase++; /* incorporate object in the stack */756 CBase++; /* incorporate object in the stack */
645 return Ref(top-1);757 return Ref(top-1);
646}758}
@@ -678,20 +790,17 @@ void lua_pushnumber (real n) · 31 unmodified lines
678*/790*/
679void lua_pushstring (char *s)791void lua_pushstring (char *s)
680{792{
681 tsvalue(top) = lua_createstring(s);793 if (s == NULL)
682 tag(top) = LUA_T_STRING;794 tag(top) = LUA_T_NIL;
683 incr_top;795 else
684}796 {
685 797 tsvalue(top) = lua_createstring(s);
686/*798 tag(top) = LUA_T_STRING;
687** Push an object (tag=string) on stack and register it on the constant table.799 }
688*/800 incr_top;
689void lua_pushliteral (char *s)
690{
691 tsvalue(top) = lua_constant[luaI_findconstantbyname(s)];
692 tag(top) = LUA_T_STRING;
693 incr_top;
694}801}
802/*>>>>>>>>>#undef lua_pushliteral
803void lua_pushliteral(char *s) { lua_pushstring(s); }*/
695 804
696/*805/*
697** Push an object (tag=cfunction) to stack.806** Push an object (tag=cfunction) to stack.
@@ -707,27 +816,29 @@ void lua_pushcfunction (lua_CFunction fn) · 9 unmodified lines
707*/816*/
708void lua_pushusertag (void *u, int tag)817void lua_pushusertag (void *u, int tag)
709{818{
710 if (tag < LUA_T_USERDATA) return;819 if (tag < LUA_T_USERDATA)
820 lua_error("invalid tag in `lua_pushusertag'");
711 tag(top) = tag; uvalue(top) = u;821 tag(top) = tag; uvalue(top) = u;
712 incr_top;822 incr_top;
713}823}
714 824
715/*825/*
716** Push a lua_Object to stack.826** Push an object on the stack.
717*/827*/
718void lua_pushobject (lua_Object o)828void luaI_pushobject (Object *o)
719{829{
720 *top = *Address(o);830 *top = *o;
721 incr_top;831 incr_top;
722}832}
723 833
724/*834/*
725** Push an object on the stack.835** Push a lua_Object on stack.
726*/836*/
727void luaI_pushobject (Object *o)837void lua_pushobject (lua_Object o)
728{838{
729 *top = *o;839 if (o == LUA_NOOBJECT)
730 incr_top;840 lua_error("attempt to push a NOOBJECT");
841 luaI_pushobject(Address(o));
731}842}
732 843
733int lua_type (lua_Object o)844int lua_type (lua_Object o)
@@ -783,6 +894,8 @@ static void comparison (lua_Type tag_less, lua_Type tag_equal, · 49 unmodified lines
783*/894*/
784static StkId lua_execute (Byte *pc, StkId base)895static StkId lua_execute (Byte *pc, StkId base)
785{896{
897 if (lua_callhook)
898 callHook (base, LUA_T_MARK, 0);
786 while (1)899 while (1)
787 {900 {
788 OpCode opcode;901 OpCode opcode;
@@ -849,8 +962,7 @@ static StkId lua_execute (Byte *pc, StkId base) · 60 unmodified lines
849 {962 {
850 CodeWord code;963 CodeWord code;
851 get_word(code,pc);964 get_word(code,pc);
852 *top = s_object(code.w);965 getglobal(code.w);
853 incr_top;
854 }966 }
855 break;967 break;
856 968
@@ -1143,10 +1255,10 @@ static StkId lua_execute (Byte *pc, StkId base) · 286 unmodified lines
1143 break;1255 break;
1144 1256
1145 case RETCODE0:1257 case RETCODE0:
1146 return base;
1147
1148 case RETCODE:1258 case RETCODE:
1149 return base+*pc;1259 if (lua_callhook)
1260 callHook (base, LUA_T_MARK, 1);
1261 return (base + ((opcode==RETCODE0) ? 0 : *pc));
1150 1262
1151 case SETLINE:1263 case SETLINE:
1152 {1264 {
@@ -1160,6 +1272,8 @@ static StkId lua_execute (Byte *pc, StkId base) · 7 unmodified lines
1160 (stack+base-1)->tag = LUA_T_LINE;1272 (stack+base-1)->tag = LUA_T_LINE;
1161 }1273 }
1162 (stack+base-1)->value.i = code.w;1274 (stack+base-1)->value.i = code.w;
1275 if (lua_linehook)
1276 lineHook (code.w);
1163 break;1277 break;
1164 }1278 }
1165 1279
@@ -1169,4 +1283,3 @@ static StkId lua_execute (Byte *pc, StkId base) · 3 unmodified lines
1169 }1283 }
1170}1284}
1171 1285
1172
src/opcode.h+6−20
@@ -1,6 +1,6 @@
1/*1/*
2** TeCGraf - PUC-Rio2** TeCGraf - PUC-Rio
3** $Id: opcode.h,v 3.14 1995/10/25 13:05:51 roberto Exp $3** $Id: opcode.h,v 3.20 1996/03/15 13:13:13 roberto Exp $
4*/4*/
5 5
6#ifndef opcode_h6#ifndef opcode_h
@@ -11,9 +11,6 @@ · 4 unmodified lines
11#include "tree.h"11#include "tree.h"
12#include "func.h"12#include "func.h"
13 13
14#ifndef real
15#define real float
16#endif
17 14
18#define FIELDS_PER_FLUSH 4015#define FIELDS_PER_FLUSH 40
19 16
@@ -74,12 +71,9 @@ typedef enum · 54 unmodified lines
74#define MULT_RET 25571#define MULT_RET 255
75 72
76 73
77typedef void (*Cfunction) (void);
78typedef int (*Input) (void);
79
80typedef union74typedef union
81{75{
82 Cfunction f;76 lua_CFunction f;
83 real n;77 real n;
84 TaggedString *ts;78 TaggedString *ts;
85 TFunc *tf;79 TFunc *tf;
@@ -94,10 +88,6 @@ typedef struct Object · 8 unmodified lines
94 Value value;88 Value value;
95} Object;89} Object;
96 90
97typedef struct
98{
99 Object object;
100} Symbol;
101 91
102/* Macros to access structure members */92/* Macros to access structure members */
103#define tag(o) ((o)->tag)93#define tag(o) ((o)->tag)
@@ -119,14 +109,14 @@ typedef struct · 15 unmodified lines
119 109
120typedef union110typedef union
121{111{
122 struct {char c1; char c2;} m;112 struct {Byte c1; Byte c2;} m;
123 Word w;113 Word w;
124} CodeWord;114} CodeWord;
125#define get_word(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;}115#define get_word(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;}
126 116
127typedef union117typedef union
128{118{
129 struct {char c1; char c2; char c3; char c4;} m;119 struct {Byte c1; Byte c2; Byte c3; Byte c4;} m;
130 float f;120 float f;
131} CodeFloat;121} CodeFloat;
132#define get_float(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\122#define get_float(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\
@@ -134,7 +124,7 @@ typedef union · 1 unmodified line
134 124
135typedef union125typedef union
136{126{
137 struct {char c1; char c2; char c3; char c4;} m;127 struct {Byte c1; Byte c2; Byte c3; Byte c4;} m;
138 TFunc *tf;128 TFunc *tf;
139} CodeCode;129} CodeCode;
140#define get_code(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\130#define get_code(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\
@@ -142,16 +132,12 @@ typedef union · 1 unmodified line
142 132
143 133
144/* Exported functions */134/* Exported functions */
145char *lua_strdup (char *l);
146
147void lua_setinput (Input fn); /* from "lex.c" module */
148char *lua_lasttext (void); /* from "lex.c" module */
149int yylex (void); /* from "lex.c" module */
150void lua_parse (TFunc *tf); /* from "lua.stx" module */135void lua_parse (TFunc *tf); /* from "lua.stx" module */
151void luaI_codedebugline (int line); /* from "lua.stx" module */136void luaI_codedebugline (int line); /* from "lua.stx" module */
152void lua_travstack (int (*fn)(Object *));137void lua_travstack (int (*fn)(Object *));
153Object *luaI_Address (lua_Object o);138Object *luaI_Address (lua_Object o);
154void luaI_pushobject (Object *o);139void luaI_pushobject (Object *o);
155void luaI_gcFB (Object *o);140void luaI_gcFB (Object *o);
141int luaI_dorun (TFunc *tf);
156 142
157#endif143#endif
src/parser.c+439−663
@@ -1,25 +1,26 @@
1#if defined (__cplusplus) || defined (c_plusplus)1#if defined (__cplusplus) || defined (c_plusplus)
2#include <c_varieties.h>2#include <c_varieties.h>
3#ifdef __EXTERN_C__3#ifdef __EXTERN_C__
4 EXTERN_FUNCTION ( extern int yylex, ());4 EXTERN_FUNCTION ( extern int luaY_lex, ());
5#else5#else
6 extern int yylex();6 extern int luaY_lex();
7#endif7#endif
8 extern void yyerror(char *);8 extern void luaY_error(char *);
9 extern int yyparse();9 extern int luaY_parse();
10#endif10#endif
11 11
12#include <malloc.h>12#include <stdlib.h>
13 13
14# line 2 "lua.stx"14# line 2 "lua.stx"
15 15
16char *rcs_luastx = "$Id: lua.stx,v 3.25 1995/10/26 17:02:50 roberto Exp $";16char *rcs_luastx = "$Id: parser.c,v 1.1 1996/05/14 19:44:57 lhf Exp $";
17 17
18#include <stdio.h>18#include <stdio.h>
19#include <stdlib.h>19#include <stdlib.h>
20#include <string.h>
21 20
21#include "luadebug.h"
22#include "mem.h"22#include "mem.h"
23#include "lex.h"
23#include "opcode.h"24#include "opcode.h"
24#include "hash.h"25#include "hash.h"
25#include "inout.h"26#include "inout.h"
@@ -29,7 +30,7 @@ char *rcs_luastx = "$Id: lua.stx,v 3.25 1995/10/26 17:02:50 roberto Exp $"; · 3 unmodified lines
29#include "func.h"30#include "func.h"
30 31
31/* to avoid warnings generated by yacc */32/* to avoid warnings generated by yacc */
32int yyparse (void);33int luaY_parse (void);
33#define malloc luaI_malloc34#define malloc luaI_malloc
34#define realloc luaI_realloc35#define realloc luaI_realloc
35#define free luaI_free36#define free luaI_free
@@ -43,7 +44,7 @@ int yyparse (void); · 7 unmodified lines
43#endif44#endif
44static int maxcode;45static int maxcode;
45static int maxmain;46static int maxmain;
46static Long maxcurr; /* to allow maxcurr *= 2 without overflow */47static int maxcurr;
47static Byte *funcCode = NULL;48static Byte *funcCode = NULL;
48static Byte **initcode;49static Byte **initcode;
49static Byte *basepc;50static Byte *basepc;
@@ -57,35 +58,32 @@ static Long varbuffer[MAXVAR]; /* variables in an assignment list; · 7 unmodified lines
57static int nvarbuffer=0; /* number of variables at a list */58static int nvarbuffer=0; /* number of variables at a list */
58 59
59#define MAXLOCALS 3260#define MAXLOCALS 32
60static Word localvar[MAXLOCALS]; /* store local variable names */61static TaggedString *localvar[MAXLOCALS]; /* store local variable names */
61static int nlocalvar=0; /* number of local variables */62static int nlocalvar=0; /* number of local variables */
62 63
63#define MAXFIELDS FIELDS_PER_FLUSH*264#define MAXFIELDS FIELDS_PER_FLUSH*2
64static Word fields[MAXFIELDS]; /* fieldnames to be flushed */65static Word fields[MAXFIELDS]; /* fieldnames to be flushed */
65static int nfields=0;66static int nfields=0;
66 67
68int lua_debug = 0;
67 69
68/* Internal functions */70/* Internal functions */
69 71
70static void yyerror (char *s)72static void luaY_error (char *s)
71{73{
72 static char msg[256];74 char msg[256];
73 sprintf (msg,"%s near \"%s\" at line %d in file `%s'",75 char *token = lua_lasttext();
74 s, lua_lasttext (), lua_linenumber, lua_parsedfile);76 if (token[0] == 0)
77 token = "<eof>";
78 sprintf (msg,"%s; last token read: \"%s\" at line %d in file `%s'",
79 s, token, lua_linenumber, lua_parsedfile);
75 lua_error (msg);80 lua_error (msg);
76}81}
77 82
78static void code_byte (Byte c)83static void code_byte (Byte c)
79{84{
80 if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */85 if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */
81 {86 maxcurr = growvector(&basepc, maxcurr, Byte, codeEM, MAX_INT);
82 if (maxcurr >= MAX_INT)
83 lua_error("code size overflow");
84 maxcurr *= 2;
85 if (maxcurr >= MAX_INT)
86 maxcurr = MAX_INT;
87 basepc = growvector(basepc, maxcurr, Byte);
88 }
89 basepc[pc++] = c;87 basepc[pc++] = c;
90}88}
91 89
@@ -117,10 +115,12 @@ static void code_code (TFunc *tf) · 25 unmodified lines
117 code_byte(code.m.c4);115 code_byte(code.m.c4);
118}116}
119 117
120static void code_word_at (Byte *p, Word n)118static void code_word_at (Byte *p, int n)
121{119{
122 CodeWord code;120 CodeWord code;
123 code.w = n;121 if ((Word)n != n)
122 luaY_error("block too big");
123 code.w = (Word)n;
124 *p++ = code.m.c1;124 *p++ = code.m.c1;
125 *p++ = code.m.c2;125 *p++ = code.m.c2;
126}126}
@@ -130,7 +130,7 @@ static void push_field (Word name) · 3 unmodified lines
130 if (nfields < MAXFIELDS)130 if (nfields < MAXFIELDS)
131 fields[nfields++] = name;131 fields[nfields++] = name;
132 else132 else
133 lua_error ("too many fields in nested constructors");133 luaY_error ("too many fields in nested constructors");
134}134}
135 135
136static void flush_record (int n)136static void flush_record (int n)
@@ -155,24 +155,24 @@ static void flush_list (int m, int n) · 18 unmodified lines
155 code_byte(m);155 code_byte(m);
156 }156 }
157 else157 else
158 lua_error ("list constructor too long");158 luaY_error ("list constructor too long");
159 code_byte(n);159 code_byte(n);
160}160}
161 161
162static void add_localvar (Word name)162static void store_localvar (TaggedString *name, int n)
163{163{
164 if (nlocalvar < MAXLOCALS)164 if (nlocalvar+n < MAXLOCALS)
165 localvar[nlocalvar++] = name;165 localvar[nlocalvar+n] = name;
166 else166 else
167 lua_error ("too many local variables");167 luaY_error ("too many local variables");
168 if (lua_debug)
169 luaI_registerlocalvar(name, lua_linenumber);
168}170}
169 171
170static void store_localvar (Word name, int n)172static void add_localvar (TaggedString *name)
171{173{
172 if (nlocalvar+n < MAXLOCALS)174 store_localvar(name, 0);
173 localvar[nlocalvar+n] = name;175 nlocalvar++;
174 else
175 lua_error ("too many local variables");
176}176}
177 177
178static void add_varbuffer (Long var)178static void add_varbuffer (Long var)
@@ -180,7 +180,7 @@ static void add_varbuffer (Long var) · 1 unmodified line
180 if (nvarbuffer < MAXVAR)180 if (nvarbuffer < MAXVAR)
181 varbuffer[nvarbuffer++] = var;181 varbuffer[nvarbuffer++] = var;
182 else182 else
183 lua_error ("variable buffer overflow");183 luaY_error ("variable buffer overflow");
184}184}
185 185
186static void code_number (float f)186static void code_number (float f)
@@ -210,7 +210,7 @@ static void code_number (float f) · 23 unmodified lines
210/*210/*
211** Search a local name and if find return its index. If do not find return -1211** Search a local name and if find return its index. If do not find return -1
212*/212*/
213static int lua_localname (Word n)213static int lua_localname (TaggedString *n)
214{214{
215 int i;215 int i;
216 for (i=nlocalvar-1; i >= 0; i--)216 for (i=nlocalvar-1; i >= 0; i--)
@@ -401,13 +401,12 @@ static void codeIf (Long thenAdd, Long elseAdd) · 184 unmodified lines
401*/401*/
402void lua_parse (TFunc *tf)402void lua_parse (TFunc *tf)
403{403{
404 lua_debug = 0;
405 initcode = &(tf->code);404 initcode = &(tf->code);
406 *initcode = newvector(CODE_BLOCK, Byte);405 *initcode = newvector(CODE_BLOCK, Byte);
407 maincode = 0; 406 maincode = 0;
408 maxmain = CODE_BLOCK;407 maxmain = CODE_BLOCK;
409 change2main();408 change2main();
410 if (yyparse ()) lua_error("parse error");409 if (luaY_parse ()) lua_error("parse error");
411 savemain();410 savemain();
412 (*initcode)[maincode++] = RETCODE0;411 (*initcode)[maincode++] = RETCODE0;
413 tf->size = maincode;412 tf->size = maincode;
@@ -419,7 +418,7 @@ void lua_parse (TFunc *tf) · 5 unmodified lines
419 418
420 419
421 420
422# line 411 "lua.stx"421# line 410 "lua.stx"
423typedef union 422typedef union
424{423{
425 int vInt;424 int vInt;
@@ -428,7 +427,7 @@ typedef union · 2 unmodified lines
428 Word vWord;427 Word vWord;
429 Long vLong;428 Long vLong;
430 TFunc *pFunc;429 TFunc *pFunc;
431 TreeNode *pNode;430 TaggedString *pTStr;
432} YYSTYPE;431} YYSTYPE;
433# define WRONGTOKEN 257432# define WRONGTOKEN 257
434# define NIL 258433# define NIL 258
@@ -457,244 +456,19 @@ typedef union · 22 unmodified lines
457# define CONC 281456# define CONC 281
458# define UNARY 282457# define UNARY 282
459# define NOT 283458# define NOT 283
460#define yyclearin yychar = -1459#define luaY_clearin luaY_char = -1
461#define yyerrok yyerrflag = 0460#define luaY_errok luaY_errflag = 0
462extern int yychar;461extern int luaY_char;
463extern int yyerrflag;462extern int luaY_errflag;
464#ifndef YYMAXDEPTH463#ifndef YYMAXDEPTH
465#define YYMAXDEPTH 150464#define YYMAXDEPTH 150
466#endif465#endif
467YYSTYPE yylval, yyval;466YYSTYPE luaY_lval, luaY_val;
468# define YYERRCODE 256467# define YYERRCODE 256
469 468
470# line 789 "lua.stx"469# line 788 "lua.stx"
471
472
473#if LISTING
474
475static void PrintCode (Byte *code, Byte *end)
476{
477 Byte *p = code;
478 printf ("\n\nCODE\n");
479 while (p != end)
480 {
481 switch ((OpCode)*p)
482 {
483 case PUSHNIL: printf ("%d PUSHNIL\n", (p++)-code); break;
484 case PUSH0: case PUSH1: case PUSH2:
485 printf ("%d PUSH%c\n", p-code, *p-PUSH0+'0');
486 p++;
487 break;
488 case PUSHBYTE:
489 printf ("%d PUSHBYTE %d\n", p-code, *(++p));
490 p++;
491 break;
492 case PUSHWORD:
493 {
494 CodeWord c;
495 int n = p-code;
496 p++;
497 get_word(c,p);
498 printf ("%d PUSHWORD %d\n", n, c.w);
499 }
500 break;
501 case PUSHFLOAT:
502 {
503 CodeFloat c;
504 int n = p-code;
505 p++;
506 get_float(c,p);
507 printf ("%d PUSHFLOAT %f\n", n, c.f);
508 }
509 break;
510 case PUSHSTRING:
511 {
512 CodeWord c;
513 int n = p-code;
514 p++;
515 get_word(c,p);
516 printf ("%d PUSHSTRING %d\n", n, c.w);
517 }
518 break;
519 case PUSHFUNCTION:
520 {
521 CodeCode c;
522 int n = p-code;
523 p++;
524 get_code(c,p);
525 printf ("%d PUSHFUNCTION %p\n", n, c.tf);
526 }
527 break;
528
529 case PUSHLOCAL0: case PUSHLOCAL1: case PUSHLOCAL2: case PUSHLOCAL3:
530 case PUSHLOCAL4: case PUSHLOCAL5: case PUSHLOCAL6: case PUSHLOCAL7:
531 case PUSHLOCAL8: case PUSHLOCAL9:
532 printf ("%d PUSHLOCAL%c\n", p-code, *p-PUSHLOCAL0+'0');
533 p++;
534 break;
535 case PUSHLOCAL: printf ("%d PUSHLOCAL %d\n", p-code, *(++p));
536 p++;
537 break;
538 case PUSHGLOBAL:
539 {
540 CodeWord c;
541 int n = p-code;
542 p++;
543 get_word(c,p);
544 printf ("%d PUSHGLOBAL %d\n", n, c.w);
545 }
546 break;
547 case PUSHINDEXED: printf ("%d PUSHINDEXED\n", (p++)-code); break;
548 case STORELOCAL0: case STORELOCAL1: case STORELOCAL2: case STORELOCAL3:
549 case STORELOCAL4: case STORELOCAL5: case STORELOCAL6: case STORELOCAL7:
550 case STORELOCAL8: case STORELOCAL9:
551 printf ("%d STORELOCAL%c\n", p-code, *p-STORELOCAL0+'0');
552 p++;
553 break;
554 case STORELOCAL:
555 printf ("%d STORELOCAL %d\n", p-code, *(++p));
556 p++;
557 break;
558 case STOREGLOBAL:
559 {
560 CodeWord c;
561 int n = p-code;
562 p++;
563 get_word(c,p);
564 printf ("%d STOREGLOBAL %d\n", n, c.w);
565 }
566 break;
567 case PUSHSELF:
568 {
569 CodeWord c;
570 int n = p-code;
571 p++;
572 get_word(c,p);
573 printf ("%d PUSHSELF %d\n", n, c.w);
574 }
575 break;
576 case STOREINDEXED0: printf ("%d STOREINDEXED0\n", (p++)-code); break;
577 case STOREINDEXED: printf ("%d STOREINDEXED %d\n", p-code, *(++p));
578 p++;
579 break;
580 case STORELIST0:
581 printf("%d STORELIST0 %d\n", p-code, *(++p));
582 p++;
583 break;
584 case STORELIST:
585 printf("%d STORELIST %d %d\n", p-code, *(p+1), *(p+2));
586 p+=3;
587 break;
588 case STORERECORD:
589 printf("%d STORERECORD %d\n", p-code, *(++p));
590 p += *p*sizeof(Word) + 1;
591 break;
592 case ADJUST0: printf ("%d ADJUST0\n", (p++)-code); break;
593 case ADJUST:
594 printf ("%d ADJUST %d\n", p-code, *(++p));
595 p++;
596 break;
597 case CREATEARRAY:
598 {
599 CodeWord c;
600 int n = p-code;
601 p++;
602 get_word(c,p);
603 printf ("%d CREATEARRAY %d\n", n, c.w);
604 break;
605 }
606 case EQOP: printf ("%d EQOP\n", (p++)-code); break;
607 case LTOP: printf ("%d LTOP\n", (p++)-code); break;
608 case LEOP: printf ("%d LEOP\n", (p++)-code); break;
609 case ADDOP: printf ("%d ADDOP\n", (p++)-code); break;
610 case SUBOP: printf ("%d SUBOP\n", (p++)-code); break;
611 case MULTOP: printf ("%d MULTOP\n", (p++)-code); break;
612 case DIVOP: printf ("%d DIVOP\n", (p++)-code); break;
613 case POWOP: printf ("%d POWOP\n", (p++)-code); break;
614 case CONCOP: printf ("%d CONCOP\n", (p++)-code); break;
615 case MINUSOP: printf ("%d MINUSOP\n", (p++)-code); break;
616 case NOTOP: printf ("%d NOTOP\n", (p++)-code); break;
617 case ONTJMP:
618 {
619 CodeWord c;
620 int n = p-code;
621 p++;
622 get_word(c,p);
623 printf ("%d ONTJMP %d\n", n, c.w);
624 }
625 break;
626 case ONFJMP:
627 {
628 CodeWord c;
629 int n = p-code;
630 p++;
631 get_word(c,p);
632 printf ("%d ONFJMP %d\n", n, c.w);
633 }
634 break;
635 case JMP:
636 {
637 CodeWord c;
638 int n = p-code;
639 p++;
640 get_word(c,p);
641 printf ("%d JMP %d\n", n, c.w);
642 }
643 break;
644 case UPJMP:
645 {
646 CodeWord c;
647 int n = p-code;
648 p++;
649 get_word(c,p);
650 printf ("%d UPJMP %d\n", n, c.w);
651 }
652 break;
653 case IFFJMP:
654 {
655 CodeWord c;
656 int n = p-code;
657 p++;
658 get_word(c,p);
659 printf ("%d IFFJMP %d\n", n, c.w);
660 }
661 break;
662 case IFFUPJMP:
663 {
664 CodeWord c;
665 int n = p-code;
666 p++;
667 get_word(c,p);
668 printf ("%d IFFUPJMP %d\n", n, c.w);
669 }
670 break;
671 case POP: printf ("%d POP\n", (p++)-code); break;
672 case CALLFUNC:
673 printf ("%d CALLFUNC %d %d\n", p-code, *(p+1), *(p+2));
674 p+=3;
675 break;
676 case RETCODE0: printf ("%d RETCODE0\n", (p++)-code); break;
677 case RETCODE:
678 printf ("%d RETCODE %d\n", p-code, *(++p));
679 p++;
680 break;
681 case SETLINE:
682 {
683 CodeWord c;
684 int n = p-code;
685 p++;
686 get_word(c,p);
687 printf ("%d SETLINE %d\n", n, c.w);
688 }
689 break;
690
691 default: printf ("%d Cannot happen: code %d\n", (p++)-code, *(p-1)); break;
692 }
693 }
694}
695#endif
696 470
697int yyexca[] ={471int luaY_exca[] ={
698-1, 1,472-1, 1,
699 0, -1,473 0, -1,
700 -2, 0,474 -2, 0,
@@ -760,7 +534,7 @@ int yyexca[] ={ · 59 unmodified lines
760 };534 };
761# define YYNPROD 100535# define YYNPROD 100
762# define YYLAST 311536# define YYLAST 311
763int yyact[]={537int luaY_act[]={
764 538
765 61, 59, 148, 60, 141, 62, 118, 61, 59, 90,539 61, 59, 148, 60, 141, 62, 118, 61, 59, 90,
766 60, 89, 62, 86, 84, 18, 42, 168, 54, 164,540 60, 89, 62, 86, 84, 18, 42, 168, 54, 164,
@@ -794,7 +568,7 @@ int yyact[]={ · 27 unmodified lines
794 0, 0, 0, 0, 0, 30, 31, 18, 30, 31,568 0, 0, 0, 0, 0, 30, 31, 18, 30, 31,
795 113, 0, 0, 0, 64, 0, 0, 34, 0, 0,569 113, 0, 0, 0, 64, 0, 0, 34, 0, 0,
796 34 };570 34 };
797int yypact[]={571int luaY_pact[]={
798 572
799 -1000, -188, -1000, -1000, 51, -1000, -258, 24, -1000, -1000,573 -1000, -188, -1000, -1000, 51, -1000, -258, 24, -1000, -1000,
800 47, -1000, -257, -1000, -1000, 93, -1000, 73, -1000, -1000,574 47, -1000, -257, -1000, -1000, 93, -1000, 73, -1000, -1000,
@@ -814,14 +588,14 @@ int yypact[]={ · 13 unmodified lines
814 -21, -1000, -1000, -1000, 51, -1000, -1000, -248, -1000, 24,588 -21, -1000, -1000, -1000, 51, -1000, -1000, -248, -1000, 24,
815 -1000, 69, -250, -1000, -1000, -1000, -42, -1000, -1000, -1000,589 -1000, 69, -250, -1000, -1000, -1000, -42, -1000, -1000, -1000,
816 -1000, -1000, -212, -1000 };590 -1000, -1000, -212, -1000 };
817int yypgo[]={591int luaY_pgo[]={
818 592
819 0, 216, 54, 44, 138, 76, 57, 212, 211, 210,593 0, 216, 54, 44, 138, 76, 57, 212, 211, 210,
820 205, 202, 201, 199, 61, 198, 195, 194, 189, 159,594 205, 202, 201, 199, 61, 198, 195, 194, 189, 159,
821 188, 186, 185, 184, 182, 92, 37, 181, 130, 32,595 188, 186, 185, 184, 182, 92, 37, 181, 130, 32,
822 180, 88, 34, 177, 176, 175, 172, 141, 170, 168,596 180, 88, 34, 177, 176, 175, 172, 141, 170, 168,
823 165, 163, 154, 134, 51, 56 };597 165, 163, 154, 134, 51, 56 };
824int yyr1[]={598int luaY_r1[]={
825 599
826 0, 1, 1, 1, 23, 23, 24, 21, 21, 22,600 0, 1, 1, 1, 23, 23, 24, 21, 21, 22,
827 30, 30, 26, 26, 25, 33, 25, 34, 25, 25,601 30, 30, 26, 26, 25, 33, 25, 34, 25, 25,
@@ -833,7 +607,7 @@ int yyr1[]={ · 5 unmodified lines
833 42, 42, 43, 10, 10, 15, 15, 44, 44, 13,607 42, 42, 43, 10, 10, 15, 15, 44, 44, 13,
834 13, 14, 14, 45, 16, 16, 17, 17, 7, 7,608 13, 14, 14, 45, 16, 16, 17, 17, 7, 7,
835 19, 19, 19, 20, 28, 11, 11, 12, 12, 27 };609 19, 19, 19, 20, 28, 11, 11, 12, 12, 27 };
836int yyr2[]={610int luaY_r2[]={
837 611
838 0, 0, 4, 4, 4, 2, 7, 3, 7, 11,612 0, 0, 4, 4, 4, 2, 7, 3, 7, 11,
839 0, 6, 0, 2, 17, 1, 17, 1, 13, 7,613 0, 6, 0, 2, 17, 1, 17, 1, 13, 7,
@@ -845,7 +619,7 @@ int yyr2[]={ · 5 unmodified lines
845 3, 7, 1, 7, 5, 1, 5, 0, 2, 1,619 3, 7, 1, 7, 5, 1, 5, 0, 2, 1,
846 5, 3, 7, 7, 1, 5, 3, 7, 3, 7,620 5, 3, 7, 7, 1, 5, 3, 7, 3, 7,
847 3, 9, 7, 3, 3, 3, 7, 1, 5, 3 };621 3, 9, 7, 3, 3, 3, 7, 1, 5, 3 };
848int yychk[]={622int luaY_chk[]={
849 623
850 -1000, -1, -23, -24, -25, -27, 270, 259, 263, 265,624 -1000, -1, -23, -24, -25, -27, 270, 259, 263, 265,
851 -7, -5, 269, 274, -19, -9, -20, -28, 273, -26,625 -7, -5, 269, 274, -19, -9, -20, -28, 273, -26,
@@ -865,7 +639,7 @@ int yychk[]={ · 13 unmodified lines
865 -31, -29, -2, -26, -3, -6, 267, -32, 261, 262,639 -31, -29, -2, -26, -3, -6, 267, -32, 261, 262,
866 -13, -14, -2, -26, 267, -29, -31, -44, 267, 260,640 -13, -14, -2, -26, 267, -29, -31, -44, 267, 260,
867 -2, -29, -2, -32 };641 -2, -29, -2, -32 };
868int yydef[]={642int luaY_def[]={
869 643
870 1, -2, 2, 3, 12, 5, 0, 56, 15, 17,644 1, -2, 2, 3, 12, 5, 0, 56, 15, 17,
871 0, 20, 0, 99, -2, 56, 90, 59, 93, 4,645 0, 20, 0, 99, -2, 56, 90, 59, 93, 4,
@@ -885,14 +659,14 @@ int yydef[]={ · 13 unmodified lines
885 83, 29, 18, 11, 12, -2, 9, 0, 25, 56,659 83, 29, 18, 11, 12, -2, 9, 0, 25, 56,
886 76, 77, 0, 28, 14, 23, 0, 80, 16, 29,660 76, 77, 0, 28, 14, 23, 0, 80, 16, 29,
887 25, 29, 22, 24 };661 25, 29, 22, 24 };
888typedef struct { char *t_name; int t_val; } yytoktype;662typedef struct { char *t_name; int t_val; } luaY_toktype;
889#ifndef YYDEBUG663#ifndef YYDEBUG
890# define YYDEBUG 0 /* don't allow debugging */664# define YYDEBUG 0 /* don't allow debugging */
891#endif665#endif
892 666
893#if YYDEBUG667#if YYDEBUG
894 668
895yytoktype yytoks[] =669luaY_toktype luaY_toks[] =
896{670{
897 "WRONGTOKEN", 257,671 "WRONGTOKEN", 257,
898 "NIL", 258,672 "NIL", 258,
@@ -931,7 +705,7 @@ yytoktype yytoks[] = · 32 unmodified lines
931 "-unknown-", -1 /* ends search */705 "-unknown-", -1 /* ends search */
932};706};
933 707
934char * yyreds[] =708char * luaY_reds[] =
935{709{
936 "-no such reduction-",710 "-no such reduction-",
937 "functionlist : /* empty */",711 "functionlist : /* empty */",
@@ -1048,24 +822,24 @@ char * yyreds[] = · 110 unmodified lines
1048/*822/*
1049** yacc user known macros and defines823** yacc user known macros and defines
1050*/824*/
1051#define YYERROR goto yyerrlab825#define YYERROR goto luaY_errlab
1052#define YYACCEPT return(0)826#define YYACCEPT return(0)
1053#define YYABORT return(1)827#define YYABORT return(1)
1054#define YYBACKUP( newtoken, newvalue )\828#define YYBACKUP( newtoken, newvalue )\
1055{\829{\
1056 if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\830 if ( luaY_char >= 0 || ( luaY_r2[ luaY_tmp ] >> 1 ) != 1 )\
1057 {\831 {\
1058 yyerror( "syntax error - cannot backup" );\832 luaY_error( "syntax error - cannot backup" );\
1059 goto yyerrlab;\833 goto luaY_errlab;\
1060 }\834 }\
1061 yychar = newtoken;\835 luaY_char = newtoken;\
1062 yystate = *yyps;\836 luaY_state = *luaY_ps;\
1063 yylval = newvalue;\837 luaY_lval = newvalue;\
1064 goto yynewstate;\838 goto luaY_newstate;\
1065}839}
1066#define YYRECOVERING() (!!yyerrflag)840#define YYRECOVERING() (!!luaY_errflag)
1067#define YYCOPY(to, from, type) \841#define YYCOPY(to, from, type) \
1068 (type *) memcpy(to, (char *) from, yynewmax * sizeof(type))842 (type *) memcpy(to, (char *) from, luaY_newmax * sizeof(type))
1069#ifndef YYDEBUG843#ifndef YYDEBUG
1070# define YYDEBUG 1 /* make debugging available */844# define YYDEBUG 1 /* make debugging available */
1071#endif845#endif
@@ -1085,7 +859,7 @@ EXTERN_FUNCTION ( extern void *memcpy, (void *, const void *, int) ); · 13 unmodified lines
1085/*859/*
1086** user known globals860** user known globals
1087*/861*/
1088int yydebug; /* set to 1 to get debugging */862int luaY_debug; /* set to 1 to get debugging */
1089 863
1090/*864/*
1091** driver internal defines865** driver internal defines
@@ -1095,50 +869,50 @@ int yydebug; /* set to 1 to get debugging */ · 3 unmodified lines
1095/*869/*
1096** static variables used by the parser870** static variables used by the parser
1097*/871*/
1098static YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv; /* value stack */872static YYSTYPE luaY__luaY_v[YYMAXDEPTH], *luaY_v = luaY__luaY_v; /* value stack */
1099static int yy_yys[YYMAXDEPTH], *yys = yy_yys; /* state stack */873static int luaY__luaY_s[YYMAXDEPTH], *luaY_s = luaY__luaY_s; /* state stack */
1100 874
1101static YYSTYPE *yypv; /* top of value stack */875static YYSTYPE *luaY_pv; /* top of value stack */
1102static int *yyps; /* top of state stack */876static int *luaY_ps; /* top of state stack */
1103 877
1104static int yystate; /* current state */878static int luaY_state; /* current state */
1105static int yytmp; /* extra var (lasts between blocks) */879static int luaY_tmp; /* extra var (lasts between blocks) */
1106 880
1107#if defined(__cplusplus) || defined(__STDC__) || defined(lint)881#if defined(__cplusplus) || defined(__STDC__) || defined(lint)
1108static int __yaccpar_lint_hack__ = 0; 882static int __yaccpar_lint_hack__ = 0;
1109 /* if you change the value from 0 to883 /* if you change the value from 0 to
1110 something else, make sure you know884 something else, make sure you know
1111 what to do with yyerrlab reference.885 what to do with luaY_errlab reference.
1112 This is a hack - to make sure C++ and886 This is a hack - to make sure C++ and
1113 lint are happy with the 4.1 yacc code. */887 lint are happy with the 4.1 yacc code. */
1114#endif888#endif
1115 889
1116int yynerrs; /* number of errors */890int luaY_nerrs; /* number of errors */
1117 891
1118int yyerrflag; /* error recovery flag */892int luaY_errflag; /* error recovery flag */
1119int yychar; /* current input token number */893int luaY_char; /* current input token number */
1120static unsigned yymaxdepth = YYMAXDEPTH;894static unsigned luaY_maxdepth = YYMAXDEPTH;
1121 895
1122 896
1123/*897/*
1124** yyparse - return 0 if worked, 1 if syntax error not recovered from898** luaY_parse - return 0 if worked, 1 if syntax error not recovered from
1125*/899*/
1126int900int
1127yyparse()901luaY_parse()
1128{902{
1129 register YYSTYPE *yypvt = (YYSTYPE*)0 ; /* top of value stack for903 register YYSTYPE *luaY_pvt = (YYSTYPE*)0 ; /* top of value stack for
1130$vars */904$vars */
1131 905
1132 /*906 /*
1133 ** Initialize externals - yyparse may be called more than once907 ** Initialize externals - luaY_parse may be called more than once
1134 */908 */
1135 yypv = &yyv[-1];909 luaY_pv = &luaY_v[-1];
1136 yyps = &yys[-1];910 luaY_ps = &luaY_s[-1];
1137 yystate = 0;911 luaY_state = 0;
1138 yytmp = 0;912 luaY_tmp = 0;
1139 yynerrs = 0;913 luaY_nerrs = 0;
1140 yyerrflag = 0;914 luaY_errflag = 0;
1141 yychar = -1;915 luaY_char = -1;
1142 916
1143#if defined(__cplusplus) || defined(__STDC__) || defined(lint)917#if defined(__cplusplus) || defined(__STDC__) || defined(lint)
1144/*918/*
@@ -1147,42 +921,42 @@ $vars */ · 2 unmodified lines
1147 */921 */
1148 switch (__yaccpar_lint_hack__)922 switch (__yaccpar_lint_hack__)
1149 {923 {
1150 case 1: goto yyerrlab;924 case 1: goto luaY_errlab;
1151 case 2: goto yynewstate;925 case 2: goto luaY_newstate;
1152 }926 }
1153#endif927#endif
1154 928
1155 {929 {
1156 register YYSTYPE *yy_pv; /* top of value stack */930 register YYSTYPE *luaY__pv; /* top of value stack */
1157 register int *yy_ps; /* top of state stack */931 register int *luaY__ps; /* top of state stack */
1158 register int yy_state; /* current state */932 register int luaY__state; /* current state */
1159 register int yy_n; /* internal state number info */933 register int luaY__n; /* internal state number info */
1160 934
1161 goto yystack;935 goto luaY_stack;
1162 936
1163 /*937 /*
1164 ** get globals into registers.938 ** get globals into registers.
1165 ** branch to here only if YYBACKUP was called.939 ** branch to here only if YYBACKUP was called.
1166 */940 */
1167 yynewstate:941 luaY_newstate:
1168 yy_pv = yypv;942 luaY__pv = luaY_pv;
1169 yy_ps = yyps;943 luaY__ps = luaY_ps;
1170 yy_state = yystate;944 luaY__state = luaY_state;
1171 goto yy_newstate;945 goto luaY__newstate;
1172 946
1173 /*947 /*
1174 ** get globals into registers.948 ** get globals into registers.
1175 ** either we just started, or we just finished a reduction949 ** either we just started, or we just finished a reduction
1176 */950 */
1177 yystack:951 luaY_stack:
1178 yy_pv = yypv;952 luaY__pv = luaY_pv;
1179 yy_ps = yyps;953 luaY__ps = luaY_ps;
1180 yy_state = yystate;954 luaY__state = luaY_state;
1181 955
1182 /*956 /*
1183 ** top of for (;;) loop while no reductions done957 ** top of for (;;) loop while no reductions done
1184 */958 */
1185 yy_stack:959 luaY__stack:
1186 /*960 /*
1187 ** put a state and value onto the stacks961 ** put a state and value onto the stacks
1188 */962 */
@@ -1193,153 +967,153 @@ $vars */ · 4 unmodified lines
1193 ** Note: linear search is used since time is not a real967 ** Note: linear search is used since time is not a real
1194 ** consideration while debugging.968 ** consideration while debugging.
1195 */969 */
1196 if ( yydebug )970 if ( luaY_debug )
1197 {971 {
1198 register int yy_i;972 register int luaY__i;
1199 973
1200 (void)printf( "State %d, token ", yy_state );974 (void)printf( "State %d, token ", luaY__state );
1201 if ( yychar == 0 )975 if ( luaY_char == 0 )
1202 (void)printf( "end-of-file\n" );976 (void)printf( "end-of-file\n" );
1203 else if ( yychar < 0 )977 else if ( luaY_char < 0 )
1204 (void)printf( "-none-\n" );978 (void)printf( "-none-\n" );
1205 else979 else
1206 {980 {
1207 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;981 for ( luaY__i = 0; luaY_toks[luaY__i].t_val >= 0;
1208 yy_i++ )982 luaY__i++ )
1209 {983 {
1210 if ( yytoks[yy_i].t_val == yychar )984 if ( luaY_toks[luaY__i].t_val == luaY_char )
1211 break;985 break;
1212 }986 }
1213 (void)printf( "%s\n", yytoks[yy_i].t_name );987 (void)printf( "%s\n", luaY_toks[luaY__i].t_name );
1214 }988 }
1215 }989 }
1216#endif /* YYDEBUG */990#endif /* YYDEBUG */
1217 if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */991 if ( ++luaY__ps >= &luaY_s[ luaY_maxdepth ] ) /* room on stack? */
1218 {992 {
1219 /*993 /*
1220 ** reallocate and recover. Note that pointers994 ** reallocate and recover. Note that pointers
1221 ** have to be reset, or bad things will happen995 ** have to be reset, or bad things will happen
1222 */ 996 */
1223 int yyps_index = (yy_ps - yys);997 int luaY_ps_index = (luaY__ps - luaY_s);
1224 int yypv_index = (yy_pv - yyv);998 int luaY_pv_index = (luaY__pv - luaY_v);
1225 int yypvt_index = (yypvt - yyv);999 int luaY_pvt_index = (luaY_pvt - luaY_v);
1226 int yynewmax;1000 int luaY_newmax;
1227 1001
1228 yynewmax = yymaxdepth + YYMAXDEPTH;1002 luaY_newmax = luaY_maxdepth + YYMAXDEPTH;
1229 if (yymaxdepth == YYMAXDEPTH) /* first time growth */1003 if (luaY_maxdepth == YYMAXDEPTH) /* first time growth */
1230 {1004 {
1231 YYSTYPE *newyyv = (YYSTYPE*)malloc(yynewmax*sizeof(YYSTYPE));1005 YYSTYPE *newluaY_v = (YYSTYPE*)malloc(luaY_newmax*sizeof(YYSTYPE));
1232 int *newyys = (int*)malloc(yynewmax*sizeof(int));1006 int *newluaY_s = (int*)malloc(luaY_newmax*sizeof(int));
1233 if (newyys != 0 && newyyv != 0)1007 if (newluaY_s != 0 && newluaY_v != 0)
1234 {1008 {
1235 yys = YYCOPY(newyys, yys, int);1009 luaY_s = YYCOPY(newluaY_s, luaY_s, int);
1236 yyv = YYCOPY(newyyv, yyv, YYSTYPE);1010 luaY_v = YYCOPY(newluaY_v, luaY_v, YYSTYPE);
1237 }1011 }
1238 else1012 else
1239 yynewmax = 0; /* failed */1013 luaY_newmax = 0; /* failed */
1240 }1014 }
1241 else /* not first time */1015 else /* not first time */
1242 {1016 {
1243 yyv = (YYSTYPE*)realloc((char*)yyv,1017 luaY_v = (YYSTYPE*)realloc((char*)luaY_v,
1244 yynewmax * sizeof(YYSTYPE));1018 luaY_newmax * sizeof(YYSTYPE));
1245 yys = (int*)realloc((char*)yys,1019 luaY_s = (int*)realloc((char*)luaY_s,
1246 yynewmax * sizeof(int));1020 luaY_newmax * sizeof(int));
1247 if (yys == 0 || yyv == 0)1021 if (luaY_s == 0 || luaY_v == 0)
1248 yynewmax = 0; /* failed */1022 luaY_newmax = 0; /* failed */
1249 }1023 }
1250 if (yynewmax <= yymaxdepth) /* tables not expanded */1024 if (luaY_newmax <= luaY_maxdepth) /* tables not expanded */
1251 {1025 {
1252 yyerror( "yacc stack overflow" );1026 luaY_error( "yacc stack overflow" );
1253 YYABORT;1027 YYABORT;
1254 }1028 }
1255 yymaxdepth = yynewmax;1029 luaY_maxdepth = luaY_newmax;
1256 1030
1257 yy_ps = yys + yyps_index;1031 luaY__ps = luaY_s + luaY_ps_index;
1258 yy_pv = yyv + yypv_index;1032 luaY__pv = luaY_v + luaY_pv_index;
1259 yypvt = yyv + yypvt_index;1033 luaY_pvt = luaY_v + luaY_pvt_index;
1260 }1034 }
1261 *yy_ps = yy_state;1035 *luaY__ps = luaY__state;
1262 *++yy_pv = yyval;1036 *++luaY__pv = luaY_val;
1263 1037
1264 /*1038 /*
1265 ** we have a new state - find out what to do1039 ** we have a new state - find out what to do
1266 */1040 */
1267 yy_newstate:1041 luaY__newstate:
1268 if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )1042 if ( ( luaY__n = luaY_pact[ luaY__state ] ) <= YYFLAG )
1269 goto yydefault; /* simple state */1043 goto luaY_default; /* simple state */
1270#if YYDEBUG1044#if YYDEBUG
1271 /*1045 /*
1272 ** if debugging, need to mark whether new token grabbed1046 ** if debugging, need to mark whether new token grabbed
1273 */1047 */
1274 yytmp = yychar < 0;1048 luaY_tmp = luaY_char < 0;
1275#endif1049#endif
1276 if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )1050 if ( ( luaY_char < 0 ) && ( ( luaY_char = luaY_lex() ) < 0 ) )
1277 yychar = 0; /* reached EOF */1051 luaY_char = 0; /* reached EOF */
1278#if YYDEBUG1052#if YYDEBUG
1279 if ( yydebug && yytmp )1053 if ( luaY_debug && luaY_tmp )
1280 {1054 {
1281 register int yy_i;1055 register int luaY__i;
1282 1056
1283 (void)printf( "Received token " );1057 (void)printf( "Received token " );
1284 if ( yychar == 0 )1058 if ( luaY_char == 0 )
1285 (void)printf( "end-of-file\n" );1059 (void)printf( "end-of-file\n" );
1286 else if ( yychar < 0 )1060 else if ( luaY_char < 0 )
1287 (void)printf( "-none-\n" );1061 (void)printf( "-none-\n" );
1288 else1062 else
1289 {1063 {
1290 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;1064 for ( luaY__i = 0; luaY_toks[luaY__i].t_val >= 0;
1291 yy_i++ )1065 luaY__i++ )
1292 {1066 {
1293 if ( yytoks[yy_i].t_val == yychar )1067 if ( luaY_toks[luaY__i].t_val == luaY_char )
1294 break;1068 break;
1295 }1069 }
1296 (void)printf( "%s\n", yytoks[yy_i].t_name );1070 (void)printf( "%s\n", luaY_toks[luaY__i].t_name );
1297 }1071 }
1298 }1072 }
1299#endif /* YYDEBUG */1073#endif /* YYDEBUG */
1300 if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )1074 if ( ( ( luaY__n += luaY_char ) < 0 ) || ( luaY__n >= YYLAST ) )
1301 goto yydefault;1075 goto luaY_default;
1302 if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/1076 if ( luaY_chk[ luaY__n = luaY_act[ luaY__n ] ] == luaY_char ) /*valid shift*/
1303 {1077 {
1304 yychar = -1;1078 luaY_char = -1;
1305 yyval = yylval;1079 luaY_val = luaY_lval;
1306 yy_state = yy_n;1080 luaY__state = luaY__n;
1307 if ( yyerrflag > 0 )1081 if ( luaY_errflag > 0 )
1308 yyerrflag--;1082 luaY_errflag--;
1309 goto yy_stack;1083 goto luaY__stack;
1310 }1084 }
1311 1085
1312 yydefault:1086 luaY_default:
1313 if ( ( yy_n = yydef[ yy_state ] ) == -2 )1087 if ( ( luaY__n = luaY_def[ luaY__state ] ) == -2 )
1314 {1088 {
1315#if YYDEBUG1089#if YYDEBUG
1316 yytmp = yychar < 0;1090 luaY_tmp = luaY_char < 0;
1317#endif1091#endif
1318 if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )1092 if ( ( luaY_char < 0 ) && ( ( luaY_char = luaY_lex() ) < 0 ) )
1319 yychar = 0; /* reached EOF */1093 luaY_char = 0; /* reached EOF */
1320#if YYDEBUG1094#if YYDEBUG
1321 if ( yydebug && yytmp )1095 if ( luaY_debug && luaY_tmp )
1322 {1096 {
1323 register int yy_i;1097 register int luaY__i;
1324 1098
1325 (void)printf( "Received token " );1099 (void)printf( "Received token " );
1326 if ( yychar == 0 )1100 if ( luaY_char == 0 )
1327 (void)printf( "end-of-file\n" );1101 (void)printf( "end-of-file\n" );
1328 else if ( yychar < 0 )1102 else if ( luaY_char < 0 )
1329 (void)printf( "-none-\n" );1103 (void)printf( "-none-\n" );
1330 else1104 else
1331 {1105 {
1332 for ( yy_i = 0;1106 for ( luaY__i = 0;
1333 yytoks[yy_i].t_val >= 0;1107 luaY_toks[luaY__i].t_val >= 0;
1334 yy_i++ )1108 luaY__i++ )
1335 {1109 {
1336 if ( yytoks[yy_i].t_val1110 if ( luaY_toks[luaY__i].t_val
1337 == yychar )1111 == luaY_char )
1338 {1112 {
1339 break;1113 break;
1340 }1114 }
1341 }1115 }
1342 (void)printf( "%s\n", yytoks[yy_i].t_name );1116 (void)printf( "%s\n", luaY_toks[luaY__i].t_name );
1343 }1117 }
1344 }1118 }
1345#endif /* YYDEBUG */1119#endif /* YYDEBUG */
@@ -1347,17 +1121,17 @@ $vars */ · 1 unmodified line
1347 ** look through exception table1121 ** look through exception table
1348 */1122 */
1349 {1123 {
1350 register int *yyxi = yyexca;1124 register int *luaY_xi = luaY_exca;
1351 1125
1352 while ( ( *yyxi != -1 ) ||1126 while ( ( *luaY_xi != -1 ) ||
1353 ( yyxi[1] != yy_state ) )1127 ( luaY_xi[1] != luaY__state ) )
1354 {1128 {
1355 yyxi += 2;1129 luaY_xi += 2;
1356 }1130 }
1357 while ( ( *(yyxi += 2) >= 0 ) &&1131 while ( ( *(luaY_xi += 2) >= 0 ) &&
1358 ( *yyxi != yychar ) )1132 ( *luaY_xi != luaY_char ) )
1359 ;1133 ;
1360 if ( ( yy_n = yyxi[1] ) < 0 )1134 if ( ( luaY__n = luaY_xi[1] ) < 0 )
1361 YYACCEPT;1135 YYACCEPT;
1362 }1136 }
1363 }1137 }
@@ -1365,42 +1139,42 @@ $vars */ · 1 unmodified line
1365 /*1139 /*
1366 ** check for syntax error1140 ** check for syntax error
1367 */1141 */
1368 if ( yy_n == 0 ) /* have an error */1142 if ( luaY__n == 0 ) /* have an error */
1369 {1143 {
1370 /* no worry about speed here! */1144 /* no worry about speed here! */
1371 switch ( yyerrflag )1145 switch ( luaY_errflag )
1372 {1146 {
1373 case 0: /* new error */1147 case 0: /* new error */
1374 yyerror( "syntax error" );1148 luaY_error( "syntax error" );
1375 goto skip_init;1149 goto skip_init;
1376 yyerrlab:1150 luaY_errlab:
1377 /*1151 /*
1378 ** get globals into registers.1152 ** get globals into registers.
1379 ** we have a user generated syntax type error1153 ** we have a user generated syntax type error
1380 */1154 */
1381 yy_pv = yypv;1155 luaY__pv = luaY_pv;
1382 yy_ps = yyps;1156 luaY__ps = luaY_ps;
1383 yy_state = yystate;1157 luaY__state = luaY_state;
1384 yynerrs++;1158 luaY_nerrs++;
1385 skip_init:1159 skip_init:
1386 case 1:1160 case 1:
1387 case 2: /* incompletely recovered error */1161 case 2: /* incompletely recovered error */
1388 /* try again... */1162 /* try again... */
1389 yyerrflag = 3;1163 luaY_errflag = 3;
1390 /*1164 /*
1391 ** find state where "error" is a legal1165 ** find state where "error" is a legal
1392 ** shift action1166 ** shift action
1393 */1167 */
1394 while ( yy_ps >= yys )1168 while ( luaY__ps >= luaY_s )
1395 {1169 {
1396 yy_n = yypact[ *yy_ps ] + YYERRCODE;1170 luaY__n = luaY_pact[ *luaY__ps ] + YYERRCODE;
1397 if ( yy_n >= 0 && yy_n < YYLAST &&1171 if ( luaY__n >= 0 && luaY__n < YYLAST &&
1398 yychk[yyact[yy_n]] == YYERRCODE) {1172 luaY_chk[luaY_act[luaY__n]] == YYERRCODE) {
1399 /*1173 /*
1400 ** simulate shift of "error"1174 ** simulate shift of "error"
1401 */1175 */
1402 yy_state = yyact[ yy_n ];1176 luaY__state = luaY_act[ luaY__n ];
1403 goto yy_stack;1177 goto luaY__stack;
1404 }1178 }
1405 /*1179 /*
1406 ** current state has no shift on1180 ** current state has no shift on
@@ -1408,13 +1182,13 @@ $vars */ · 1 unmodified line
1408 */1182 */
1409#if YYDEBUG1183#if YYDEBUG
1410# define _POP_ "Error recovery pops state %d, uncovers state %d\n"1184# define _POP_ "Error recovery pops state %d, uncovers state %d\n"
1411 if ( yydebug )1185 if ( luaY_debug )
1412 (void)printf( _POP_, *yy_ps,1186 (void)printf( _POP_, *luaY__ps,
1413 yy_ps[-1] );1187 luaY__ps[-1] );
1414# undef _POP_1188# undef _POP_
1415#endif1189#endif
1416 yy_ps--;1190 luaY__ps--;
1417 yy_pv--;1191 luaY__pv--;
1418 }1192 }
1419 /*1193 /*
1420 ** there is no state on stack with "error" as1194 ** there is no state on stack with "error" as
@@ -1430,40 +1204,40 @@ $vars */ · 9 unmodified lines
1430 ** debugging, it doesn't hurt to leave the1204 ** debugging, it doesn't hurt to leave the
1431 ** tests here.1205 ** tests here.
1432 */1206 */
1433 if ( yydebug )1207 if ( luaY_debug )
1434 {1208 {
1435 register int yy_i;1209 register int luaY__i;
1436 1210
1437 (void)printf( "Error recovery discards " );1211 (void)printf( "Error recovery discards " );
1438 if ( yychar == 0 )1212 if ( luaY_char == 0 )
1439 (void)printf( "token end-of-file\n" );1213 (void)printf( "token end-of-file\n" );
1440 else if ( yychar < 0 )1214 else if ( luaY_char < 0 )
1441 (void)printf( "token -none-\n" );1215 (void)printf( "token -none-\n" );
1442 else1216 else
1443 {1217 {
1444 for ( yy_i = 0;1218 for ( luaY__i = 0;
1445 yytoks[yy_i].t_val >= 0;1219 luaY_toks[luaY__i].t_val >= 0;
1446 yy_i++ )1220 luaY__i++ )
1447 {1221 {
1448 if ( yytoks[yy_i].t_val1222 if ( luaY_toks[luaY__i].t_val
1449 == yychar )1223 == luaY_char )
1450 {1224 {
1451 break;1225 break;
1452 }1226 }
1453 }1227 }
1454 (void)printf( "token %s\n",1228 (void)printf( "token %s\n",
1455 yytoks[yy_i].t_name );1229 luaY_toks[luaY__i].t_name );
1456 }1230 }
1457 }1231 }
1458#endif /* YYDEBUG */1232#endif /* YYDEBUG */
1459 if ( yychar == 0 ) /* reached EOF. quit */1233 if ( luaY_char == 0 ) /* reached EOF. quit */
1460 YYABORT;1234 YYABORT;
1461 yychar = -1;1235 luaY_char = -1;
1462 goto yy_newstate;1236 goto luaY__newstate;
1463 }1237 }
1464 }/* end if ( yy_n == 0 ) */1238 }/* end if ( luaY__n == 0 ) */
1465 /*1239 /*
1466 ** reduction by production yy_n1240 ** reduction by production luaY__n
1467 ** put stack tops, etc. so things right after switch1241 ** put stack tops, etc. so things right after switch
1468 */1242 */
1469#if YYDEBUG1243#if YYDEBUG
@@ -1472,92 +1246,95 @@ $vars */ · 2 unmodified lines
1472 ** specification of the reduction which is just about1246 ** specification of the reduction which is just about
1473 ** to be done.1247 ** to be done.
1474 */1248 */
1475 if ( yydebug )1249 if ( luaY_debug )
1476 (void)printf( "Reduce by (%d) \"%s\"\n",1250 (void)printf( "Reduce by (%d) \"%s\"\n",
1477 yy_n, yyreds[ yy_n ] );1251 luaY__n, luaY_reds[ luaY__n ] );
1478#endif1252#endif
1479 yytmp = yy_n; /* value to switch over */1253 luaY_tmp = luaY__n; /* value to switch over */
1480 yypvt = yy_pv; /* $vars top of value stack */1254 luaY_pvt = luaY__pv; /* $vars top of value stack */
1481 /*1255 /*
1482 ** Look in goto table for next state1256 ** Look in goto table for next state
1483 ** Sorry about using yy_state here as temporary1257 ** Sorry about using luaY__state here as temporary
1484 ** register variable, but why not, if it works...1258 ** register variable, but why not, if it works...
1485 ** If yyr2[ yy_n ] doesn't have the low order bit1259 ** If luaY_r2[ luaY__n ] doesn't have the low order bit
1486 ** set, then there is no action to be done for1260 ** set, then there is no action to be done for
1487 ** this reduction. So, no saving & unsaving of1261 ** this reduction. So, no saving & unsaving of
1488 ** registers done. The only difference between the1262 ** registers done. The only difference between the
1489 ** code just after the if and the body of the if is1263 ** code just after the if and the body of the if is
1490 ** the goto yy_stack in the body. This way the test1264 ** the goto luaY__stack in the body. This way the test
1491 ** can be made before the choice of what to do is needed.1265 ** can be made before the choice of what to do is needed.
1492 */1266 */
1493 {1267 {
1494 /* length of production doubled with extra bit */1268 /* length of production doubled with extra bit */
1495 register int yy_len = yyr2[ yy_n ];1269 register int luaY__len = luaY_r2[ luaY__n ];
1496 1270
1497 if ( !( yy_len & 01 ) )1271 if ( !( luaY__len & 01 ) )
1498 {1272 {
1499 yy_len >>= 1;1273 luaY__len >>= 1;
1500 yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */1274 luaY_val = ( luaY__pv -= luaY__len )[1]; /* $$ = $1 */
1501 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +1275 luaY__state = luaY_pgo[ luaY__n = luaY_r1[ luaY__n ] ] +
1502 *( yy_ps -= yy_len ) + 1;1276 *( luaY__ps -= luaY__len ) + 1;
1503 if ( yy_state >= YYLAST ||1277 if ( luaY__state >= YYLAST ||
1504 yychk[ yy_state =1278 luaY_chk[ luaY__state =
1505 yyact[ yy_state ] ] != -yy_n )1279 luaY_act[ luaY__state ] ] != -luaY__n )
1506 {1280 {
1507 yy_state = yyact[ yypgo[ yy_n ] ];1281 luaY__state = luaY_act[ luaY_pgo[ luaY__n ] ];
1508 }1282 }
1509 goto yy_stack;1283 goto luaY__stack;
1510 }1284 }
1511 yy_len >>= 1;1285 luaY__len >>= 1;
1512 yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */1286 luaY_val = ( luaY__pv -= luaY__len )[1]; /* $$ = $1 */
1513 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +1287 luaY__state = luaY_pgo[ luaY__n = luaY_r1[ luaY__n ] ] +
1514 *( yy_ps -= yy_len ) + 1;1288 *( luaY__ps -= luaY__len ) + 1;
1515 if ( yy_state >= YYLAST ||1289 if ( luaY__state >= YYLAST ||
1516 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )1290 luaY_chk[ luaY__state = luaY_act[ luaY__state ] ] != -luaY__n )
1517 {1291 {
1518 yy_state = yyact[ yypgo[ yy_n ] ];1292 luaY__state = luaY_act[ luaY_pgo[ luaY__n ] ];
1519 }1293 }
1520 }1294 }
1521 /* save until reenter driver code */1295 /* save until reenter driver code */
1522 yystate = yy_state;1296 luaY_state = luaY__state;
1523 yyps = yy_ps;1297 luaY_ps = luaY__ps;
1524 yypv = yy_pv;1298 luaY_pv = luaY__pv;
1525 }1299 }
1526 /*1300 /*
1527 ** code supplied by user is placed in this switch1301 ** code supplied by user is placed in this switch
1528 */1302 */
1529 switch( yytmp )1303 switch( luaY_tmp )
1530 {1304 {
1531 1305
1532case 6:1306case 6:
1533# line 470 "lua.stx"1307# line 469 "lua.stx"
1534{ 1308{
1535 code_byte(PUSHFUNCTION);1309 code_byte(PUSHFUNCTION);
1536 code_code(yypvt[-0].pFunc);1310 code_code(luaY_pvt[-0].pFunc);
1537 storesinglevar(yypvt[-1].vLong);1311 storesinglevar(luaY_pvt[-1].vLong);
1538 } break;1312 } break;
1539case 7:1313case 7:
1540# line 477 "lua.stx"1314# line 476 "lua.stx"
1541{ yyval.vLong =yypvt[-0].vLong; init_func(); } break;1315{ luaY_val.vLong =luaY_pvt[-0].vLong; init_func(); } break;
1542case 8:1316case 8:
1543# line 479 "lua.stx"1317# line 478 "lua.stx"
1544{1318{
1545 code_byte(PUSHSTRING);1319 code_byte(PUSHSTRING);
1546 code_word(luaI_findconstant(yypvt[-0].pNode));1320 code_word(luaI_findconstant(luaY_pvt[-0].pTStr));
1547 yyval.vLong = 0; /* indexed variable */1321 luaY_val.vLong = 0; /* indexed variable */
1548 init_func();1322 init_func();
1549 add_localvar(luaI_findsymbolbyname("self"));1323 add_localvar(luaI_createfixedstring("self"));
1550 } break;1324 } break;
1551case 9:1325case 9:
1552# line 489 "lua.stx"1326# line 488 "lua.stx"
1553{1327{
1554 codereturn();1328 codereturn();
1555 yyval.pFunc = new(TFunc);1329 luaY_val.pFunc = new(TFunc);
1556 yyval.pFunc->size = pc;1330 luaI_initTFunc(luaY_val.pFunc);
1557 yyval.pFunc->code = newvector(pc, Byte);1331 luaY_val.pFunc->size = pc;
1558 yyval.pFunc->fileName = lua_parsedfile;1332 luaY_val.pFunc->code = newvector(pc, Byte);
1559 yyval.pFunc->lineDefined = yypvt[-3].vInt;1333 luaY_val.pFunc->fileName = lua_parsedfile;
1560 memcpy(yyval.pFunc->code, basepc, pc*sizeof(Byte));1334 luaY_val.pFunc->lineDefined = luaY_pvt[-3].vInt;
1335 memcpy(luaY_val.pFunc->code, basepc, pc*sizeof(Byte));
1336 if (lua_debug)
1337 luaI_closelocalvars(luaY_val.pFunc);
1561 /* save func values */1338 /* save func values */
1562 funcCode = basepc; maxcode=maxcurr;1339 funcCode = basepc; maxcode=maxcurr;
1563#if LISTING1340#if LISTING
@@ -1566,346 +1343,345 @@ case 9: · 2 unmodified lines
1566 change2main(); /* change back to main code */1343 change2main(); /* change back to main code */
1567 } break;1344 } break;
1568case 14:1345case 14:
1569# line 513 "lua.stx"
1570{ codeIf(yypvt[-4].vLong, yypvt[-2].vLong); } break;
1571case 15:
1572# line 515 "lua.stx"1346# line 515 "lua.stx"
1573{yyval.vLong=pc;} break;1347{ codeIf(luaY_pvt[-4].vLong, luaY_pvt[-2].vLong); } break;
1348case 15:
1349# line 517 "lua.stx"
1350{luaY_val.vLong=pc;} break;
1574case 16:1351case 16:
1575# line 516 "lua.stx"1352# line 518 "lua.stx"
1576{1353{
1577 basepc[yypvt[-3].vLong] = IFFJMP;1354 basepc[luaY_pvt[-3].vLong] = IFFJMP;
1578 code_word_at(basepc+yypvt[-3].vLong+1, pc - (yypvt[-3].vLong + sizeof(Word)+1));1355 code_word_at(basepc+luaY_pvt[-3].vLong+1, pc - (luaY_pvt[-3].vLong + sizeof(Word)+1));
1579 basepc[yypvt[-1].vLong] = UPJMP;1356 basepc[luaY_pvt[-1].vLong] = UPJMP;
1580 code_word_at(basepc+yypvt[-1].vLong+1, pc - (yypvt[-6].vLong));1357 code_word_at(basepc+luaY_pvt[-1].vLong+1, pc - (luaY_pvt[-6].vLong));
1581 } break;1358 } break;
1582case 17:1359case 17:
1583# line 523 "lua.stx"1360# line 525 "lua.stx"
1584{yyval.vLong=pc;} break;1361{luaY_val.vLong=pc;} break;
1585case 18:1362case 18:
1586# line 524 "lua.stx"1363# line 526 "lua.stx"
1587{1364{
1588 basepc[yypvt[-0].vLong] = IFFUPJMP;1365 basepc[luaY_pvt[-0].vLong] = IFFUPJMP;
1589 code_word_at(basepc+yypvt[-0].vLong+1, pc - (yypvt[-4].vLong));1366 code_word_at(basepc+luaY_pvt[-0].vLong+1, pc - (luaY_pvt[-4].vLong));
1590 } break;1367 } break;
1591case 19:1368case 19:
1592# line 530 "lua.stx"1369# line 532 "lua.stx"
1593{1370{
1594 {1371 {
1595 int i;1372 int i;
1596 adjust_mult_assign(nvarbuffer, yypvt[-0].vLong, yypvt[-2].vInt * 2 + nvarbuffer);1373 adjust_mult_assign(nvarbuffer, luaY_pvt[-0].vLong, luaY_pvt[-2].vInt * 2 + nvarbuffer);
1597 for (i=nvarbuffer-1; i>=0; i--)1374 for (i=nvarbuffer-1; i>=0; i--)
1598 lua_codestore (i);1375 lua_codestore (i);
1599 if (yypvt[-2].vInt > 1 || (yypvt[-2].vInt == 1 && varbuffer[0] != 0))1376 if (luaY_pvt[-2].vInt > 1 || (luaY_pvt[-2].vInt == 1 && varbuffer[0] != 0))
1600 lua_codeadjust (0);1377 lua_codeadjust (0);
1601 }1378 }
1602 } break;1379 } break;
1603case 21:1380case 21:
1604# line 542 "lua.stx"1381# line 544 "lua.stx"
1605{ nlocalvar += yypvt[-1].vInt;1382{ nlocalvar += luaY_pvt[-1].vInt;
1606 adjust_mult_assign(yypvt[-1].vInt, yypvt[-0].vInt, 0);1383 adjust_mult_assign(luaY_pvt[-1].vInt, luaY_pvt[-0].vInt, 0);
1607 } break;1384 } break;
1608case 24:1385case 24:
1609# line 550 "lua.stx"1386# line 552 "lua.stx"
1610{ codeIf(yypvt[-3].vLong, yypvt[-1].vLong); } break;1387{ codeIf(luaY_pvt[-3].vLong, luaY_pvt[-1].vLong); } break;
1611case 25:1388case 25:
1612# line 553 "lua.stx"1389# line 555 "lua.stx"
1613{yyval.vInt = nlocalvar;} break;1390{luaY_val.vInt = nlocalvar;} break;
1614case 26:1391case 26:
1615# line 554 "lua.stx"1392# line 556 "lua.stx"
1616{1393{
1617 if (nlocalvar != yypvt[-2].vInt)1394 if (nlocalvar != luaY_pvt[-2].vInt)
1618 {1395 {
1619 nlocalvar = yypvt[-2].vInt;1396 if (lua_debug)
1397 for (; nlocalvar > luaY_pvt[-2].vInt; nlocalvar--)
1398 luaI_unregisterlocalvar(lua_linenumber);
1399 else
1400 nlocalvar = luaY_pvt[-2].vInt;
1620 lua_codeadjust (0);1401 lua_codeadjust (0);
1621 }1402 }
1622 } break;1403 } break;
1623case 28:1404case 28:
1624# line 565 "lua.stx"1405# line 571 "lua.stx"
1625{1406{
1626 adjust_functioncall(yypvt[-1].vLong, MULT_RET);1407 adjust_functioncall(luaY_pvt[-1].vLong, MULT_RET);
1627 codereturn();1408 codereturn();
1628 } break;1409 } break;
1629case 29:1410case 29:
1630# line 572 "lua.stx"1411# line 578 "lua.stx"
1631{ 1412{
1632 yyval.vLong = pc;1413 luaY_val.vLong = pc;
1633 code_byte(0); /* open space */1414 code_byte(0); /* open space */
1634 code_word (0);1415 code_word (0);
1635 } break;1416 } break;
1636case 30:1417case 30:
1637# line 578 "lua.stx"1418# line 584 "lua.stx"
1638{ adjust_functioncall(yypvt[-0].vLong, 1); } break;1419{ adjust_functioncall(luaY_pvt[-0].vLong, 1); } break;
1639case 31:1420case 31:
1640# line 581 "lua.stx"1421# line 587 "lua.stx"
1641{ yyval.vLong = yypvt[-1].vLong; } break;1422{ luaY_val.vLong = luaY_pvt[-1].vLong; } break;
1642case 32:1423case 32:
1643# line 582 "lua.stx"1424# line 588 "lua.stx"
1644{ code_byte(EQOP); yyval.vLong = 0; } break;1425{ code_byte(EQOP); luaY_val.vLong = 0; } break;
1645case 33:1426case 33:
1646# line 583 "lua.stx"1427# line 589 "lua.stx"
1647{ code_byte(LTOP); yyval.vLong = 0; } break;1428{ code_byte(LTOP); luaY_val.vLong = 0; } break;
1648case 34:1429case 34:
1649# line 584 "lua.stx"1430# line 590 "lua.stx"
1650{ code_byte(GTOP); yyval.vLong = 0; } break;1431{ code_byte(GTOP); luaY_val.vLong = 0; } break;
1651case 35:1432case 35:
1652# line 585 "lua.stx"1433# line 591 "lua.stx"
1653{ code_byte(EQOP); code_byte(NOTOP); yyval.vLong = 0; } break;1434{ code_byte(EQOP); code_byte(NOTOP); luaY_val.vLong = 0; } break;
1654case 36:1435case 36:
1655# line 586 "lua.stx"1436# line 592 "lua.stx"
1656{ code_byte(LEOP); yyval.vLong = 0; } break;1437{ code_byte(LEOP); luaY_val.vLong = 0; } break;
1657case 37:1438case 37:
1658# line 587 "lua.stx"1439# line 593 "lua.stx"
1659{ code_byte(GEOP); yyval.vLong = 0; } break;1440{ code_byte(GEOP); luaY_val.vLong = 0; } break;
1660case 38:1441case 38:
1661# line 588 "lua.stx"1442# line 594 "lua.stx"
1662{ code_byte(ADDOP); yyval.vLong = 0; } break;1443{ code_byte(ADDOP); luaY_val.vLong = 0; } break;
1663case 39:1444case 39:
1664# line 589 "lua.stx"1445# line 595 "lua.stx"
1665{ code_byte(SUBOP); yyval.vLong = 0; } break;1446{ code_byte(SUBOP); luaY_val.vLong = 0; } break;
1666case 40:1447case 40:
1667# line 590 "lua.stx"1448# line 596 "lua.stx"
1668{ code_byte(MULTOP); yyval.vLong = 0; } break;1449{ code_byte(MULTOP); luaY_val.vLong = 0; } break;
1669case 41:1450case 41:
1670# line 591 "lua.stx"1451# line 597 "lua.stx"
1671{ code_byte(DIVOP); yyval.vLong = 0; } break;1452{ code_byte(DIVOP); luaY_val.vLong = 0; } break;
1672case 42:1453case 42:
1673# line 592 "lua.stx"1454# line 598 "lua.stx"
1674{ code_byte(POWOP); yyval.vLong = 0; } break;1455{ code_byte(POWOP); luaY_val.vLong = 0; } break;
1675case 43:1456case 43:
1676# line 593 "lua.stx"1457# line 599 "lua.stx"
1677{ code_byte(CONCOP); yyval.vLong = 0; } break;1458{ code_byte(CONCOP); luaY_val.vLong = 0; } break;
1678case 44:1459case 44:
1679# line 594 "lua.stx"1460# line 600 "lua.stx"
1680{ code_byte(MINUSOP); yyval.vLong = 0;} break;1461{ code_byte(MINUSOP); luaY_val.vLong = 0;} break;
1681case 45:1462case 45:
1682# line 595 "lua.stx"1463# line 601 "lua.stx"
1683{ yyval.vLong = 0; } break;1464{ luaY_val.vLong = 0; } break;
1684case 46:1465case 46:
1685# line 596 "lua.stx"1466# line 602 "lua.stx"
1686{ yyval.vLong = 0;} break;1467{ luaY_val.vLong = 0;} break;
1687case 47:1468case 47:
1688# line 597 "lua.stx"1469# line 603 "lua.stx"
1689{ code_number(yypvt[-0].vFloat); yyval.vLong = 0; } break;1470{ code_number(luaY_pvt[-0].vFloat); luaY_val.vLong = 0; } break;
1690case 48:1471case 48:
1691# line 599 "lua.stx"1472# line 605 "lua.stx"
1692{1473{
1693 code_byte(PUSHSTRING);1474 code_byte(PUSHSTRING);
1694 code_word(yypvt[-0].vWord);1475 code_word(luaY_pvt[-0].vWord);
1695 yyval.vLong = 0;1476 luaY_val.vLong = 0;
1696 } break;1477 } break;
1697case 49:1478case 49:
1698# line 604 "lua.stx"1479# line 610 "lua.stx"
1699{code_byte(PUSHNIL); yyval.vLong = 0; } break;1480{code_byte(PUSHNIL); luaY_val.vLong = 0; } break;
1700case 50:1481case 50:
1701# line 605 "lua.stx"1482# line 611 "lua.stx"
1702{ yyval.vLong = yypvt[-0].vLong; } break;1483{ luaY_val.vLong = luaY_pvt[-0].vLong; } break;
1703case 51:1484case 51:
1704# line 606 "lua.stx"1485# line 612 "lua.stx"
1705{ code_byte(NOTOP); yyval.vLong = 0;} break;1486{ code_byte(NOTOP); luaY_val.vLong = 0;} break;
1706case 52:1487case 52:
1707# line 607 "lua.stx"1488# line 613 "lua.stx"
1708{code_byte(POP); } break;1489{code_byte(POP); } break;
1709case 53:1490case 53:
1710# line 608 "lua.stx"1491# line 614 "lua.stx"
1711{ 1492{
1712 basepc[yypvt[-2].vLong] = ONFJMP;1493 basepc[luaY_pvt[-2].vLong] = ONFJMP;
1713 code_word_at(basepc+yypvt[-2].vLong+1, pc - (yypvt[-2].vLong + sizeof(Word)+1));1494 code_word_at(basepc+luaY_pvt[-2].vLong+1, pc - (luaY_pvt[-2].vLong + sizeof(Word)+1));
1714 yyval.vLong = 0;1495 luaY_val.vLong = 0;
1715 } break;1496 } break;
1716case 54:1497case 54:
1717# line 613 "lua.stx"1498# line 619 "lua.stx"
1718{code_byte(POP); } break;1499{code_byte(POP); } break;
1719case 55:1500case 55:
1720# line 614 "lua.stx"1501# line 620 "lua.stx"
1721{ 1502{
1722 basepc[yypvt[-2].vLong] = ONTJMP;1503 basepc[luaY_pvt[-2].vLong] = ONTJMP;
1723 code_word_at(basepc+yypvt[-2].vLong+1, pc - (yypvt[-2].vLong + sizeof(Word)+1));1504 code_word_at(basepc+luaY_pvt[-2].vLong+1, pc - (luaY_pvt[-2].vLong + sizeof(Word)+1));
1724 yyval.vLong = 0;1505 luaY_val.vLong = 0;
1725 } break;1506 } break;
1726case 56:1507case 56:
1727# line 622 "lua.stx"1508# line 628 "lua.stx"
1728{1509{
1729 code_byte(CREATEARRAY);1510 code_byte(CREATEARRAY);
1730 yyval.vLong = pc; code_word(0);1511 luaY_val.vLong = pc; code_word(0);
1731 } break;1512 } break;
1732case 57:1513case 57:
1733# line 627 "lua.stx"1514# line 633 "lua.stx"
1734{1515{
1735 code_word_at(basepc+yypvt[-3].vLong, yypvt[-1].vInt);1516 code_word_at(basepc+luaY_pvt[-3].vLong, luaY_pvt[-1].vInt);
1736 } break;1517 } break;
1737case 58:1518case 58:
1738# line 633 "lua.stx"1519# line 639 "lua.stx"
1739{1520{
1740 code_byte(CALLFUNC);1521 code_byte(CALLFUNC);
1741 code_byte(yypvt[-1].vInt+yypvt[-0].vInt);1522 code_byte(luaY_pvt[-1].vInt+luaY_pvt[-0].vInt);
1742 yyval.vLong = pc;1523 luaY_val.vLong = pc;
1743 code_byte(0); /* may be modified by other rules */1524 code_byte(0); /* may be modified by other rules */
1744 } break;1525 } break;
1745case 59:1526case 59:
1746# line 641 "lua.stx"1527# line 647 "lua.stx"
1747{ yyval.vInt = 0; } break;1528{ luaY_val.vInt = 0; } break;
1748case 60:1529case 60:
1749# line 643 "lua.stx"1530# line 649 "lua.stx"
1750{ 1531{
1751 code_byte(PUSHSELF); 1532 code_byte(PUSHSELF);
1752 code_word(luaI_findconstant(yypvt[-0].pNode));1533 code_word(luaI_findconstant(luaY_pvt[-0].pTStr));
1753 yyval.vInt = 1;1534 luaY_val.vInt = 1;
1754 } break;1535 } break;
1755case 61:1536case 61:
1756# line 651 "lua.stx"1537# line 657 "lua.stx"
1757{ yyval.vInt = adjust_functioncall(yypvt[-1].vLong, 1); } break;1538{ luaY_val.vInt = adjust_functioncall(luaY_pvt[-1].vLong, 1); } break;
1758case 62:1539case 62:
1759# line 652 "lua.stx"1540# line 658 "lua.stx"
1760{ yyval.vInt = 1; } break;1541{ luaY_val.vInt = 1; } break;
1761case 63:1542case 63:
1762# line 655 "lua.stx"1543# line 661 "lua.stx"
1763{ yyval.vLong = 0; } break;1544{ luaY_val.vLong = 0; } break;
1764case 64:1545case 64:
1765# line 656 "lua.stx"1546# line 662 "lua.stx"
1766{ yyval.vLong = yypvt[-0].vLong; } break;1547{ luaY_val.vLong = luaY_pvt[-0].vLong; } break;
1767case 65:1548case 65:
1768# line 659 "lua.stx"1549# line 665 "lua.stx"
1769{ if (yypvt[-0].vLong != 0) yyval.vLong = yypvt[-0].vLong; else yyval.vLong = -1; } break;1550{ if (luaY_pvt[-0].vLong != 0) luaY_val.vLong = luaY_pvt[-0].vLong; else luaY_val.vLong = -1; } break;
1770case 66:1551case 66:
1771# line 660 "lua.stx"1552# line 666 "lua.stx"
1772{ yyval.vLong = adjust_functioncall(yypvt[-1].vLong, 1); } break;1553{ luaY_val.vLong = adjust_functioncall(luaY_pvt[-1].vLong, 1); } break;
1773case 67:1554case 67:
1774# line 661 "lua.stx"1555# line 667 "lua.stx"
1775{1556{
1776 if (yypvt[-0].vLong == 0) yyval.vLong = -(yypvt[-1].vLong + 1); /* -length */1557 if (luaY_pvt[-0].vLong == 0) luaY_val.vLong = -(luaY_pvt[-1].vLong + 1); /* -length */
1777 else1558 else
1778 {1559 {
1779 adjust_functioncall(yypvt[-0].vLong, yypvt[-1].vLong);1560 adjust_functioncall(luaY_pvt[-0].vLong, luaY_pvt[-1].vLong);
1780 yyval.vLong = yypvt[-0].vLong;1561 luaY_val.vLong = luaY_pvt[-0].vLong;
1781 }1562 }
1782 } break;1563 } break;
1783case 68:1564case 68:
1784# line 671 "lua.stx"1565# line 677 "lua.stx"
1785{ lua_codeadjust(0); yyval.vInt = lua_linenumber; } break;1566{ lua_codeadjust(0); luaY_val.vInt = lua_linenumber; } break;
1786case 69:1567case 69:
1787# line 672 "lua.stx"1568# line 678 "lua.stx"
1788{ lua_codeadjust(0); yyval.vInt = lua_linenumber; } break;1569{ lua_codeadjust(0); luaY_val.vInt = lua_linenumber; } break;
1789case 70:1570case 70:
1790# line 676 "lua.stx"1571# line 681 "lua.stx"
1791{1572{ add_localvar(luaY_pvt[-0].pTStr); } break;
1792 add_localvar(luaI_findsymbol(yypvt[-0].pNode));
1793 } break;
1794case 71:1573case 71:
1795# line 680 "lua.stx"1574# line 682 "lua.stx"
1796{1575{ add_localvar(luaY_pvt[-0].pTStr); } break;
1797 add_localvar(luaI_findsymbol(yypvt[-0].pNode));
1798 } break;
1799case 72:1576case 72:
1800# line 686 "lua.stx"1577# line 686 "lua.stx"
1801{ flush_list(yypvt[-0].vInt/FIELDS_PER_FLUSH, yypvt[-0].vInt%FIELDS_PER_FLUSH); } break;1578{ flush_list(luaY_pvt[-0].vInt/FIELDS_PER_FLUSH, luaY_pvt[-0].vInt%FIELDS_PER_FLUSH); } break;
1802case 73:1579case 73:
1803# line 688 "lua.stx"1580# line 688 "lua.stx"
1804{ yyval.vInt = yypvt[-2].vInt+yypvt[-0].vInt; } break;1581{ luaY_val.vInt = luaY_pvt[-2].vInt+luaY_pvt[-0].vInt; } break;
1805case 74:1582case 74:
1806# line 690 "lua.stx"1583# line 690 "lua.stx"
1807{ yyval.vInt = yypvt[-1].vInt; flush_record(yypvt[-1].vInt%FIELDS_PER_FLUSH); } break;1584{ luaY_val.vInt = luaY_pvt[-1].vInt; flush_record(luaY_pvt[-1].vInt%FIELDS_PER_FLUSH); } break;
1808case 75:1585case 75:
1809# line 694 "lua.stx"1586# line 694 "lua.stx"
1810{ yyval.vInt = 0; } break;1587{ luaY_val.vInt = 0; } break;
1811case 76:1588case 76:
1812# line 696 "lua.stx"1589# line 696 "lua.stx"
1813{ yyval.vInt = yypvt[-0].vInt; flush_record(yypvt[-0].vInt%FIELDS_PER_FLUSH); } break;1590{ luaY_val.vInt = luaY_pvt[-0].vInt; flush_record(luaY_pvt[-0].vInt%FIELDS_PER_FLUSH); } break;
1814case 79:1591case 79:
1815# line 703 "lua.stx"1592# line 703 "lua.stx"
1816{ yyval.vInt = 0; } break;1593{ luaY_val.vInt = 0; } break;
1817case 80:1594case 80:
1818# line 704 "lua.stx"1595# line 704 "lua.stx"
1819{ yyval.vInt = yypvt[-1].vInt; } break;1596{ luaY_val.vInt = luaY_pvt[-1].vInt; } break;
1820case 81:1597case 81:
1821# line 707 "lua.stx"1598# line 707 "lua.stx"
1822{yyval.vInt=1;} break;1599{luaY_val.vInt=1;} break;
1823case 82:1600case 82:
1824# line 709 "lua.stx"1601# line 709 "lua.stx"
1825{1602{
1826 yyval.vInt=yypvt[-2].vInt+1;1603 luaY_val.vInt=luaY_pvt[-2].vInt+1;
1827 if (yyval.vInt%FIELDS_PER_FLUSH == 0) flush_record(FIELDS_PER_FLUSH);1604 if (luaY_val.vInt%FIELDS_PER_FLUSH == 0) flush_record(FIELDS_PER_FLUSH);
1828 } break;1605 } break;
1829case 83:1606case 83:
1830# line 716 "lua.stx"1607# line 716 "lua.stx"
1831{ 1608{
1832 push_field(luaI_findconstant(yypvt[-2].pNode));1609 push_field(luaI_findconstant(luaY_pvt[-2].pTStr));
1833 } break;1610 } break;
1834case 84:1611case 84:
1835# line 721 "lua.stx"1612# line 721 "lua.stx"
1836{ yyval.vInt = 0; } break;1613{ luaY_val.vInt = 0; } break;
1837case 85:1614case 85:
1838# line 722 "lua.stx"1615# line 722 "lua.stx"
1839{ yyval.vInt = yypvt[-1].vInt; } break;1616{ luaY_val.vInt = luaY_pvt[-1].vInt; } break;
1840case 86:1617case 86:
1841# line 725 "lua.stx"1618# line 725 "lua.stx"
1842{yyval.vInt=1;} break;1619{luaY_val.vInt=1;} break;
1843case 87:1620case 87:
1844# line 727 "lua.stx"1621# line 727 "lua.stx"
1845{1622{
1846 yyval.vInt=yypvt[-2].vInt+1;1623 luaY_val.vInt=luaY_pvt[-2].vInt+1;
1847 if (yyval.vInt%FIELDS_PER_FLUSH == 0) 1624 if (luaY_val.vInt%FIELDS_PER_FLUSH == 0)
1848 flush_list(yyval.vInt/FIELDS_PER_FLUSH - 1, FIELDS_PER_FLUSH);1625 flush_list(luaY_val.vInt/FIELDS_PER_FLUSH - 1, FIELDS_PER_FLUSH);
1849 } break;1626 } break;
1850case 88:1627case 88:
1851# line 735 "lua.stx"1628# line 735 "lua.stx"
1852{1629{
1853 nvarbuffer = 0; 1630 nvarbuffer = 0;
1854 add_varbuffer(yypvt[-0].vLong);1631 add_varbuffer(luaY_pvt[-0].vLong);
1855 yyval.vInt = (yypvt[-0].vLong == 0) ? 1 : 0;1632 luaY_val.vInt = (luaY_pvt[-0].vLong == 0) ? 1 : 0;
1856 } break;1633 } break;
1857case 89:1634case 89:
1858# line 741 "lua.stx"1635# line 741 "lua.stx"
1859{ 1636{
1860 add_varbuffer(yypvt[-0].vLong);1637 add_varbuffer(luaY_pvt[-0].vLong);
1861 yyval.vInt = (yypvt[-0].vLong == 0) ? yypvt[-2].vInt + 1 : yypvt[-2].vInt;1638 luaY_val.vInt = (luaY_pvt[-0].vLong == 0) ? luaY_pvt[-2].vInt + 1 : luaY_pvt[-2].vInt;
1862 } break;1639 } break;
1863case 90:1640case 90:
1864# line 747 "lua.stx"1641# line 747 "lua.stx"
1865{ yyval.vLong = yypvt[-0].vLong; } break;1642{ luaY_val.vLong = luaY_pvt[-0].vLong; } break;
1866case 91:1643case 91:
1867# line 749 "lua.stx"1644# line 749 "lua.stx"
1868{1645{
1869 yyval.vLong = 0; /* indexed variable */1646 luaY_val.vLong = 0; /* indexed variable */
1870 } break;1647 } break;
1871case 92:1648case 92:
1872# line 753 "lua.stx"1649# line 753 "lua.stx"
1873{1650{
1874 code_byte(PUSHSTRING);1651 code_byte(PUSHSTRING);
1875 code_word(luaI_findconstant(yypvt[-0].pNode));1652 code_word(luaI_findconstant(luaY_pvt[-0].pTStr));
1876 yyval.vLong = 0; /* indexed variable */1653 luaY_val.vLong = 0; /* indexed variable */
1877 } break;1654 } break;
1878case 93:1655case 93:
1879# line 761 "lua.stx"1656# line 761 "lua.stx"
1880{1657{
1881 Word s = luaI_findsymbol(yypvt[-0].pNode);1658 int local = lua_localname(luaY_pvt[-0].pTStr);
1882 int local = lua_localname (s);
1883 if (local == -1) /* global var */1659 if (local == -1) /* global var */
1884 yyval.vLong = s + 1; /* return positive value */1660 luaY_val.vLong = luaI_findsymbol(luaY_pvt[-0].pTStr)+1; /* return positive value */
1885 else1661 else
1886 yyval.vLong = -(local+1); /* return negative value */1662 luaY_val.vLong = -(local+1); /* return negative value */
1887 } break;1663 } break;
1888case 94:1664case 94:
1889# line 771 "lua.stx"1665# line 770 "lua.stx"
1890{ lua_pushvar(yypvt[-0].vLong); } break;1666{ lua_pushvar(luaY_pvt[-0].vLong); } break;
1891case 95:1667case 95:
1892# line 774 "lua.stx"1668# line 773 "lua.stx"
1893{store_localvar(luaI_findsymbol(yypvt[-0].pNode), 0); yyval.vInt = 1;} break;1669{store_localvar(luaY_pvt[-0].pTStr, 0); luaY_val.vInt = 1;} break;
1894case 96:1670case 96:
1895# line 776 "lua.stx"1671# line 775 "lua.stx"
1896{1672{
1897 store_localvar(luaI_findsymbol(yypvt[-0].pNode), yypvt[-2].vInt);1673 store_localvar(luaY_pvt[-0].pTStr, luaY_pvt[-2].vInt);
1898 yyval.vInt = yypvt[-2].vInt+1;1674 luaY_val.vInt = luaY_pvt[-2].vInt+1;
1899 } break;1675 } break;
1900case 97:1676case 97:
1901# line 782 "lua.stx"1677# line 781 "lua.stx"
1902{ yyval.vInt = 0; } break;1678{ luaY_val.vInt = 0; } break;
1903case 98:1679case 98:
1904# line 783 "lua.stx"1680# line 782 "lua.stx"
1905{ yyval.vInt = yypvt[-0].vLong; } break;1681{ luaY_val.vInt = luaY_pvt[-0].vLong; } break;
1906case 99:1682case 99:
1907# line 786 "lua.stx"1683# line 785 "lua.stx"
1908{ lua_debug = yypvt[-0].vInt; } break;1684{ lua_debug = luaY_pvt[-0].vInt; } break;
1909 }1685 }
1910 goto yystack; /* reset registers in driver code */1686 goto luaY_stack; /* reset registers in driver code */
1911}1687}
src/parser.h+3−2
@@ -1,3 +1,4 @@
1
1typedef union 2typedef union
2{3{
3 int vInt;4 int vInt;
@@ -6,9 +7,9 @@ typedef union · 2 unmodified lines
6 Word vWord;7 Word vWord;
7 Long vLong;8 Long vLong;
8 TFunc *pFunc;9 TFunc *pFunc;
9 TreeNode *pNode;10 TaggedString *pTStr;
10} YYSTYPE;11} YYSTYPE;
11extern YYSTYPE yylval;12extern YYSTYPE luaY_lval;
12# define WRONGTOKEN 25713# define WRONGTOKEN 257
13# define NIL 25814# define NIL 258
14# define IF 25915# define IF 259
src/table.c+94−97
@@ -3,9 +3,7 @@ · 2 unmodified lines
3** Module to control static tables3** Module to control static tables
4*/4*/
5 5
6char *rcs_table="$Id: table.c,v 2.38 1995/11/03 15:30:50 roberto Exp $";6char *rcs_table="$Id: table.c,v 2.54 1996/05/06 14:29:35 roberto Exp $";
7
8/*#include <string.h>*/
9 7
10#include "mem.h"8#include "mem.h"
11#include "opcode.h"9#include "opcode.h"
@@ -21,61 +19,66 @@ char *rcs_table="$Id: table.c,v 2.38 1995/11/03 15:30:50 roberto Exp $"; · 9 unmodified lines
21#define BUFFER_BLOCK 25619#define BUFFER_BLOCK 256
22 20
23Symbol *lua_table = NULL;21Symbol *lua_table = NULL;
24static Word lua_ntable = 0;22Word lua_ntable = 0;
25static Long lua_maxsymbol = 0;23static Long lua_maxsymbol = 0;
26 24
27TaggedString **lua_constant = NULL;25TaggedString **lua_constant = NULL;
28static Word lua_nconstant = 0;26Word lua_nconstant = 0;
29static Long lua_maxconstant = 0;27static Long lua_maxconstant = 0;
30 28
31 29
32#define GARBAGE_BLOCK 102430#define GARBAGE_BLOCK 50
33#define MIN_GARBAGE_BLOCK (GARBAGE_BLOCK/2)
34 31
35static void lua_nextvar (void);32static void lua_nextvar (void);
36static void setglobal (void);
37static void getglobal (void);
38 33
39/*34/*
40** Initialise symbol table with internal functions35** Internal functions
41*/36*/
42static void lua_initsymbol (void)37static struct {
38 char *name;
39 lua_CFunction func;
40} int_funcs[] = {
41 {"assert", luaI_assert},
42 {"dofile", lua_internaldofile},
43 {"dostring", lua_internaldostring},
44 {"error", luaI_error},
45 {"getglobal", luaI_getglobal},
46 {"next", lua_next},
47 {"nextvar", lua_nextvar},
48 {"print", luaI_print},
49 {"setfallback", luaI_setfallback},
50 {"setglobal", luaI_setglobal},
51 {"tonumber", lua_obj2number},
52 {"tostring", luaI_tostring},
53 {"type", luaI_type}
54};
55
56#define INTFUNCSIZE (sizeof(int_funcs)/sizeof(int_funcs[0]))
57
58
59void luaI_initsymbol (void)
43{60{
44 Word n;61 int i;
45 lua_maxsymbol = BUFFER_BLOCK;62 lua_maxsymbol = BUFFER_BLOCK;
46 lua_table = newvector(lua_maxsymbol, Symbol);63 lua_table = newvector(lua_maxsymbol, Symbol);
47 n = luaI_findsymbolbyname("next");64 for (i=0; i<INTFUNCSIZE; i++)
48 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_next;65 {
49 n = luaI_findsymbolbyname("dofile");66 Word n = luaI_findsymbolbyname(int_funcs[i].name);
50 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_internaldofile;67 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = int_funcs[i].func;
51 n = luaI_findsymbolbyname("setglobal");68 }
52 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = setglobal;
53 n = luaI_findsymbolbyname("getglobal");
54 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = getglobal;
55 n = luaI_findsymbolbyname("nextvar");
56 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_nextvar;
57 n = luaI_findsymbolbyname("type");
58 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_type;
59 n = luaI_findsymbolbyname("tonumber");
60 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_obj2number;
61 n = luaI_findsymbolbyname("print");
62 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_print;
63 n = luaI_findsymbolbyname("dostring");
64 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = lua_internaldostring;
65 n = luaI_findsymbolbyname("setfallback");
66 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_setfallback;
67 n = luaI_findsymbolbyname("error");
68 s_tag(n) = LUA_T_CFUNCTION; s_fvalue(n) = luaI_error;
69}69}
70 70
71 71
72/*72/*
73** Initialise constant table with pre-defined constants73** Initialise constant table with pre-defined constants
74*/74*/
75void lua_initconstant (void)75void luaI_initconstant (void)
76{76{
77 lua_maxconstant = BUFFER_BLOCK;77 lua_maxconstant = BUFFER_BLOCK;
78 lua_constant = newvector(lua_maxconstant, TaggedString *);78 lua_constant = newvector(lua_maxconstant, TaggedString *);
79 /* pre-register mem error messages, to avoid loop when error arises */
80 luaI_findconstantbyname(tableEM);
81 luaI_findconstantbyname(memEM);
79}82}
80 83
81 84
@@ -83,22 +86,15 @@ void lua_initconstant (void) · 1 unmodified line
83** Given a name, search it at symbol table and return its index. If not86** Given a name, search it at symbol table and return its index. If not
84** found, allocate it.87** found, allocate it.
85*/88*/
86Word luaI_findsymbol (TreeNode *t)89Word luaI_findsymbol (TaggedString *t)
87{90{
88 if (lua_table == NULL)
89 lua_initsymbol();
90 if (t->varindex == NOT_USED)91 if (t->varindex == NOT_USED)
91 {92 {
92 if (lua_ntable == lua_maxsymbol)93 if (lua_ntable == lua_maxsymbol)
93 {94 lua_maxsymbol = growvector(&lua_table, lua_maxsymbol, Symbol,
94 if (lua_maxsymbol >= MAX_WORD)95 symbolEM, MAX_WORD);
95 lua_error("symbol table overflow");
96 lua_maxsymbol *= 2;
97 if (lua_maxsymbol >= MAX_WORD)
98 lua_maxsymbol = MAX_WORD;
99 lua_table = growvector(lua_table, lua_maxsymbol, Symbol);
100 }
101 t->varindex = lua_ntable;96 t->varindex = lua_ntable;
97 lua_table[lua_ntable].varname = t;
102 s_tag(lua_ntable) = LUA_T_NIL;98 s_tag(lua_ntable) = LUA_T_NIL;
103 lua_ntable++;99 lua_ntable++;
104 }100 }
@@ -108,7 +104,7 @@ Word luaI_findsymbol (TreeNode *t) · 3 unmodified lines
108 104
109Word luaI_findsymbolbyname (char *name)105Word luaI_findsymbolbyname (char *name)
110{106{
111 return luaI_findsymbol(lua_constcreate(name));107 return luaI_findsymbol(luaI_createfixedstring(name));
112}108}
113 109
114 110
@@ -116,23 +112,15 @@ Word luaI_findsymbolbyname (char *name) · 1 unmodified line
116** Given a tree node, check it is has a correspondent constant index. If not,112** Given a tree node, check it is has a correspondent constant index. If not,
117** allocate it.113** allocate it.
118*/114*/
119Word luaI_findconstant (TreeNode *t)115Word luaI_findconstant (TaggedString *t)
120{116{
121 if (lua_constant == NULL)
122 lua_initconstant();
123 if (t->constindex == NOT_USED)117 if (t->constindex == NOT_USED)
124 {118 {
125 if (lua_nconstant == lua_maxconstant)119 if (lua_nconstant == lua_maxconstant)
126 {120 lua_maxconstant = growvector(&lua_constant, lua_maxconstant, TaggedString *,
127 if (lua_maxconstant >= MAX_WORD)121 constantEM, MAX_WORD);
128 lua_error("constant table overflow");
129 lua_maxconstant *= 2;
130 if (lua_maxconstant >= MAX_WORD)
131 lua_maxconstant = MAX_WORD;
132 lua_constant = growvector(lua_constant, lua_maxconstant, TaggedString *);
133 }
134 t->constindex = lua_nconstant;122 t->constindex = lua_nconstant;
135 lua_constant[lua_nconstant] = &(t->ts);123 lua_constant[lua_nconstant] = t;
136 lua_nconstant++;124 lua_nconstant++;
137 }125 }
138 return t->constindex;126 return t->constindex;
@@ -141,7 +129,15 @@ Word luaI_findconstant (TreeNode *t) · 2 unmodified lines
141 129
142Word luaI_findconstantbyname (char *name)130Word luaI_findconstantbyname (char *name)
143{131{
144 return luaI_findconstant(lua_constcreate(name));132 return luaI_findconstant(luaI_createfixedstring(name));
133}
134
135TaggedString *luaI_createfixedstring (char *name)
136{
137 TaggedString *ts = lua_createstring(name);
138 if (!ts->marked)
139 ts->marked = 2; /* avoid GC */
140 return ts;
145}141}
146 142
147 143
@@ -153,7 +149,7 @@ static char *lua_travsymbol (int (*fn)(Object *)) · 5 unmodified lines
153 Word i;149 Word i;
154 for (i=0; i<lua_ntable; i++)150 for (i=0; i<lua_ntable; i++)
155 if (fn(&s_object(i)))151 if (fn(&s_object(i)))
156 return luaI_nodebysymbol(i)->ts.str;152 return lua_table[i].varname->str;
157 return NULL;153 return NULL;
158}154}
159 155
@@ -162,7 +158,7 @@ static char *lua_travsymbol (int (*fn)(Object *)) · 2 unmodified lines
162** Mark an object if it is a string or a unmarked array.158** Mark an object if it is a string or a unmarked array.
163*/159*/
164int lua_markobject (Object *o)160int lua_markobject (Object *o)
165{161{/* if already marked, does not change mark value */
166 if (tag(o) == LUA_T_STRING && !tsvalue(o)->marked)162 if (tag(o) == LUA_T_STRING && !tsvalue(o)->marked)
167 tsvalue(o)->marked = 1;163 tsvalue(o)->marked = 1;
168 else if (tag(o) == LUA_T_ARRAY)164 else if (tag(o) == LUA_T_ARRAY)
@@ -173,27 +169,52 @@ int lua_markobject (Object *o) · 4 unmodified lines
173 return 0;169 return 0;
174}170}
175 171
172/*
173* returns 0 if the object is going to be (garbage) collected
174*/
175int luaI_ismarked (Object *o)
176{
177 switch (o->tag)
178 {
179 case LUA_T_STRING:
180 return o->value.ts->marked;
181 case LUA_T_FUNCTION:
182 return o->value.tf->marked;
183 case LUA_T_ARRAY:
184 return o->value.a->mark;
185 default: /* nil, number, cfunction, or user data */
186 return 1;
187 }
188}
189
176 190
177/*191/*
178** Garbage collection. 192** Garbage collection.
179** Delete all unused strings and arrays.193** Delete all unused strings and arrays.
180*/194*/
181void lua_pack (void)195Long luaI_collectgarbage (void)
182{196{
183 static Long block = GARBAGE_BLOCK; /* when garbage collector will be called */
184 static Long nentity = 0; /* counter of new entities (strings and arrays) */
185 Long recovered = 0;197 Long recovered = 0;
186 if (nentity++ < block) return;
187 lua_travstack(lua_markobject); /* mark stack objects */198 lua_travstack(lua_markobject); /* mark stack objects */
188 lua_travsymbol(lua_markobject); /* mark symbol table objects */199 lua_travsymbol(lua_markobject); /* mark symbol table objects */
189 luaI_travlock(lua_markobject); /* mark locked objects */200 luaI_travlock(lua_markobject); /* mark locked objects */
190 luaI_travfallbacks(lua_markobject); /* mark fallbacks */201 luaI_travfallbacks(lua_markobject); /* mark fallbacks */
202 luaI_invalidaterefs();
191 recovered += lua_strcollector();203 recovered += lua_strcollector();
192 recovered += lua_hashcollector();204 recovered += lua_hashcollector();
193 recovered += luaI_funccollector();205 recovered += luaI_funccollector();
194 nentity = 0; /* reset counter */206 return recovered;
195 block=(16*block-7*recovered)/12; /* adapt block size */207}
196 if (block < MIN_GARBAGE_BLOCK) block = MIN_GARBAGE_BLOCK;208
209void lua_pack (void)
210{
211 static unsigned long block = GARBAGE_BLOCK;
212 static unsigned long nentity = 0; /* total of strings, arrays, etc */
213 unsigned long recovered = 0;
214 if (nentity++ < block) return;
215 recovered = luaI_collectgarbage();
216 block = block*2*(1.0 - (float)recovered/nentity);
217 nentity -= recovered;
197} 218}
198 219
199 220
@@ -225,36 +246,12 @@ static void lua_nextvar (void) · 25 unmodified lines
225 }246 }
226 else247 else
227 {248 {
228 TreeNode *t = luaI_nodebysymbol(next);249 lua_pushstring(lua_table[next].varname->str);
229 Object name;
230 tag(&name) = LUA_T_STRING;
231 tsvalue(&name) = &(t->ts);
232 luaI_pushobject(&name);
233 luaI_pushobject(&s_object(next));250 luaI_pushobject(&s_object(next));
234 }251 }
235}252}
236 253
237 254
238static void setglobal (void)
239{
240 lua_Object name = lua_getparam(1);
241 lua_Object value = lua_getparam(2);
242 if (!lua_isstring(name))
243 lua_error("incorrect argument to function `setglobal'");
244 lua_pushobject(value);
245 lua_storeglobal(lua_getstring(name));
246}
247
248
249static void getglobal (void)
250{
251 lua_Object name = lua_getparam(1);
252 if (!lua_isstring(name))
253 lua_error("incorrect argument to function `getglobal'");
254 lua_pushobject(lua_getglobal(lua_getstring(name)));
255}
256
257
258static Object *functofind;255static Object *functofind;
259static int checkfunc (Object *o)256static int checkfunc (Object *o)
260{257{
@@ -270,7 +267,7 @@ static int checkfunc (Object *o) · 9 unmodified lines
270}267}
271 268
272 269
273char *getobjname (lua_Object o, char **name)270char *lua_getobjname (lua_Object o, char **name)
274{ /* try to find a name for given function */271{ /* try to find a name for given function */
275 functofind = luaI_Address(o);272 functofind = luaI_Address(o);
276 if ((*name = luaI_travfallbacks(checkfunc)) != NULL)273 if ((*name = luaI_travfallbacks(checkfunc)) != NULL)
src/table.h+17−8
@@ -1,7 +1,7 @@
1/*1/*
2** Module to control static tables2** Module to control static tables
3** TeCGraf - PUC-Rio3** TeCGraf - PUC-Rio
4** $Id: table.h,v 2.13 1995/10/26 14:21:56 roberto Exp $4** $Id: table.h,v 2.21 1996/04/22 18:00:37 roberto Exp $
5*/5*/
6 6
7#ifndef table_h7#ifndef table_h
@@ -10,19 +10,28 @@ · 2 unmodified lines
10#include "tree.h"10#include "tree.h"
11#include "opcode.h"11#include "opcode.h"
12 12
13extern Symbol *lua_table;13typedef struct
14extern TaggedString **lua_constant;14{
15 Object object;
16 TaggedString *varname;
17} Symbol;
15 18
16extern char *lua_file[];
17extern int lua_nfile;
18 19
20extern Symbol *lua_table;
21extern Word lua_ntable;
22extern TaggedString **lua_constant;
23extern Word lua_nconstant;
19 24
20void lua_initconstant (void);25void luaI_initsymbol (void);
26void luaI_initconstant (void);
21Word luaI_findsymbolbyname (char *name);27Word luaI_findsymbolbyname (char *name);
22Word luaI_findsymbol (TreeNode *t);28Word luaI_findsymbol (TaggedString *t);
23Word luaI_findconstant (TreeNode *t);29Word luaI_findconstant (TaggedString *t);
24Word luaI_findconstantbyname (char *name);30Word luaI_findconstantbyname (char *name);
31TaggedString *luaI_createfixedstring (char *str);
25int lua_markobject (Object *o);32int lua_markobject (Object *o);
33int luaI_ismarked (Object *o);
34Long luaI_collectgarbage (void);
26void lua_pack (void);35void lua_pack (void);
27 36
28 37
src/tree.c+100−78
@@ -3,7 +3,7 @@ · 2 unmodified lines
3** TecCGraf - PUC-Rio3** TecCGraf - PUC-Rio
4*/4*/
5 5
6char *rcs_tree="$Id: tree.c,v 1.14 1995/10/17 11:53:53 roberto Exp $";6char *rcs_tree="$Id: tree.c,v 1.20 1996/03/14 15:56:26 roberto Exp $";
7 7
8 8
9#include <string.h>9#include <string.h>
@@ -11,66 +11,104 @@ char *rcs_tree="$Id: tree.c,v 1.14 1995/10/17 11:53:53 roberto Exp $"; · 1 unmodified line
11#include "mem.h"11#include "mem.h"
12#include "lua.h"12#include "lua.h"
13#include "tree.h"13#include "tree.h"
14#include "lex.h"
15#include "hash.h"
14#include "table.h"16#include "table.h"
15 17
16 18
17#define lua_strcmp(a,b) (a[0]<b[0]?(-1):(a[0]>b[0]?(1):strcmp(a,b))) 19#define NUM_HASHS 64
18 20
21typedef struct {
22 int size;
23 int nuse; /* number of elements (including EMPTYs) */
24 TaggedString **hash;
25} stringtable;
19 26
20typedef struct StringNode {27static int initialized = 0;
21 struct StringNode *next;
22 TaggedString ts;
23} StringNode;
24 28
25static StringNode *string_root = NULL;29static stringtable string_root[NUM_HASHS];
26 30
27static TreeNode *constant_root = NULL;31static TaggedString EMPTY = {NOT_USED, NOT_USED, 0, 2, {0}};
28 32
29/*33
30** Insert a new constant/variable at the tree. 34static unsigned long hash (char *str)
31*/
32static TreeNode *tree_create (TreeNode **node, char *str)
33{35{
34 if (*node == NULL)36 unsigned long h = 0;
35 {37 while (*str)
36 *node = (TreeNode *) luaI_malloc(sizeof(TreeNode)+strlen(str));38 h = ((h<<5)-h)^(unsigned char)*(str++);
37 (*node)->left = (*node)->right = NULL;39 return h;
38 strcpy((*node)->ts.str, str);
39 (*node)->ts.marked = 0;
40 (*node)->ts.hash = 0;
41 (*node)->varindex = (*node)->constindex = NOT_USED;
42 return *node;
43 }
44 else
45 {
46 int c = lua_strcmp(str, (*node)->ts.str);
47 if (c < 0)
48 return tree_create(&(*node)->left, str);
49 else if (c > 0)
50 return tree_create(&(*node)->right, str);
51 else
52 return *node;
53 }
54}40}
55 41
56TaggedString *lua_createstring (char *str) 42static void initialize (void)
57{43{
58 StringNode *newString;44 initialized = 1;
59 if (str == NULL) return NULL;45 luaI_addReserved();
60 lua_pack();46 luaI_initsymbol();
61 newString = (StringNode *)luaI_malloc(sizeof(StringNode)+strlen(str));47 luaI_initconstant();
62 newString->ts.marked = 0;48}
63 newString->ts.hash = 0;49
64 strcpy(newString->ts.str, str);50
65 newString->next = string_root;51static void grow (stringtable *tb)
66 string_root = newString;52{
67 return &(newString->ts);53 int newsize = luaI_redimension(tb->size);
54 TaggedString **newhash = newvector(newsize, TaggedString *);
55 int i;
56 for (i=0; i<newsize; i++)
57 newhash[i] = NULL;
58 /* rehash */
59 tb->nuse = 0;
60 for (i=0; i<tb->size; i++)
61 if (tb->hash[i] != NULL && tb->hash[i] != &EMPTY)
62 {
63 int h = tb->hash[i]->hash%newsize;
64 while (newhash[h])
65 h = (h+1)%newsize;
66 newhash[h] = tb->hash[i];
67 tb->nuse++;
68 }
69 luaI_free(tb->hash);
70 tb->size = newsize;
71 tb->hash = newhash;
68}72}
69 73
74static TaggedString *insert (char *str, stringtable *tb)
75{
76 TaggedString *ts;
77 unsigned long h = hash(str);
78 int i;
79 int j = -1;
80 if ((Long)tb->nuse*3 >= (Long)tb->size*2)
81 {
82 if (!initialized)
83 initialize();
84 grow(tb);
85 }
86 i = h%tb->size;
87 while (tb->hash[i])
88 {
89 if (tb->hash[i] == &EMPTY)
90 j = i;
91 else if (strcmp(str, tb->hash[i]->str) == 0)
92 return tb->hash[i];
93 i = (i+1)%tb->size;
94 }
95 /* not found */
96 lua_pack();
97 if (j != -1) /* is there an EMPTY space? */
98 i = j;
99 else
100 tb->nuse++;
101 ts = tb->hash[i] = (TaggedString *)luaI_malloc(sizeof(TaggedString)+strlen(str));
102 strcpy(ts->str, str);
103 ts->marked = 0;
104 ts->hash = h;
105 ts->varindex = ts->constindex = NOT_USED;
106 return ts;
107}
70 108
71TreeNode *lua_constcreate (char *str) 109TaggedString *lua_createstring (char *str)
72{110{
73 return tree_create(&constant_root, str);111 return insert(str, &string_root[(unsigned)str[0]%NUM_HASHS]);
74}112}
75 113
76 114
@@ -80,44 +118,28 @@ TreeNode *lua_constcreate (char *str) · 3 unmodified lines
80*/118*/
81Long lua_strcollector (void)119Long lua_strcollector (void)
82{120{
83 StringNode *curr = string_root, *prev = NULL;
84 Long counter = 0;121 Long counter = 0;
85 while (curr)122 int i;
123 for (i=0; i<NUM_HASHS; i++)
86 {124 {
87 StringNode *next = curr->next;125 stringtable *tb = &string_root[i];
88 if (!curr->ts.marked)126 int j;
89 {127 for (j=0; j<tb->size; j++)
90 if (prev == NULL) string_root = next;
91 else prev->next = next;
92 luaI_free(curr);
93 ++counter;
94 }
95 else
96 {128 {
97 curr->ts.marked = 0;129 TaggedString *t = tb->hash[j];
98 prev = curr;130 if (t != NULL && t->marked <= 1)
131 {
132 if (t->marked)
133 t->marked = 0;
134 else
135 {
136 luaI_free(t);
137 tb->hash[j] = &EMPTY;
138 counter++;
139 }
140 }
99 }141 }
100 curr = next;
101 }142 }
102 return counter;143 return counter;
103}144}
104 145
105
106/*
107** Traverse the constant tree looking for a specific symbol number
108*/
109static TreeNode *nodebysymbol (TreeNode *root, Word symbol)
110{
111 TreeNode *t;
112 if (root == NULL) return NULL;
113 if (root->varindex == symbol) return root;
114 t = nodebysymbol(root->left, symbol);
115 if (t) return t;
116 return nodebysymbol(root->right, symbol);
117}
118
119TreeNode *luaI_nodebysymbol (Word symbol)
120{
121 return nodebysymbol(constant_root, symbol);
122}
123
src/tree.h+4−13
@@ -1,7 +1,7 @@
1/*1/*
2** tree.h2** tree.h
3** TecCGraf - PUC-Rio3** TecCGraf - PUC-Rio
4** $Id: tree.h,v 1.10 1995/10/17 11:53:53 roberto Exp $4** $Id: tree.h,v 1.14 1996/02/26 17:07:49 roberto Exp $
5*/5*/
6 6
7#ifndef tree_h7#ifndef tree_h
@@ -14,24 +14,15 @@ · 6 unmodified lines
14 14
15typedef struct TaggedString15typedef struct TaggedString
16{16{
17 Word varindex; /* != NOT_USED if this is a symbol */
18 Word constindex; /* != NOT_USED if this is a constant */
17 unsigned long hash; /* 0 if not initialized */19 unsigned long hash; /* 0 if not initialized */
18 char marked; /* for garbage collection */20 int marked; /* for garbage collection; never collect (nor change) if > 1 */
19 char str[1]; /* \0 byte already reserved */21 char str[1]; /* \0 byte already reserved */
20} TaggedString;22} TaggedString;
21 23
22typedef struct TreeNode
23{
24 struct TreeNode *right;
25 struct TreeNode *left;
26 unsigned short varindex; /* != NOT_USED if this is a symbol */
27 unsigned short constindex; /* != NOT_USED if this is a constant */
28 TaggedString ts;
29} TreeNode;
30
31 24
32TaggedString *lua_createstring (char *str);25TaggedString *lua_createstring (char *str);
33TreeNode *lua_constcreate (char *str);
34Long lua_strcollector (void);26Long lua_strcollector (void);
35TreeNode *luaI_nodebysymbol (Word symbol);
36 27
37#endif28#endif
src/types.h+1−3
@@ -1,6 +1,6 @@
1/*1/*
2** TeCGraf - PUC-Rio2** TeCGraf - PUC-Rio
3** $Id: types.h,v 1.3 1995/02/06 19:32:43 roberto Exp $3** $Id: types.h,v 1.4 1996/02/07 14:13:17 roberto Exp $
4*/4*/
5 5
6#ifndef types_h6#ifndef types_h
@@ -12,8 +12,6 @@ · 5 unmodified lines
12#define real float12#define real float
13#endif13#endif
14 14
15typedef int Bool; /* boolean values */
16
17#define Byte lua_Byte /* some systems have Byte as a predefined type */15#define Byte lua_Byte /* some systems have Byte as a predefined type */
18typedef unsigned char Byte; /* unsigned 8 bits */16typedef unsigned char Byte; /* unsigned 8 bits */
19 17
src/ugly.h+0−36
@@ -1,36 +0,0 @@
1/*
2** ugly.h
3** TecCGraf - PUC-Rio
4** $Id: ugly.h,v 1.2 1994/11/13 14:39:04 roberto Stab $
5*/
6
7#ifndef ugly_h
8#define ugly_h
9
10/* This enum must have the same order of the array 'reserved' in lex.c */
11
12enum {
13 U_and=128,
14 U_do,
15 U_else,
16 U_elseif,
17 U_end,
18 U_function,
19 U_if,
20 U_local,
21 U_nil,
22 U_not,
23 U_or,
24 U_repeat,
25 U_return,
26 U_then,
27 U_until,
28 U_while,
29 U_eq = '='+128,
30 U_le = '<'+128,
31 U_ge = '>'+128,
32 U_ne = '~'+128,
33 U_sc = '.'+128
34};
35
36#endif
src/undump.c+326−0
@@ -0,0 +1,326 @@
1/*
2** undump.c
3** load bytecodes from files
4*/
5
6char* rcs_undump="$Id: undump.c,v 1.14 1996/03/14 17:31:15 lhf Exp $";
7
8#include <stdio.h>
9#include <string.h>
10#include "opcode.h"
11#include "mem.h"
12#include "table.h"
13#include "undump.h"
14
15static int swapword=0;
16static int swapfloat=0;
17static TFunc* Main=NULL; /* functions in a chunk */
18static TFunc* lastF=NULL;
19
20static void warn(char* s) /* TODO: remove */
21{
22#if 0
23 fprintf(stderr,"undump: %s\n",s);
24#endif
25}
26
27static void FixCode(Byte* code, Byte* end) /* swap words */
28{
29 Byte* p;
30 for (p=code; p!=end;)
31 {
32 OpCode op=(OpCode)*p;
33 switch (op)
34 {
35 case PUSHNIL:
36 case PUSH0:
37 case PUSH1:
38 case PUSH2:
39 case PUSHLOCAL0:
40 case PUSHLOCAL1:
41 case PUSHLOCAL2:
42 case PUSHLOCAL3:
43 case PUSHLOCAL4:
44 case PUSHLOCAL5:
45 case PUSHLOCAL6:
46 case PUSHLOCAL7:
47 case PUSHLOCAL8:
48 case PUSHLOCAL9:
49 case PUSHINDEXED:
50 case STORELOCAL0:
51 case STORELOCAL1:
52 case STORELOCAL2:
53 case STORELOCAL3:
54 case STORELOCAL4:
55 case STORELOCAL5:
56 case STORELOCAL6:
57 case STORELOCAL7:
58 case STORELOCAL8:
59 case STORELOCAL9:
60 case STOREINDEXED0:
61 case ADJUST0:
62 case EQOP:
63 case LTOP:
64 case LEOP:
65 case GTOP:
66 case GEOP:
67 case ADDOP:
68 case SUBOP:
69 case MULTOP:
70 case DIVOP:
71 case POWOP:
72 case CONCOP:
73 case MINUSOP:
74 case NOTOP:
75 case POP:
76 case RETCODE0:
77 p++;
78 break;
79 case PUSHBYTE:
80 case PUSHLOCAL:
81 case STORELOCAL:
82 case STOREINDEXED:
83 case STORELIST0:
84 case ADJUST:
85 case RETCODE:
86 p+=2;
87 break;
88 case STORELIST:
89 case CALLFUNC:
90 p+=3;
91 break;
92 case PUSHFUNCTION:
93 p+=5;
94 break;
95 case PUSHWORD:
96 case PUSHSELF:
97 case CREATEARRAY:
98 case ONTJMP:
99 case ONFJMP:
100 case JMP:
101 case UPJMP:
102 case IFFJMP:
103 case IFFUPJMP:
104 case SETLINE:
105 case PUSHSTRING:
106 case PUSHGLOBAL:
107 case STOREGLOBAL:
108 {
109 Byte t;
110 t=p[1]; p[1]=p[2]; p[2]=t;
111 p+=3;
112 break;
113 }
114 case PUSHFLOAT:
115 {
116 Byte t;
117 t=p[1]; p[1]=p[4]; p[4]=t;
118 t=p[2]; p[2]=p[3]; p[3]=t;
119 p+=5;
120 break;
121 }
122 case STORERECORD:
123 {
124 int n=*++p;
125 p++;
126 while (n--)
127 {
128 Byte t;
129 t=p[0]; p[0]=p[1]; p[1]=t;
130 p+=2;
131 }
132 break;
133 }
134 default:
135 lua_error("corrupt binary file");
136 break;
137 }
138 }
139}
140
141static void Unthread(Byte* code, int i, int v)
142{
143 while (i!=0)
144 {
145 CodeWord c;
146 Byte* p=code+i;
147 get_word(c,p);
148 i=c.w;
149 c.w=v;
150 p[-2]=c.m.c1;
151 p[-1]=c.m.c2;
152 }
153}
154
155static int LoadWord(FILE* D)
156{
157 Word w;
158 fread(&w,sizeof(w),1,D);
159 if (swapword)
160 {
161 Byte* p=(Byte*)&w; /* TODO: need union? */
162 Byte t;
163 t=p[0]; p[0]=p[1]; p[1]=t;
164 }
165 return w;
166}
167
168static int LoadSize(FILE* D)
169{
170 Word hi=LoadWord(D);
171 Word lo=LoadWord(D);
172 int s=(hi<<16)|lo;
173 if ((Word)s != s) lua_error("code too long");
174 return s;
175}
176
177static char* LoadBlock(int size, FILE* D)
178{
179 char* b=luaI_malloc(size);
180 fread(b,size,1,D);
181 return b;
182}
183
184static char* LoadString(FILE* D)
185{
186 int size=LoadWord(D);
187 char *b=luaI_buffer(size);
188 fread(b,size,1,D);
189 return b;
190}
191
192static char* LoadNewString(FILE* D)
193{
194 return LoadBlock(LoadWord(D),D);
195}
196
197static void LoadFunction(FILE* D)
198{
199 TFunc* tf=new(TFunc);
200 tf->next=NULL;
201 tf->locvars=NULL;
202 tf->size=LoadSize(D);
203 tf->lineDefined=LoadWord(D);
204 if (IsMain(tf)) /* new main */
205 {
206 tf->fileName=LoadNewString(D);
207 Main=lastF=tf;
208 }
209 else /* fix PUSHFUNCTION */
210 {
211 CodeCode c;
212 Byte* p;
213 tf->marked=LoadWord(D);
214 tf->fileName=Main->fileName;
215 p=Main->code+tf->marked;
216 c.tf=tf;
217 *p++=c.m.c1; *p++=c.m.c2; *p++=c.m.c3; *p++=c.m.c4;
218 lastF=lastF->next=tf;
219 }
220 tf->code=LoadBlock(tf->size,D);
221 if (swapword || swapfloat) FixCode(tf->code,tf->code+tf->size);
222 while (1) /* unthread */
223 {
224 int c=getc(D);
225 if (c==ID_VAR) /* global var */
226 {
227 int i=LoadWord(D);
228 char* s=LoadString(D);
229 int v=luaI_findsymbolbyname(s);
230 Unthread(tf->code,i,v);
231 }
232 else if (c==ID_STR) /* constant string */
233 {
234 int i=LoadWord(D);
235 char* s=LoadString(D);
236 int v=luaI_findconstantbyname(s);
237 Unthread(tf->code,i,v);
238 }
239 else
240 {
241 ungetc(c,D);
242 break;
243 }
244 }
245}
246
247static void LoadSignature(FILE* D)
248{
249 char* s=SIGNATURE;
250 while (*s!=0 && getc(D)==*s)
251 ++s;
252 if (*s!=0) lua_error("bad signature");
253}
254
255static void LoadHeader(FILE* D) /* TODO: error handling */
256{
257 Word w,tw=TEST_WORD;
258 float f,tf=TEST_FLOAT;
259 LoadSignature(D);
260 getc(D); /* skip version */
261 fread(&w,sizeof(w),1,D); /* test word */
262 if (w!=tw)
263 {
264 swapword=1;
265 warn("different byte order");
266 }
267 fread(&f,sizeof(f),1,D); /* test float */
268 if (f!=tf)
269 {
270 Byte* p=(Byte*)&f; /* TODO: need union? */
271 Byte t;
272 swapfloat=1;
273 t=p[0]; p[0]=p[3]; p[3]=t;
274 t=p[1]; p[1]=p[2]; p[2]=t;
275 if (f!=tf) /* TODO: try another perm? */
276 lua_error("different float representation");
277 else
278 warn("different byte order in floats");
279 }
280}
281
282static void LoadChunk(FILE* D)
283{
284 LoadHeader(D);
285 while (1)
286 {
287 int c=getc(D);
288 if (c==ID_FUN) LoadFunction(D); else { ungetc(c,D); break; }
289 }
290}
291
292/*
293** load one chunk from a file.
294** return list of functions found, headed by main, or NULL at EOF.
295*/
296TFunc* luaI_undump1(FILE* D)
297{
298 while (1)
299 {
300 int c=getc(D);
301 if (c==ID_CHUNK)
302 {
303 LoadChunk(D);
304 return Main;
305 }
306 else if (c==EOF)
307 return NULL;
308 else
309 lua_error("not a lua binary file");
310 }
311}
312
313/*
314** load and run all chunks in a file
315*/
316int luaI_undump(FILE* D)
317{
318 TFunc* m;
319 while ((m=luaI_undump1(D)))
320 {
321 int status=luaI_dorun(m);
322 luaI_freefunc(m);
323 if (status!=0) return status;
324 }
325 return 0;
326}
src/undump.h+23−0
@@ -0,0 +1,23 @@
1/*
2** undump.h
3** definitions for lua decompiler
4** $Id: undump.h,v 1.2 1996/03/11 21:59:41 lhf Exp $
5*/
6
7#include "func.h"
8
9#define IsMain(f) (f->lineDefined==0)
10
11/* definitions for chunk headers */
12
13#define ID_CHUNK 27 /* ESC */
14#define ID_FUN 'F'
15#define ID_VAR 'V'
16#define ID_STR 'S'
17#define SIGNATURE "Lua"
18#define VERSION 0x23 /* 2.3 */
19#define TEST_WORD 0x1234 /* a word for testing byte ordering */
20#define TEST_FLOAT 0.123456789e-23 /* a float for testing representation */
21
22TFunc* luaI_undump1(FILE* D); /* load one chunk */
23int luaI_undump(FILE* D); /* load all chunks */
test/bisect.lua+26−0
@@ -0,0 +1,26 @@
1$debug
2-- bisection method for solving non-linear equations
3
4function bisect(f,a,b,fa,fb)
5print(n.." a="..a.." fa="..fa.." b="..b.." fb="..fb)
6 local c=(a+b)/2
7 if abs(a-b)<delta then return c end
8 n=n+1
9 local fc=f(c)
10 if fa*fc<0 then return bisect(f,a,c,fa,fc) else return bisect(f,c,b,fc,fb) end
11end
12
13-- find root of f in the inverval [a,b]. bisection needs that f(a)*f(b)<0
14function solve(f,a,b)
15 delta=1e-6 -- tolerance
16 n=0
17 local z=bisect(f,a,b,f(a),f(b))
18 print(format("after %d steps, root is %.10g",n,z))
19end
20
21-- our function
22function f(x)
23 return x*x*x-x-1
24end
25
26solve(f,1,2)
test/cf.lua+27−0
@@ -0,0 +1,27 @@
1-- temperature conversion table
2
3-- celsius to farenheit
4
5c0=-20
6while c0<50 do
7
8 c1=c0+10
9 write("C ")
10 c=c0
11 while c<c1 do
12 write(format("%3.0f ",c))
13 c=c+1
14 end
15 write("\n")
16
17 c=c0
18 write("F ")
19 while c<c1 do
20 f=(9/5)*c+32
21 write(format("%3.0f ",f))
22 c=c+1
23 end
24 write("\n\n")
25
26 c0=c1
27end
test/dump.lua+1−1
@@ -1,4 +1,4 @@
1 1-- dump global environment
2 2
3function savevar (n,v)3function savevar (n,v)
4 if v == nil then return end;4 if v == nil then return end;
test/examples/ps/ps.lua+3−7
@@ -1,7 +1,7 @@
1-- ps.lua1-- ps.lua
2-- lua interface to postscript2-- lua interface to postscript
3-- Luiz Henrique de Figueiredo (lhf@csg.uwaterloo.ca)3-- Luiz Henrique de Figueiredo (lhf@csg.uwaterloo.ca)
4-- 12 Nov 954-- 14 May 96
5 5
6PS={}6PS={}
7 7
@@ -12,15 +12,11 @@ end · 4 unmodified lines
12-------------------------------------------------------------------- control --12-------------------------------------------------------------------- control --
13 13
14function PS.open(title)14function PS.open(title)
15 local d,m,y=date()
16 local H,M,S=time()
17 if d<10 then d="0"..d end
18 if m<10 then m="0"..m end
19 if title==nil then title="(no title)" end15 if title==nil then title="(no title)" end
20 P("%!PS-Adobe-2.0 EPSF-1.2")16 P("%!PS-Adobe-2.0 EPSF-1.2")
21 P("%%Title: "..title)17 P("%%Title: "..title)
22 P("%%Creator: ps.lua from Lua 2.2")18 P("%%Creator: ps.lua from Lua 2.4")
23 P("%%CreationDate: "..y..m..d.." "..H..":"..M..":"..S)19 P("%%CreationDate: "..date())
24 P("%%Pages: (atend)")20 P("%%Pages: (atend)")
25 P("%%BoundingBox: (atend)")21 P("%%BoundingBox: (atend)")
26 P("%%EndComments")22 P("%%EndComments")
test/hello.lua+3−0
@@ -0,0 +1,3 @@
1-- the first program in every language
2
3print("hello world, from Lua!")
test/long.lua+0−22
@@ -1,22 +0,0 @@
1function sort(a,n) -- selection sort
2 local i=1
3 while i<=n do
4 local m, j = i, i+1
5 while j<=n do
6 if a[j]<a[m] then m=j end
7 j=j+1
8 end
9 a[i],a[m]=a[m],a[i] -- swap a[i] and a[m]
10 i=i+1
11 end
12end
13
14
15v = { }
16
17i=1
18while i <= 5000 do v[i] = 5000-i i=i+1 end
19
20sort(v,5000)
21
22print("v512 = ".. v[512])
test/sort.lua+35−37
@@ -1,28 +1,25 @@
1$debug1$debug
2 2
3function quicksort(r,s)3function quicksort(a,r,s)
4 if s<=r then return end -- caso basico da recursao4 if s<=r then return end
5 local v, i, j = x[r], r, s+15 local v, i, j = a[r], r, s+1
6 i=i+1; while x[i]<v do i=i+1 end6 repeat
7 j=j-1; while x[j]>v do j=j-1 end7 i=i+1; while a[i]<v do i=i+1 end
8 x[i],x[j]=x[j],x[i]8 j=j-1; while a[j]>v do j=j-1 end
9 while j>i do -- separacao9 a[i],a[j]=a[j],a[i]
10 i=i+1; while x[i]<v do i=i+1 end10 until j<=i
11 j=j-1; while x[j]>v do j=j-1 end11 a[i],a[j]=a[j],a[i] -- undo last swap
12 x[i],x[j]=x[j],x[i]12 a[j],a[r]=a[r],a[j]
13 end13 quicksort(a,r,j-1)
14 x[i],x[j]=x[j],x[i] -- undo last swap14 quicksort(a,j+1,s)
15 x[j],x[r]=x[r],x[j]
16 quicksort(r,j-1) -- recursao
17 quicksort(j+1,s)
18end15end
19 16
20function sort(a,n) -- selection sort17function selectionsort(a,n)
21 local i=118 local i=1
22 while i<=n do19 while i<=n do
23 local m, j = i, i+120 local m, j = i, i+1
24 while j<=n do21 while j<=n do
25 if a[j]<a[m] then m=j end22 if a[j]>a[m] then m=j end -- reverse sort
26 j=j+123 j=j+1
27 end24 end
28 a[i],a[m]=a[m],a[i] -- swap a[i] and a[m]25 a[i],a[m]=a[m],a[i] -- swap a[i] and a[m]
@@ -30,25 +27,26 @@ function sort(a,n) -- selection sort · 1 unmodified line
30 end27 end
31end28end
32 29
33function main()30function show(m,x)
34 x={}31 write(m.."\n\t")
35 n=-132 local i=0
36 n=n+1; x[n]="a"33 while x[i] do
37 n=n+1; x[n]="waldemar"34 write(x[i])
38 n=n+1; x[n]="luiz"35 i=i+1
39 n=n+1; x[n]="lula"36 if x[i] then write(",") end
40 n=n+1; x[n]="peter"37 end
41 n=n+1; x[n]="raquel"38 write("\n")
42 n=n+1; x[n]="camilo"
43 n=n+1; x[n]="andre"
44 n=n+1; x[n]="marcelo"
45 n=n+1; x[n]="sedrez"
46 n=n+1; x[n]="z"
47 print(x[0]..","..x[1]..","..x[2]..","..x[3]..","..x[4]..","..x[5]..","..x[6]..","..x[7]..","..x[8]..","..x[9]..","..x[10])
48 quicksort(1,n-1)
49 print(x[0]..","..x[1]..","..x[2]..","..x[3]..","..x[4]..","..x[5]..","..x[6]..","..x[7]..","..x[8]..","..x[9]..","..x[10])
50 sort (x, n-1)
51 print(x[0]..","..x[1]..","..x[2]..","..x[3]..","..x[4]..","..x[5]..","..x[6]..","..x[7]..","..x[8]..","..x[9]..","..x[10])
52end39end
53 40
54main()41x={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
42
43n=1 while x[n] do n=n+1 end -- count elements
44x[0]="A" x[n]="Z" -- quicksort need sentinels
45
46show("original",x)
47
48quicksort(x,1,n-1)
49show("after quicksort",x)
50
51selectionsort(x, n-1)
52show("after reverse selection sort",x)