From 0849a2fd1cf4d4978cf76e60041ba3ce44bcfb30 Mon Sep 17 00:00:00 2001 From: Lua Team Date: Tue, 28 Nov 1995 19:22:48 +0000 Subject: [PATCH] Imported from ../lua-2.2.tar.gz. --- COPYRIGHT | 42 +- README | 50 +- clients/lib/Makefile | 11 +- clients/lib/iolib.c | 695 ++--- clients/lib/mathlib.c | 527 ++-- clients/lib/strlib.c | 159 +- clients/lua/Makefile | 8 +- clients/lua/lua.c | 34 +- doc/Makefile | 16 + doc/manual.dvi | Bin 66972 -> 0 bytes doc/manual.ps | 5431 +++++++++++++++++++------------------ domake | 5 +- include/Makefile | 9 +- include/lua.h | 10 +- include/luadebug.h | 20 + include/lualib.h | 8 +- src/Makefile | 11 +- src/fallback.c | 50 +- src/fallback.h | 7 +- src/func.c | 79 + src/func.h | 24 + src/hash.c | 9 +- src/inout.c | 140 +- src/inout.h | 9 +- src/lex.c | 98 +- src/{yacc => }/lua.stx | 392 +-- src/opcode.c | 396 +-- src/opcode.h | 25 +- src/parser.c | 1058 ++++---- src/parser.h | 3 +- src/table.c | 129 +- src/table.h | 10 +- src/tree.c | 42 +- src/tree.h | 4 +- src/yacc/Makefile | 3 - test/README | 7 + test/examples/complex/complex.lua | 82 + test/examples/complex/mandel.lua | 25 + test/examples/ps/hilbert.lua | 44 + test/examples/ps/ps.lua | 185 ++ test/save.lua | 57 +- test/type.lua | 10 +- 42 files changed, 5380 insertions(+), 4544 deletions(-) rewrite COPYRIGHT (76%) rewrite clients/lib/mathlib.c (61%) create mode 100644 doc/Makefile delete mode 100644 doc/manual.dvi rewrite doc/manual.ps (95%) create mode 100644 include/luadebug.h create mode 100644 src/func.c create mode 100644 src/func.h rename src/{yacc => }/lua.stx (71%) delete mode 100644 src/yacc/Makefile create mode 100644 test/README create mode 100644 test/examples/complex/complex.lua create mode 100644 test/examples/complex/mandel.lua create mode 100644 test/examples/ps/hilbert.lua create mode 100644 test/examples/ps/ps.lua rewrite test/save.lua (90%) diff --git a/COPYRIGHT b/COPYRIGHT dissimilarity index 76% index b730ccd..eb400ec 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,18 +1,24 @@ -Copyright (c) 1994-1995 -Waldemar Celes Filho, Luiz Henrique de Figueiredo, Roberto Ierusalimschy. -All rights reserved. - -Permission is hereby granted, without written agreement and without license -or royalty fees, to use, copy, modify, and distribute this software and its -documentation for any purpose, provided that the above copyright notice and -the following two paragraphs appear in all copies of this software. - -In no event shall the authors be liable to any party for direct, indirect, -special, incidental, or consequential damages arising out of the use of this -software and its documentation. - -The authors specifically disclaims any warranties, including, but not limited -to, the implied warranties of merchantability and fitness for a particular -purpose. the software provided hereunder is on an "as is" basis, and the -authors have no obligation to provide maintenance, support, updates, -enhancements, or modifications. +Copyright (c) 1994-1995 TeCGraf, PUC-Rio. Written by Waldemar Celes Filho, +Roberto Ierusalimschy, Luiz Henrique de Figueiredo. All rights reserved. + +Permission is hereby granted, without written agreement and without license or +royalty fees, to use, copy, modify, and distribute this software and its +documentation for any purpose, subject to the following conditions: + +The above copyright notice and this permission notice shall appear in all +copies or substantial portions of this software. + +The name "Lua" cannot be used for any modified form of this software that does +not originate from the authors. Nevertheless, the name "Lua" may and should be +used to designate the language implemented and described in this package, +even if embedded in any other system, as long as its syntax and semantics +remain unchanged. + +The authors specifically disclaim any warranties, including, but not limited +to, the implied warranties of merchantability and fitness for a particular +purpose. The software provided hereunder is on an "as is" basis, and the +authors have no obligation to provide maintenance, support, updates, +enhancements, or modifications. In no event shall TeCGraf, PUC-Rio, or the +authors be liable to any party for direct, indirect, special, incidental, or +consequential damages arising out of the use of this software and its +documentation. diff --git a/README b/README index 6b349ce..449eb5f 100644 --- a/README +++ b/README @@ -5,38 +5,48 @@ Dozens of industrial products developed by TeCGraf use Lua. * Some features of Lua - + a simple, pascal-like, syntax; - + powerful data description constructs (e.g., associative arrays); - + user-controlled type constructors; - + fallbacks for extending the meaning of the language in unconventional ways; - + Lua programs are compiled into bytecodes, which are then interpreted to - simulate a virtual machine; - + portable, written in ANSI C. + + a simple, pascal-like, syntax + + powerful data description constructs (e.g., associative arrays) + + user-controlled type constructors + + fallbacks for extending the language in unconventional ways (e.g., + inheritance, overloading) + + garbage collection + + Lua programs are compiled into bytecodes, which are then interpreted + + portable, written in ANSI C (runs in Unix, DOS, Windows, Mac, Cray, ...) * Availability - ftp://ftp.icad.puc-rio.br/pub/lua/lua-2.1.tar.gz - http://www.inf.puc-rio.br/projetos/roberto/lua.html + In Brazil: ftp://ftp.icad.puc-rio.br/pub/lua/lua-2.2.tar.gz + In Canada: ftp://csg.uwaterloo.ca/pub/lhf/lua/lua-2.2.tar.gz + Home page: http://www.inf.puc-rio.br/~roberto/lua.html -* Changes since version 1.1 (current version is 2.1) - + object-oriented support; - + fallbacks; - + simplified syntax for tables; - + many internal improvements. +* Legal matters + Lua is freely available for both academic and commercial purposes. + Lua is not in the public domain; TeCGraf keeps its copyright. + See COPYRIGHT. + +* Changes since version 2.1 (current version is 2.2) + + functions now may be declared with any "lvalue" as a name + + garbage collection of functions + + support for pipes + +* Changes since version 1.1 + + object-oriented support + + fallbacks + + simplified syntax for tables + + many internal improvements * Installing To make, simply type domake. If make succeeds, you get an interpreter in ./bin/lua. + If make fails, please let me know. The libraries are in ./lib. The include files are in ./include. You don't need the other directories for development. - There is a reference manual in ./doc and tests in ./test. + There is a reference manual in ./doc, and tests and examples in ./test. This distribution is biased towards SunOS 4 with gcc but it is simple to - change the Makefiles for other systems. + change the Makefiles for other systems, if necessary. If you are running SunOs, type also "domake dynamic" to build shared libraries in ./lib. - -* Legal matters - Lua is now freely available for both academic and commercial purposes. - Lua is not in the public domain; TeCGraf keeps its copyright. + If your system does not have "popen", then change ./clients/lib/Makefile. * Contacting the authors Send your comments, bug reports and anything else to lhf@icad.puc-rio.br. diff --git a/clients/lib/Makefile b/clients/lib/Makefile index b191b75..7075097 100644 --- a/clients/lib/Makefile +++ b/clients/lib/Makefile @@ -7,15 +7,19 @@ LIB= $(LUA)/lib INCS= -I/usr/5include -I$(INC) WARN= -Wall -Wmissing-prototypes -Wshadow -ansi +# if your system does not have popen, remove -DPOPEN from the line below +DEFS= -DPOPEN + CC= gcc CFLAGS= $(INCS) $(DEFS) $(WARN) -O2 OBJS= iolib.o mathlib.o strlib.o +SRCS= iolib.c mathlib.c mathlib.h strlib.c strlib.h SLIB= $(LIB)/liblualib.a # dynamic libraries only work for SunOs -DLIB= $(LIB)/liblualib.so.2.1 +DLIB= $(LIB)/liblualib.so.$(VERSION) all: $(SLIB) @@ -32,4 +36,7 @@ clean: rm -f $(OBJS) $(SLIB) $(DLIB) co: - co -M iolib.c mathlib.c mathlib.h strlib.c strlib.h + co -f -M $(SRCS) + +klean: clean + rm -f $(SRCS) diff --git a/clients/lib/iolib.c b/clients/lib/iolib.c index bb3883a..01f8b55 100644 --- a/clients/lib/iolib.c +++ b/clients/lib/iolib.c @@ -3,7 +3,7 @@ ** Input/output library to LUA */ -char *rcs_iolib="$Id: iolib.c,v 1.21 1995/02/06 19:36:13 roberto Exp $"; +char *rcs_iolib="$Id: iolib.c,v 1.29 1995/11/10 18:32:59 roberto Exp $"; #include #include @@ -14,51 +14,68 @@ char *rcs_iolib="$Id: iolib.c,v 1.21 1995/02/06 19:36:13 roberto Exp $"; #include #include "lua.h" +#include "luadebug.h" #include "lualib.h" static FILE *in=stdin, *out=stdout; + +#ifdef POPEN +FILE *popen(); +int pclose(); +#else +#define popen(x,y) NULL /* that is, popen always fails */ +#define pclose(x) (-1) +#endif + + +static void closeread (void) +{ + if (in != stdin) + { + if (pclose(in) == -1) + fclose(in); + in = stdin; + } +} + +static void closewrite (void) +{ + if (out != stdout) + { + if (pclose(out) == -1) + fclose(out); + out = stdout; + } +} + /* ** Open a file to read. ** LUA interface: ** status = readfrom (filename) ** where: ** status = 1 -> success -** status = 0 -> error +** status = nil -> error */ static void io_readfrom (void) { - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) /* restore standart input */ - { - if (in != stdin) - { - fclose (in); - in = stdin; - } + if (lua_getparam (1) == LUA_NOOBJECT) + { /* restore standart input */ + closeread(); lua_pushnumber (1); } else { - if (!lua_isstring (o)) - { - lua_error ("incorrect argument to function 'readfrom`"); - lua_pushnumber (0); - } - else - { - FILE *fp = fopen (lua_getstring(o),"r"); + char *s = lua_check_string(1, "readfrom"); + FILE *fp = (*s == '|') ? popen(s+1, "r") : fopen(s, "r"); if (fp == NULL) - { - lua_pushnumber (0); - } + lua_pushnil(); else { - if (in != stdin) fclose (in); + closeread(); in = fp; lua_pushnumber (1); } - } } } @@ -69,41 +86,27 @@ static void io_readfrom (void) ** status = writeto (filename) ** where: ** status = 1 -> success -** status = 0 -> error +** status = nil -> error */ static void io_writeto (void) { - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) /* restore standart output */ + if (lua_getparam (1) == LUA_NOOBJECT) /* restore standart output */ { - if (out != stdout) - { - fclose (out); - out = stdout; - } + closewrite(); lua_pushnumber (1); } else { - if (!lua_isstring (o)) - { - lua_error ("incorrect argument to function 'writeto`"); - lua_pushnumber (0); - } - else - { - FILE *fp = fopen (lua_getstring(o),"w"); + char *s = lua_check_string(1, "writeto"); + FILE *fp = (*s == '|') ? popen(s+1,"w") : fopen(s,"w"); if (fp == NULL) - { - lua_pushnumber (0); - } + lua_pushnil(); else { - if (out != stdout) fclose (out); + closewrite(); out = fp; lua_pushnumber (1); } - } } } @@ -115,50 +118,90 @@ static void io_writeto (void) ** where: ** status = 2 -> success (already exist) ** status = 1 -> success (new file) -** status = 0 -> error +** status = nil -> error */ static void io_appendto (void) { - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) /* restore standart output */ + char *s = lua_check_string(1, "appendto"); + struct stat st; + int r = (stat(s, &st) == -1) ? 1 : 2; + FILE *fp = fopen (s, "a"); + if (fp == NULL) + lua_pushnil(); + else { - if (out != stdout) + if (out != stdout) fclose (out); + out = fp; + lua_pushnumber (r); + } +} + + +static char getformat (char *f, int *just, int *m, int *n) +{ + int t; + switch (*f++) { - fclose (out); - out = stdout; + case 's': case 'S': + t = 's'; + break; + case 'f': case 'F': case 'g': case 'G': case 'e': case 'E': + t = 'f'; + break; + case 'i': case 'I': + t = 'i'; + break; + default: + t = 0; /* to avoid compiler warnings */ + lua_arg_error("read/write (format)"); } - lua_pushnumber (1); - } - else - { - if (!lua_isstring (o)) + *just = (*f == '<' || *f == '>' || *f == '|') ? *f++ : '>'; + if (isdigit(*f)) { - lua_error ("incorrect argument to function 'appendto`"); - lua_pushnumber (0); + *m = 0; + while (isdigit(*f)) + *m = *m*10 + (*f++ - '0'); } else + *m = -1; + if (*f == '.') { - int r; - FILE *fp; - struct stat st; - if (stat(lua_getstring(o), &st) == -1) r = 1; - else r = 2; - fp = fopen (lua_getstring(o),"a"); - if (fp == NULL) - { - lua_pushnumber (0); - } - else - { - if (out != stdout) fclose (out); - out = fp; - lua_pushnumber (r); - } + f++; /* skip point */ + *n = 0; + while (isdigit(*f)) + *n = *n*10 + (*f++ - '0'); } - } + else + *n = -1; + return t; } +static char *add_char (int c) +{ + static char *buff = NULL; + static int max = 0; + static int n = 0; + if (n >= max) + { + if (max == 0) + { + max = 100; + buff = (char *)malloc(max); + } + else + { + max *= 2; + buff = (char *)realloc(buff, max); + } + if (buff == NULL) + lua_error("memory overflow"); + } + buff[n++] = c; + if (c == 0) + n = 0; /* prepare for next string */ + return buff; +} /* ** Read a variable. On error put nil on stack. @@ -174,138 +217,105 @@ static void io_appendto (void) ** Estes especificadores podem vir seguidos de numero que representa ** o numero de campos a serem lidos. */ -static void io_read (void) + +static int read_until_char (int del) +{ + int c; + while((c = fgetc(in)) != EOF && c != del) + add_char(c); + return c; +} + +static int read_until_blank (void) +{ + int c; + while((c = fgetc(in)) != EOF && !isspace(c)) + add_char(c); + return c; +} + +static void read_m (int m) +{ + int c; + while (m-- && (c = fgetc(in)) != EOF) + add_char(c); +} + + +static void read_free (void) { - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT || !lua_isstring(o)) /* free format */ - { int c; - char s[256]; while (isspace(c=fgetc(in))) ; - if (c == '\"') + if (c == EOF) { - int n=0; - while((c = fgetc(in)) != '\"') - { - if (c == EOF) - { - lua_pushnil (); - return; - } - s[n++] = c; - } - s[n] = 0; + lua_pushnil(); + return; } - else if (c == '\'') - { - int n=0; - while((c = fgetc(in)) != '\'') - { + if (c == '\"' || c == '\'') + { /* string */ + c = read_until_char(c); if (c == EOF) { - lua_pushnil (); - return; + add_char(0); /* to be ready for next time */ + lua_pushnil(); } - s[n++] = c; - } - s[n] = 0; + else + lua_pushstring(add_char(0)); } else { - double d; - ungetc (c, in); - if (fscanf (in, "%s", s) != 1) - { - lua_pushnil (); - return; - } - if (sscanf(s, "%lf %*c", &d) == 1) - { - lua_pushnumber (d); - return; - } - } - lua_pushstring (s); - return; - } - else /* formatted */ - { - char *e = lua_getstring(o); - char t; - int m=0; - while (isspace(*e)) e++; - t = *e++; - while (isdigit(*e)) - m = m*10 + (*e++ - '0'); - - if (m > 0) - { - char f[80]; - char s[256]; - sprintf (f, "%%%ds", m); - if (fgets (s, m, in) == NULL) - { - lua_pushnil(); - return; - } - else - { - if (s[strlen(s)-1] == '\n') - s[strlen(s)-1] = 0; - } - switch (tolower(t)) - { - case 'i': - { - long int l; - sscanf (s, "%ld", &l); - lua_pushnumber(l); - } - break; - case 'f': case 'g': case 'e': - { - float fl; - sscanf (s, "%f", &fl); - lua_pushnumber(fl); - } - break; - default: - lua_pushstring(s); - break; - } + double d; + char dummy; + char *s; + add_char(c); + read_until_blank(); + s = add_char(0); + if (sscanf(s, "%lf %c", &d, &dummy) == 1) + lua_pushnumber(d); + else + lua_pushstring(s); } - else +} + +static void io_read (void) +{ + lua_Object o = lua_getparam (1); + if (o == LUA_NOOBJECT) /* free format */ + read_free(); + else /* formatted */ { - switch (tolower(t)) - { - case 'i': + int m, dummy1, dummy2; + switch (getformat(lua_check_string(1, "read"), &dummy1, &m, &dummy2)) { - long int l; - if (fscanf (in, "%ld", &l) == EOF) - lua_pushnil(); - else lua_pushnumber(l); - } - break; - case 'f': case 'g': case 'e': - { - float f; - if (fscanf (in, "%f", &f) == EOF) - lua_pushnil(); - else lua_pushnumber(f); - } - break; - default: - { - char s[256]; - if (fscanf (in, "%s", s) == EOF) - lua_pushnil(); - else lua_pushstring(s); + case 's': + if (m < 0) + read_until_blank(); + else + read_m(m); + lua_pushstring(add_char(0)); + break; + + case 'i': /* can read as float, since it makes no difference to Lua */ + case 'f': + { + double d; + int result; + if (m < 0) + result = fscanf(in, "%lf", &d); + else + { + read_m(m); + result = sscanf(add_char(0), "%lf", &d); + } + if (result == 1) + lua_pushnumber(d); + else + lua_pushnil(); + break; + } } - break; - } } - } } @@ -314,33 +324,13 @@ static void io_read (void) */ static void io_readuntil (void) { - int n=255,m=0; - int c,d; - char *s; - lua_Object lo = lua_getparam(1); - if (!lua_isstring(lo)) - d = EOF; - else - d = *lua_getstring(lo); - - s = (char *)malloc(n+1); - while((c = fgetc(in)) != EOF && c != d) - { - if (m==n) - { - n *= 2; - s = (char *)realloc(s, n+1); - } - s[m++] = c; - } + int del = *lua_check_string(1, "readuntil"); + int c = read_until_char(del); if (c != EOF) ungetc(c,in); - s[m] = 0; - lua_pushstring(s); - free(s); + lua_pushstring(add_char(0)); } - /* ** Write a variable. On error put 0 on stack, otherwise put 1. ** LUA interface: @@ -367,106 +357,100 @@ static void io_readuntil (void) ** inteiros -> numero minimo de digitos ** string -> nao se aplica */ -static char *buildformat (char *e, lua_Object o) + +static int write_fill (int n, int c) { - static char buffer[2048]; - static char f[80]; - char *string = &buffer[255]; - char *fstart=e, *fspace, *send; - char t, j='r'; - int m=0, n=-1, l; - while (isspace(*e)) e++; - fspace = e; - t = *e++; - if (*e == '<' || *e == '|' || *e == '>') j = *e++; - while (isdigit(*e)) - m = m*10 + (*e++ - '0'); - if (*e == '.') e++; /* skip point */ - while (isdigit(*e)) - if (n < 0) n = (*e++ - '0'); - else n = n*10 + (*e++ - '0'); - - sprintf(f,"%%"); - if (j == '<' || j == '|') sprintf(strchr(f,0),"-"); - if (m > 0) sprintf(strchr(f,0),"%d", m); - if (n >= 0) sprintf(strchr(f,0),".%d", n); - switch (t) - { - case 'i': case 'I': t = 'd'; - sprintf(strchr(f,0), "%c", t); - sprintf (string, f, (long int)lua_getnumber(o)); - break; - case 'f': case 'g': case 'e': case 'G': case 'E': - sprintf(strchr(f,0), "%c", t); - sprintf (string, f, (float)lua_getnumber(o)); - break; - case 'F': t = 'f'; - sprintf(strchr(f,0), "%c", t); - sprintf (string, f, (float)lua_getnumber(o)); - break; - case 's': case 'S': t = 's'; - sprintf(strchr(f,0), "%c", t); - sprintf (string, f, lua_getstring(o)); - break; - default: return ""; - } - l = strlen(string); - send = string+l; - if (m!=0 && l>m) - { - int i; - for (i=0; i m) + { + write_fill(m, '*'); + return 0; + } + pre = (just == '<') ? 0 : (just == '>') ? m-l : (m-l)/2; + status = write_fill(pre, ' '); + status = status && fprintf(out, "%s", s) >= 0; + status = status && write_fill(m-(l+pre), ' '); + return status; +} + +static int write_float (int just, int m, int n) +{ + char buffer[100]; + lua_Object p = lua_getparam(1); + float number; + if (!lua_isnumber(p)) return 0; + number = lua_getnumber(p); + if (n >= 0) + sprintf(buffer, "%.*f", n, number); + else + sprintf(buffer, "%g", number); + return write_string(buffer, just, m); } + + +static int write_int (int just, int m, int n) +{ + char buffer[100]; + lua_Object p = lua_getparam(1); + int number; + if (!lua_isnumber(p)) return 0; + number = (int)lua_getnumber(p); + if (n >= 0) + sprintf(buffer, "%.*d", n, number); + else + sprintf(buffer, "%d", number); + return write_string(buffer, just, m); +} + + static void io_write (void) { - lua_Object o1 = lua_getparam (1); - lua_Object o2 = lua_getparam (2); - if (o1 == LUA_NOOBJECT) /* new line */ - { - fprintf (out, "\n"); - lua_pushnumber(1); - } - else if (o2 == LUA_NOOBJECT) /* free format */ - { - int status=0; - if (lua_isnumber(o1)) - status = fprintf (out, "%g", lua_getnumber(o1)); - else if (lua_isstring(o1)) - status = fprintf (out, "%s", lua_getstring(o1)); - lua_pushnumber(status); - } - else /* formated */ - { - if (!lua_isstring(o2)) - { - lua_error ("incorrect format to function `write'"); - lua_pushnumber(0); - return; + int status = 0; + if (lua_getparam (2) == LUA_NOOBJECT) /* free format */ + { + lua_Object o1 = lua_getparam(1); + if (lua_isnumber(o1)) + status = fprintf (out, "%g", lua_getnumber(o1)) >= 0; + else if (lua_isstring(o1)) + status = fprintf (out, "%s", lua_getstring(o1)) >= 0; } - lua_pushnumber(fprintf (out, "%s", buildformat(lua_getstring(o2),o1))); - } + else /* formated */ + { + int just, m, n; + switch (getformat (lua_check_string(2, "write"), &just, &m, &n)) + { + case 's': + { + lua_Object p = lua_getparam(1); + if (lua_isstring(p)) + status = write_string(lua_getstring(p), just, m); + else + status = 0; + break; + } + case 'f': + status = write_float(just, m, n); + break; + case 'i': + status = write_int(just, m, n); + break; + } + } + if (status) + lua_pushnumber(status); + else + lua_pushnil(); } /* @@ -475,40 +459,18 @@ static void io_write (void) */ static void io_execute (void) { - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT || !lua_isstring (o)) - { - lua_error ("incorrect argument to function 'execute`"); - lua_pushnumber (0); - } - else - { - int res = system(lua_getstring(o)); - lua_pushnumber (res); - } - return; + lua_pushnumber(system(lua_check_string(1, "execute"))); } /* -** Remove a file. -** On error put 0 on stack, otherwise put 1. +** Remove a file. On error return nil. */ static void io_remove (void) { - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT || !lua_isstring (o)) - { - lua_error ("incorrect argument to function 'execute`"); - lua_pushnumber (0); - } - else - { - if (remove(lua_getstring(o)) == 0) + if (remove(lua_check_string(1, "remove")) == 0) lua_pushnumber (1); - else - lua_pushnumber (0); - } - return; + else + lua_pushnil(); } @@ -517,15 +479,9 @@ static void io_remove (void) */ static void io_getenv (void) { - lua_Object s = lua_getparam(1); - if (!lua_isstring(s)) - lua_pushnil(); - else - { - char *env = getenv(lua_getstring(s)); - if (env == NULL) lua_pushnil(); - else lua_pushstring(env); - } + char *env = getenv(lua_check_string(1, "getenv")); + if (env == NULL) lua_pushnil(); + else lua_pushstring(env); } /* @@ -573,7 +529,7 @@ static void io_exit (void) { lua_Object o = lua_getparam(1); if (lua_isstring(o)) - printf("%s\n", lua_getstring(o)); + fprintf(stderr, "%s\n", lua_getstring(o)); exit(1); } @@ -593,6 +549,54 @@ static void io_debug (void) } } + +void lua_printstack (FILE *f) +{ + int level = 0; + lua_Object func; + fprintf(f, "Active Stack:\n"); + while ((func = lua_stackedfunction(level++)) != LUA_NOOBJECT) + { + char *name; + int currentline; + fprintf(f, "\t"); + switch (*getobjname(func, &name)) + { + case 'g': + fprintf(f, "function %s", name); + break; + case 'f': + fprintf(f, "fallback %s", name); + break; + default: + { + char *filename; + int linedefined; + lua_funcinfo(func, &filename, &linedefined); + if (linedefined == 0) + fprintf(f, "main of %s", filename); + else if (linedefined < 0) + fprintf(f, "%s", filename); + else + fprintf(f, "function (%s:%d)", filename, linedefined); + } + } + if ((currentline = lua_currentline(func)) > 0) + fprintf(f, " at line %d", currentline); + fprintf(f, "\n"); + } +} + + +static void errorfb (void) +{ + lua_Object o = lua_getparam(1); + char *s = lua_isstring(o) ? lua_getstring(o) : "(no messsage)"; + fprintf(stderr, "lua: %s\n", s); + lua_printstack(stderr); +} + + /* ** Open io library */ @@ -612,4 +616,7 @@ void iolib_open (void) lua_register ("beep", io_beep); lua_register ("exit", io_exit); lua_register ("debug", io_debug); + lua_register ("print_stack", errorfb); + lua_setfallback("error", errorfb); } + diff --git a/clients/lib/mathlib.c b/clients/lib/mathlib.c dissimilarity index 61% index ca5ab78..3f1e57f 100644 --- a/clients/lib/mathlib.c +++ b/clients/lib/mathlib.c @@ -1,315 +1,212 @@ -/* -** mathlib.c -** Mathematics library to LUA -*/ - -char *rcs_mathlib="$Id: mathlib.c,v 1.9 1995/02/06 19:36:43 roberto Exp $"; - -#include /* NULL */ -#include - -#include "lualib.h" -#include "lua.h" - -#define PI 3.14159265358979323846 -#define TODEGREE(a) ((a)*180.0/PI) -#define TORAD(a) ((a)*PI/180.0) - -static void math_abs (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `abs'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `abs'"); - d = lua_getnumber(o); - if (d < 0) d = -d; - lua_pushnumber (d); -} - - -static void math_sin (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `sin'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `sin'"); - d = lua_getnumber(o); - lua_pushnumber (sin(TORAD(d))); -} - - - -static void math_cos (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `cos'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `cos'"); - d = lua_getnumber(o); - lua_pushnumber (cos(TORAD(d))); -} - - - -static void math_tan (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `tan'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `tan'"); - d = lua_getnumber(o); - lua_pushnumber (tan(TORAD(d))); -} - - -static void math_asin (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `asin'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `asin'"); - d = lua_getnumber(o); - lua_pushnumber (TODEGREE(asin(d))); -} - - -static void math_acos (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `acos'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `acos'"); - d = lua_getnumber(o); - lua_pushnumber (TODEGREE(acos(d))); -} - - - -static void math_atan (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `atan'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `atan'"); - d = lua_getnumber(o); - lua_pushnumber (TODEGREE(atan(d))); -} - - -static void math_ceil (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `ceil'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `ceil'"); - d = lua_getnumber(o); - lua_pushnumber (ceil(d)); -} - - -static void math_floor (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `floor'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `floor'"); - d = lua_getnumber(o); - lua_pushnumber (floor(d)); -} - -static void math_mod (void) -{ - int d1, d2; - lua_Object o1 = lua_getparam (1); - lua_Object o2 = lua_getparam (2); - if (!lua_isnumber(o1) || !lua_isnumber(o2)) - lua_error ("incorrect arguments to function `mod'"); - d1 = (int) lua_getnumber(o1); - d2 = (int) lua_getnumber(o2); - lua_pushnumber (d1%d2); -} - - -static void math_sqrt (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `sqrt'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `sqrt'"); - d = lua_getnumber(o); - lua_pushnumber (sqrt(d)); -} - -static int old_pow; - -static void math_pow (void) -{ - lua_Object o1 = lua_getparam (1); - lua_Object o2 = lua_getparam (2); - lua_Object op = lua_getparam(3); - if (!lua_isnumber(o1) || !lua_isnumber(o2) || *(lua_getstring(op)) != 'p') - { - lua_Object old = lua_getlocked(old_pow); - lua_pushobject(o1); - lua_pushobject(o2); - lua_pushobject(op); - if (lua_callfunction(old) != 0) - lua_error(NULL); - } - else - { - double d1 = lua_getnumber(o1); - double d2 = lua_getnumber(o2); - lua_pushnumber (pow(d1,d2)); - } -} - -static void math_min (void) -{ - int i=1; - double d, dmin; - lua_Object o; - if ((o = lua_getparam(i++)) == LUA_NOOBJECT) - lua_error ("too few arguments to function `min'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `min'"); - dmin = lua_getnumber (o); - while ((o = lua_getparam(i++)) != LUA_NOOBJECT) - { - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `min'"); - d = lua_getnumber (o); - if (d < dmin) dmin = d; - } - lua_pushnumber (dmin); -} - - -static void math_max (void) -{ - int i=1; - double d, dmax; - lua_Object o; - if ((o = lua_getparam(i++)) == LUA_NOOBJECT) - lua_error ("too few arguments to function `max'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `max'"); - dmax = lua_getnumber (o); - while ((o = lua_getparam(i++)) != LUA_NOOBJECT) - { - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `max'"); - d = lua_getnumber (o); - if (d > dmax) dmax = d; - } - lua_pushnumber (dmax); -} - - -static void math_log (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `log'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `log'"); - d = lua_getnumber(o); - lua_pushnumber (log(d)); -} - - -static void math_log10 (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `log10'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `log10'"); - d = lua_getnumber(o); - lua_pushnumber (log10(d)); -} - - -static void math_exp (void) -{ - double d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `exp'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `exp'"); - d = lua_getnumber(o); - lua_pushnumber (exp(d)); -} - -static void math_deg (void) -{ - float d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `deg'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `deg'"); - d = lua_getnumber(o); - lua_pushnumber (d*180./PI); -} - -static void math_rad (void) -{ - float d; - lua_Object o = lua_getparam (1); - if (o == LUA_NOOBJECT) - lua_error ("too few arguments to function `rad'"); - if (!lua_isnumber(o)) - lua_error ("incorrect arguments to function `rad'"); - d = lua_getnumber(o); - lua_pushnumber (d/180.*PI); -} - -/* -** Open math library -*/ -void mathlib_open (void) -{ - lua_register ("abs", math_abs); - lua_register ("sin", math_sin); - lua_register ("cos", math_cos); - lua_register ("tan", math_tan); - lua_register ("asin", math_asin); - lua_register ("acos", math_acos); - lua_register ("atan", math_atan); - lua_register ("ceil", math_ceil); - lua_register ("floor", math_floor); - lua_register ("mod", math_mod); - lua_register ("sqrt", math_sqrt); - lua_register ("min", math_min); - lua_register ("max", math_max); - lua_register ("log", math_log); - lua_register ("log10", math_log10); - lua_register ("exp", math_exp); - lua_register ("deg", math_deg); - lua_register ("rad", math_rad); - old_pow = lua_lockobject(lua_setfallback("arith", math_pow)); -} +/* +** mathlib.c +** Mathematics library to LUA +*/ + +char *rcs_mathlib="$Id: mathlib.c,v 1.13 1995/11/10 17:54:31 roberto Exp $"; + +#include /* NULL */ +#include + +#include "lualib.h" +#include "lua.h" + +#ifndef PI +#define PI 3.14159265358979323846 +#endif +#define TODEGREE(a) ((a)*180.0/PI) +#define TORAD(a) ((a)*PI/180.0) + +static void math_abs (void) +{ + double d = lua_check_number(1, "abs"); + if (d < 0) d = -d; + lua_pushnumber (d); +} + + +static void math_sin (void) +{ + double d = lua_check_number(1, "sin"); + lua_pushnumber (sin(TORAD(d))); +} + + + +static void math_cos (void) +{ + double d = lua_check_number(1, "cos"); + lua_pushnumber (cos(TORAD(d))); +} + + + +static void math_tan (void) +{ + double d = lua_check_number(1, "tan"); + lua_pushnumber (tan(TORAD(d))); +} + + +static void math_asin (void) +{ + double d = lua_check_number(1, "asin"); + lua_pushnumber (TODEGREE(asin(d))); +} + + +static void math_acos (void) +{ + double d = lua_check_number(1, "acos"); + lua_pushnumber (TODEGREE(acos(d))); +} + + +static void math_atan (void) +{ + double d = lua_check_number(1, "atan"); + lua_pushnumber (TODEGREE(atan(d))); +} + + +static void math_atan2 (void) +{ + double d1 = lua_check_number(1, "atan2"); + double d2 = lua_check_number(2, "atan2"); + lua_pushnumber (TODEGREE(atan2(d1, d2))); +} + + +static void math_ceil (void) +{ + double d = lua_check_number(1, "ceil"); + lua_pushnumber (ceil(d)); +} + + +static void math_floor (void) +{ + double d = lua_check_number(1, "floor"); + lua_pushnumber (floor(d)); +} + +static void math_mod (void) +{ + int d1 = (int)lua_check_number(1, "mod"); + int d2 = (int)lua_check_number(2, "mod"); + lua_pushnumber (d1%d2); +} + + +static void math_sqrt (void) +{ + double d = lua_check_number(1, "sqrt"); + lua_pushnumber (sqrt(d)); +} + +static int old_pow; + +static void math_pow (void) +{ + lua_Object o1 = lua_getparam (1); + lua_Object o2 = lua_getparam (2); + lua_Object op = lua_getparam(3); + if (!lua_isnumber(o1) || !lua_isnumber(o2) || *(lua_getstring(op)) != 'p') + { + lua_Object old = lua_getlocked(old_pow); + lua_pushobject(o1); + lua_pushobject(o2); + lua_pushobject(op); + if (lua_callfunction(old) != 0) + lua_error(NULL); + } + else + { + double d1 = lua_getnumber(o1); + double d2 = lua_getnumber(o2); + lua_pushnumber (pow(d1,d2)); + } +} + +static void math_min (void) +{ + int i=1; + double dmin = lua_check_number(i, "min"); + while (lua_getparam(++i) != LUA_NOOBJECT) + { + double d = lua_check_number(i, "min"); + if (d < dmin) dmin = d; + } + lua_pushnumber (dmin); +} + +static void math_max (void) +{ + int i=1; + double dmax = lua_check_number(i, "max"); + while (lua_getparam(++i) != LUA_NOOBJECT) + { + double d = lua_check_number(i, "max"); + if (d > dmax) dmax = d; + } + lua_pushnumber (dmax); +} + +static void math_log (void) +{ + double d = lua_check_number(1, "log"); + lua_pushnumber (log(d)); +} + + +static void math_log10 (void) +{ + double d = lua_check_number(1, "log10"); + lua_pushnumber (log10(d)); +} + + +static void math_exp (void) +{ + double d = lua_check_number(1, "exp"); + lua_pushnumber (exp(d)); +} + +static void math_deg (void) +{ + float d = lua_check_number(1, "deg"); + lua_pushnumber (d*180./PI); +} + +static void math_rad (void) +{ + float d = lua_check_number(1, "rad"); + lua_pushnumber (d/180.*PI); +} + +/* +** Open math library +*/ +void mathlib_open (void) +{ + lua_register ("abs", math_abs); + lua_register ("sin", math_sin); + lua_register ("cos", math_cos); + lua_register ("tan", math_tan); + lua_register ("asin", math_asin); + lua_register ("acos", math_acos); + lua_register ("atan", math_atan); + lua_register ("atan2", math_atan2); + lua_register ("ceil", math_ceil); + lua_register ("floor", math_floor); + lua_register ("mod", math_mod); + lua_register ("sqrt", math_sqrt); + lua_register ("min", math_min); + lua_register ("max", math_max); + lua_register ("log", math_log); + lua_register ("log10", math_log10); + lua_register ("exp", math_exp); + lua_register ("deg", math_deg); + lua_register ("rad", math_rad); + old_pow = lua_lockobject(lua_setfallback("arith", math_pow)); +} diff --git a/clients/lib/strlib.c b/clients/lib/strlib.c index 6b92a30..0f37ab8 100644 --- a/clients/lib/strlib.c +++ b/clients/lib/strlib.c @@ -3,9 +3,10 @@ ** String library to LUA */ -char *rcs_strlib="$Id: strlib.c,v 1.12 1995/02/06 19:37:51 roberto Exp $"; +char *rcs_strlib="$Id: strlib.c,v 1.14 1995/11/10 17:54:31 roberto Exp $"; #include +#include #include #include @@ -13,9 +14,31 @@ char *rcs_strlib="$Id: strlib.c,v 1.12 1995/02/06 19:37:51 roberto Exp $"; #include "lualib.h" -static char *newstring (lua_Object o) +void lua_arg_error(char *funcname) +{ + char buff[100]; + sprintf(buff, "incorrect arguments to function `%s'", funcname); + lua_error(buff); +} + +char *lua_check_string (int numArg, char *funcname) +{ + lua_Object o = lua_getparam(numArg); + if (!(lua_isstring(o) || lua_isnumber(o))) + lua_arg_error(funcname); + return lua_getstring(o); +} + +float lua_check_number (int numArg, char *funcname) +{ + lua_Object o = lua_getparam(numArg); + if (!lua_isnumber(o)) + lua_arg_error(funcname); + return lua_getnumber(o); +} + +static char *newstring (char *s) { - char *s = lua_getstring(o); char *ns = (char *)malloc(strlen(s)+1); if (ns == 0) lua_error("not enough memory for new string"); @@ -31,34 +54,17 @@ static char *newstring (lua_Object o) */ static void str_find (void) { - char *s1, *s2, *f; - int init; - lua_Object o1 = lua_getparam (1); - lua_Object o2 = lua_getparam (2); - lua_Object o3 = lua_getparam (3); - lua_Object o4 = lua_getparam (4); - if (!lua_isstring(o1) || !lua_isstring(o2)) - lua_error ("incorrect arguments to function `strfind'"); - if (o3 == LUA_NOOBJECT) - init = 0; - else if (lua_isnumber(o3)) - init = lua_getnumber(o3)-1; - else - { - lua_error ("incorrect arguments to function `strfind'"); - return; /* to avoid warnings */ - } - s1 = lua_getstring(o1); - s2 = lua_getstring(o2); - f = strstr(s1+init,s2); + char *s1 = lua_check_string(1, "strfind"); + char *s2 = lua_check_string(2, "strfind"); + int init = (lua_getparam(3) == LUA_NOOBJECT) ? 0 : + (int)lua_check_number(3, "strfind")-1; + char *f = strstr(s1+init,s2); if (f != NULL) { int pos = f-s1+1; - if (o4 == LUA_NOOBJECT) + if (lua_getparam (4) == LUA_NOOBJECT) lua_pushnumber (pos); - else if (!lua_isnumber(o4)) - lua_error ("incorrect arguments to function `strfind'"); - else if ((int)lua_getnumber(o4) >= pos+strlen(s2)-1) + else if ((int)lua_check_number(4, "strfind") >= pos+strlen(s2)-1) lua_pushnumber (pos); else lua_pushnil(); @@ -74,10 +80,8 @@ static void str_find (void) */ static void str_len (void) { - lua_Object o = lua_getparam (1); - if (!lua_isstring(o)) - lua_error ("incorrect arguments to function `strlen'"); - lua_pushnumber(strlen(lua_getstring(o))); + char *s = lua_check_string(1, "strlen"); + lua_pushnumber(strlen(s)); } @@ -88,48 +92,47 @@ static void str_len (void) */ static void str_sub (void) { - int start, end; - char *s; - lua_Object o1 = lua_getparam (1); - lua_Object o2 = lua_getparam (2); - lua_Object o3 = lua_getparam (3); - if (!lua_isstring(o1) || !lua_isnumber(o2)) - lua_error ("incorrect arguments to function `strsub'"); - if (o3 != LUA_NOOBJECT && !lua_isnumber(o3)) - lua_error ("incorrect third argument to function `strsub'"); - s = newstring(o1); - start = lua_getnumber (o2); - end = o3 == LUA_NOOBJECT ? strlen(s) : lua_getnumber (o3); + char *s = lua_check_string(1, "strsub"); + int start = (int)lua_check_number(2, "strsub"); + int end = (lua_getparam(3) == LUA_NOOBJECT) ? strlen(s) : + (int)lua_check_number(3, "strsub"); if (end < start || start < 1 || end > strlen(s)) lua_pushliteral(""); else { + char temp = s[end]; s[end] = 0; lua_pushstring (&s[start-1]); + s[end] = temp; } - free(s); } /* -** Convert a string to lower case. -** LUA interface: -** lowercase = strlower (string) +** Convert a string according to given function. */ -static void str_lower (void) +typedef int (*strfunc)(int s); +static void str_apply (strfunc f, char *funcname) { char *s, *c; - lua_Object o = lua_getparam (1); - if (!lua_isstring(o)) - lua_error ("incorrect arguments to function `strlower'"); - c = s = newstring(o); + c = s = newstring(lua_check_string(1, funcname)); while (*c != 0) { - *c = tolower(*c); + *c = f(*c); c++; } lua_pushstring(s); free(s); -} +} + +/* +** Convert a string to lower case. +** LUA interface: +** lowercase = strlower (string) +*/ +static void str_lower (void) +{ + str_apply(tolower, "strlower"); +} /* @@ -139,20 +142,40 @@ static void str_lower (void) */ static void str_upper (void) { - char *s, *c; - lua_Object o = lua_getparam (1); - if (!lua_isstring(o)) - lua_error ("incorrect arguments to function `strlower'"); - c = s = newstring(o); - while (*c != 0) - { - *c = toupper(*c); - c++; - } - lua_pushstring(s); - free(s); -} + str_apply(toupper, "strupper"); +} +/* +** get ascii value of a character in a string +*/ +static void str_ascii (void) +{ + char *s = lua_check_string(1, "ascii"); + lua_Object o2 = lua_getparam(2); + int pos; + pos = (o2 == LUA_NOOBJECT) ? 0 : (int)lua_check_number(2, "ascii")-1; + if (pos<0 || pos>=strlen(s)) + lua_arg_error("ascii"); + lua_pushnumber(s[pos]); +} + +/* +** converts one or more integers to chars in a string +*/ +#define maxparams 50 +static void str_int2str (void) +{ + char s[maxparams+1]; + int i = 0; + while (lua_getparam(++i) != LUA_NOOBJECT) + { + if (i > maxparams) + lua_error("too many parameters to function `int2str'"); + s[i-1] = (int)lua_check_number(i, "int2str"); + } + s[i-1] = 0; + lua_pushstring(s); +} /* ** Open string library @@ -164,4 +187,6 @@ void strlib_open (void) lua_register ("strsub", str_sub); lua_register ("strlower", str_lower); lua_register ("strupper", str_upper); + lua_register ("ascii", str_ascii); + lua_register ("int2str", str_int2str); } diff --git a/clients/lua/Makefile b/clients/lua/Makefile index 10538d6..b76dae3 100644 --- a/clients/lua/Makefile +++ b/clients/lua/Makefile @@ -12,6 +12,7 @@ INCS= -I/usr/5include -I$(INC) WARN= -Wall -Wmissing-prototypes -Wshadow -ansi OBJS= lua.o +SRCS= lua.c T=$(BIN)/lua @@ -19,9 +20,14 @@ $T: $(OBJS) $(CC) -o $@ $(OBJS) -L$(LIB) -llua -llualib -lm dynamic: + rm -f $T + make clean: rm -f $T $(OBJS) co: - co -M lua.c + co -f -M $(SRCS) + +klean: clean + rm -f $(SRCS) diff --git a/clients/lua/lua.c b/clients/lua/lua.c index 1983664..33c7adc 100644 --- a/clients/lua/lua.c +++ b/clients/lua/lua.c @@ -3,7 +3,7 @@ ** Linguagem para Usuarios de Aplicacao */ -char *rcs_lua="$Id: lua.c,v 1.4 1995/02/07 16:04:15 lhf Exp $"; +char *rcs_lua="$Id: lua.c,v 1.7 1995/10/31 17:05:35 roberto Exp $"; #include #include @@ -15,6 +15,12 @@ static int lua_argc; static char **lua_argv; /* +** although this function is POSIX, there is no standard header file that +** defines it +*/ +int isatty (int fd); + +/* %F Allow Lua code to access argv strings. %i Receive from Lua the argument number (starting with 1). %o Return to Lua the argument, or nil if it does not exist. @@ -33,6 +39,19 @@ static void lua_getargv (void) } +static void manual_input (void) +{ + if (isatty(fileno(stdin))) + { + char buffer[250]; + while (gets(buffer) != 0) + lua_dostring(buffer); + } + else + lua_dofile(NULL); /* executes stdin as a file */ +} + + int main (int argc, char *argv[]) { int i; @@ -44,26 +63,25 @@ int main (int argc, char *argv[]) lua_register("argv", lua_getargv); if (argc < 2) - { - char buffer[250]; - while (gets(buffer) != 0) - result = lua_dostring(buffer); - } + manual_input(); else { for (i=1; iKR&J?qGIJ(5bY@PNbEaw8 z1i7fF4LzLO@zAIRFII5lf*T+RdM_^AZ=f=W3$EY_UawNUZXn;YyxTc5Nzw27{`ums zn9RKE^FHshKhOKe_PuVn<&gygZSa%&W#`dDZmHy!j~=n#cC=gdC#wF@ean_D$u8{A zE4kQ|uGrWVv7u}USU zJQl99%41b)%nnyot*}4aH?`x);uBl&Cph@`NA5o1ZJ)Sc-?n+M4*W->_dk81JGynv zlwI-N>D2Rg4%?NgXBC~2m)rKq%6PcBw(rA#T2*zfjLxyk73Yeo9p&xlEN850I~6Db_Tby%xH~nqgL-e+{rb23?y}9QJ*{-%e_S1;F1l#- zMMJ$8Iyn6Nwl*C8-RIr5`=}p1f669vc;D|^_*lgq#cgGZjz6mbS0`W_b6JZ+Nlu zt>#RloB9@hV{p{-D^|{*+VR@c+qVRVy?fh#zzNjafA&Vl3$1c!Z}RQ3=eXr?!Z@v> zJgvO#Ib&rzANp=My7lZM?6B&=Ul#NYb8dOwShZsL*jx6Px&sc7<|(+9TI%$xtn&8z zp4%)(2fVQSux#6TFLcXxHb`Io)W|q2CGW!MxoXKSM?TJ)t2i{D7jBH~3M~+@Mq(Bs zkr=Ue>UNqA*Ii46gKFtkIZtf|R}TlNu#YCTibWTeGwFp6%wr>9aAcavk0vAAE}LU} zG>GGS;kfJh;gFb0d<%=e;%mcx4UXO_dMdBwtoxk201$(P%{m504q6)W`Y z3M>i#%(*2u-dUdOVZmRgmgTOEELZH?F4fY{{1@JExNH>(BrAl!aPv9GLxc%oHQ8XF zj;WQfCF5KH?tnyev^Jb6AP}AGwE-^@Pd9Ignbdk}>7V^DZ>y;eo2Dg+E_hNn&M*Pp zt`w{sEnu~59jT_YL_Fn6$?>s|Bl;MPU8Klg`j#Sh2qG61}YeWIM5uZrLK7T>Yot=nmOy2$D8j;Sj$>G%ONmkCF!e&qPkxaCDiMIsmILnQ*JxRnUD0IhtWjaA$QY(4$ui{NCa_2|}fe+UFD zlF*M}crmYobO>=0I@>Vk&cbN8Ia-^QY%!aOR%N4evT+WI14I{QBZKpXz;}aJ4z;s5 z@cgcTu;Pj*0rYZ;tuzHgyy%QpfMH>W%yjyWPfb=FAD{-8FC5B-XV{1|F>I3O0n35= z2Ac}YuGm7^#U0nupIQPW(+V%aL+F$zwLF;f!qtusr&Qb=PQn?wl?`6F`?#0ex|SiKTT zxzf(p0C`&x9k~4C00P7);HESza(CEYSb(c5T?b zb{a0PTPfzlwXpYaZDf!3@Z`7C%#Cs1pICn4iIbC)S*KhuW;zi71|o;+ohYPToH0A@ zmx>_SF7SQm? z)7Cm}T!0tiTxNH0N2czQ%&tCIEY?y3k9%-9wm2qF+&v=f;)c>OS>dj+qDzFpDh8?d zeAh0+EFn$f2Yc=Fd>tsk0~awR7>flK-hu| zw;(PEt_uFZ(Wy_Wi|MdpA^ark5XUs9RB{=og zH|~DpF`b$1<{rGweG8vB2EM)M{TCN@$-C|cbHDY}6PE|6=bzst5hrN-_P$Syk@_u2 z;$V=9#?%69sc1vVA~XhJEb>tll;a^1e#k*`S;=JnsNo6{CR7~ZS19%hJcsU3g)}^PR55K-)DU@a2ayRTZ!BO z21-8bmL{Ac^*?kR#fIEdpFId)+yyv;EMlxtY?Fo z#xw|xNR_-@fsKCuYe1r5mvBGw&b*u@mI0qcv}=1`xD+U$&$1#MeIjB~7g_}nh~&gf z`HyOFi-=#1 zfHJmu0+3c z77w@VszxSUBt@31*5m}0?KSseSI^!Ev%ry!TAq{B3l|)Dd653>4ZDySf&P?Vv8!Ay zjZULjUa4ooU3`D=HwkY&>8g1-K%xi~U@ZlS71)i&m|k5X4BqT`QnZ0yBkMB7hUt zQK`ZmkOUi+YzqYjc@}3O5=p$RrR+6$CP3$q4k4F9iqZ=_$@4S>qyN?A8-JY$Opv4!)~VeQV)>AQBN(k_9VRpLoX(=(-is4FNX%i4f0W?8@EWWw5MS#Kje!N z#nBzPS)6Zw?;K4*_$mmZhytzed&?D~0d{FoN5iH` zA=IPYv?Y`~#fD&Ij>l`sYe&G7)}=!+4=kGxU{n%6Z_pdEyC3{-vA^`s;N11N$Pgtd>Ga zGJ-d)!`06U^88!2=ou+g{?8sb1%_9J5f zzFSLu`Eir1A=`J#h-`9?LF(&w!fHaYv3r}Dvbn|3XJS!yA za}(?mL9JcfCvC`RSXmsrmiqC7b(p}kRKS>HR)yr@hPAE}n{}=ShSc%?AJR^kvy%Wx zupssf#MU1tImM%vXV^Il_M+*Bm=_3nEuD2pBuo-;IJec8GuGkmagMlvs|Ew^Sp5aU z0Tx*b8~*Y__of~q9I%nd+=iI8zy^hepDlFznN2-);zwxe947+FFjspB8-=h=oRQcr zEvey$b>s%fy?{d7#X=}p7;OgK8PFd@MRB9hBlFeWY?0&>vKX^`l8Kz0&8*26!W(cn zZLvjkd*V=}M0iy+hyb>y-4GYC;C5jf2_%WpjFr==-scd{YpMOeQjtzlPl(MZzJFrp zU|dmC`v~P`HDg0l!6e*KxJ+IEBWf*M%&MoTrH_9BXOX7BRr5$XWpNNm%4TWg-T;`* z_Qr{bZMwmn4W)D89=j+sR;aT8QVDLaFKCHYV5OLdraCsvQ47*X@wN|yaiX^b$sYFD zvCq3FZ)$5R6xu%X&DxIFtg53Mc-~bH?0Bhn#qRX|gVvpGb5L;;YTrqBgW4Ayu+!T8 zTKBW>`&!#R@cBOCyJZgz0yjTogv6OlxclI{?%Dd7YSDqJ-?E1byAOHr^5A~+W8Yc! zh&A2z`DG7}g%7d7vM?k~6c+!86+P4igk&B5vR=qDKnq-QJ%HHsh!sABaDBJ{Egl}* zf(yU&~f7e>E+kXq&geJ zkpIaIDbpw4;-b9?xR;`Yn^@Gc(HaVu)e}|)fZh=o-Y7g<3%~O8dAF%(0k%=}KeIU7 zHx(TIi(nND2(%?gU)MI|mbcy32FxB*4$!A=60qY5mf;sMiv8>zK> zxRABf{QpIRNxL1{$3fx4{zxQ7nAW1#8gwse5h0HgE+>#W;HILo-g~65_~SL_^-0H< zqgTIt>MpVvFZ}8I8mQcNUh`7k4SHW*Z5IIm_#dYb9QwCAZI+^-nKFxXJp6I^4w@ES zgzbVaT?hg|(7j?OOeosA75p3cAdrI^jKZ`ltd@O;I-o^>wGmWu=M!#_B`LN+hA3#I zHjHcwY2SA@L~uOIu_G@2+7-2Z-!XE^ityAG;VHEPPyO4e;ffX0@X?Aen~hEgd&A?y z6UDNQ!|%Jpp75&hns8mXJ{$-$VOB0-m4i;;VlDOj$K}lWi1T*QL4R>x7%oee4{{Z) z68^)Mo4i{^E_Fo}R*T%@uV0kD7sWn(WrG{)Ejk+z!D^{X-U%1MVv&yxAIKmYU6+)* zK%Go&7=~Z{E|!Yn*Gd=K&K^Al1AbU0^n9!06BbUA=IvH}l!%obiI7Qhe{wqTO2;+?daHPH2R%1TuSb=0ol-Kw?MzkzC@V6C2M){^=PBnHu)9}qyWE(*ms#lD$<8nihv4X!4&M-$&<#*D+|T4A~rM;#vEra zZ7i+<1}@Hq*~Q3+mfF3G!t5fuuYc+;MOJ`-^b-LYa<^XAW><2kF~$i-I<*iay6tFM zLfwO+Jglnk0%CyRg9k37RZwF1{lFm72%yRSIIwnTVX6+HH35uNXj<~j;J?cJg3$wQ zBQPkdc@;lGxh3M3k?%%U1cxTYcEFiq-b*(roTTr^ZQ-S=pj{Q&<guI!S=abxw) z7(Rp^9eqw(6II|3;A-Bgz#Yd(4s{`37z#>^7fy zQ0U?8JRve%5@KIWrtSEV)EE32tapY3B1nDVKwrfw30UM^;^ejT3&_yI4P^pEIF5#c z60u0bP-Mt8lTNWHmInI#DbK(e7=4s54D3rpU`Q*1);4RYi@%9C(058UGTU0}tWOrv zz^h3EPKrJ-Exqot2!u9i>%m^fe7p{_`o-S_#6=Q_LuDeCs-%IZXqU(QakxJZ{b9Jk za58nOJNF?O&#51?P$hfD(tD_C%wH3Eec|Ju(AI>RpAvV$Yf~9 zRV!p}0l~lMJ3w>gmQAGvZ$Zr8K^mQjwTlUB*GTg}AZ=0vOCRD*xfrpN9I#3YZA`+RpWFfl!vNrJ`b`df2Nf5DfOn#q zw3_3%BitHLdjtmtE7@XuLHfzI^W1W8^8%rJa!yvnq@skZ35Rz{PTW~QRSE`kdJW`zO)I2m zQpYzKq|(oh@*3eJHq=rb`#K!<Z^IDQ7M>8QK>J3iLEh6pQ@wyeLZSDAT_6x#K2y4Y_pW86CC0KlFKn}sT z^nH~bf*=7t@8zc3K3sibEUd5FMfN;EH!l~}*8`OIyY*HW=Ew)0-{s}v{p;(x2D;XB z#O~`>q-aS*kkR&W^$Rf*52(r>)6yH4T9Py;_DuenxGW_M9z;Qm*5t(%ClGDW6p|Sf z;4tu5Mk+EGvAx)J@~n`d@N$WHmB>Z_D+C$W&UXU8t^lF}AQ$}lC<7<@2`9AmVyEv* zrxnWc>AkeYYH9WjBrGN*gmod6vLK-K zBGFSuPj~}CI-2j<_S9XHFbR^57y=SpwmEVEjt|Z?^Zu=LzC-VLbQfBEW6=k6Rax64 zt29DN=*G(QgORJPnMH=bBU!Z=x0TMm4uNO&u62x`ePO+8eV4JaHCI$YIGIk}|Ke!H z$^m8B5Zb;6zz~*x&`-#84swkzd}D{bbGQ&SVC1MSoOIAcey@EDaDTt_G^#IXjE;os zA{q@h3o?WEJ$=>v`cCW93&(8V#5X`C#%_?R)<1o|66dGW_sqvuM&xa{3xo^ldXW(< z8S;Usc`G(hn$kg9It7j7%ZqU!y#hc9+#>4mo8C)bMe=jKV*1h&2@0YCp+DJu<qc!&WVVzw*j*k@xCa*eS4MVsDm<=OKF&s|9{z&p@n*k}I)v|HDS z4bel9@u2?mOQ2^fWSz7q%S<06Z-95y>!?tUr>D zanh@k zTrj(#daWiRGLC(xx$hH&UBXD%e&JChCOt`(Lu?Y|HXtXeuNMotU0@}5NbHC|Y&DY* z(1@EIG4P_W(hUabQzjdH=(Y4IAI4LWj6$G-q49BOg;t}3Ik(*?^;|;*Em;(vA@yV6 z73!i}6s3zcd`*=?A)9R1VQZ}`9d8pUg3P6zCVz)m*8?p&HyxV5dq&1JsDg_{Cza{kiX$@)K#4oMquTNG|bi z^ol4f;^UDKHEVhC=r6cCA4NzszpCDUY6cUnHR(r6VQY!^oXXh|Ob#t>N)<&kzCdBR6&(0Di07fhPb$H;l)K2Pw84Hs(de{p<1 z2CwCQx3k$}!4r-j%3v@LCCj+a&6-JPOW$#m7Nn%uk3sZ13yH8uLIoYDPJ}~567Mjr z?n}r@WDq53L3$FAmu(PhC>#b6HQtVP&0h+OiXv2G{@-!JzmDU<{`Bh?NQSg&0$|zO z{%aPK{^yu_S9h0WMIhz&bj41vsX6YzU~kQ%#iD7tW^Gzz@6&9JNUWnn&Ybo}-tKwT z5=D#?N1PxCDKZuTpxIH=aWPN_Yx?V8RwcV{7PpDn$d|d&q*YDf+&B~7;_N) zVJNBKC7I}RSz!Q@N?HQx1ASz=1HB?Eq#KZCS8`+`n&WF}_Z|+(a!a693R?-f zU$#?x1khm&N>#W9xWDXSM!?O4cZPks;NFHYDm=AutjPPJ{rK3XP7tvCgNCi)F%AbpUjleLi`Dx*l0!vvvD1u~R z9EReg!r&oNT@1_$8-PA_^3Q-uUF1}#vOT6;f+A{_mf77{QSXW6V0G=o;SeUS%5+ym zG+`V^m&m1$0-8{yB>I0igj)E-u9U8fegVeB{no?lulf;>0^Bxbze?@F~WGRBJ^(7$mEl4O=OE1c{D8ySD2EFh0H-k|YsS@55xLKm-pNJ9(n0JeM||^kDLe@FE@VpcmeC25_XBhzP;x0SAMbo71XJnVX6tgh9&Y+odIv3Z4z38V z>fG4ZnF%{L_QQV{Exsle6Md49Pv`DQGUcB$9-K`+W%oOXa*p6#!Uf^GG5{Bs<-_$7 zE4xN22ZfvQ({+98`3qbz-5v3HzxupC_W2_5`J%<*Q?X_IG7)QAwm12ly`izdBhO-9 zB!5tP8%wY)?5y*Xc=5!uj2Hj@I{MB;3~IaAF&{_F5N6lo?*9&boaiZyVagqzu(=Kj zYj8Nz*=`C~gngM1UBHX3k>q=}bJ*G95Hv)yoA|>%^RvwY$Sq);P)<)K3Vs$+a2Y?1 zL>%>6Q;MX^YQ|0}dt5vsn&TmsH{a5h7Va&<$Y-x0$Zq)9PU!-yaPb?E3 z>N%j_fFgC$pBm)!J$ymk407M9g9b(XQ8#;?Gm-Q-XQY!h6WM+a%M#q}4zuRUnX@z$ z`qfo9dFsWkIuQL9*@{MlJemM%>A7E3Fj5i=C^&n)WV&;YKB7tdm%R)PAQO$F&u1fh zSrhp~S}xP3%$P$r6!st{V<4W4ITU7w2d7=a2D1wUG5&{7j<3XW?Ys?VJI5S*t+)_} zV&%BHODMrA%6pw8^AGZ;xU1zjYIio9RasnHo72(ovh2O{XXG5F_V7yv#U|`0FB^+J z9Q*;Y1~z6**OcEmwh6Y4_7F5$E0a4p%95Mg5?uJ!odghP_!()YU8ii{!CqIrj7&XY zv7LRGnS4CRmpi}wLuFTwcS0{^g6GlniBb_LFSef{bYTjjNf@LP;L!O}h*Eee13~KK zKPx1YK_-TFjaGe*PQmjvFAL!9XMWu}NX3Y!?T*X(i+W(j2kxFn(RCsw{0rw%Mx%@+ zHTg6Xr;3i!HxM6C>ujKDcYKtvORRts1q)XJs$4S*ib0cZYSV-9xOcn~(+iVV6c;8G z7|_~8Y>YiAnHJwa;qa}c|Km8zj8HXV2Ph!cFoxioMPN!2Ob94I`F;Nd*Awp|79~2? z+OND{ixJ90M_O|3QKY`c@wFpvEZ$y1ugE80yz-cTKb(eu`hLO8cV{3 zpdePtGtWmnf1+r~+(@o@r+}-7p_s5cUSJC}@%A6zs5Ik9n6=z;uaET>kw`Z1!qfqT zsl5+#sCL1OYXz|`J^jnXTIEiGqYqBcuxLEnakrRn5$Yax>o68vZ@9j~Bomo|if)r`=hKDK$al7q0bKfXC zf&~&{HF9DiR0B6#mq}==VF*P=3E6UJC1@Sd=Vh9msyK~e5oU(RR6G)8BG6!+ipQ09 z;flIua!4DXzEIG))J?mQpQ-2vUEo&4>4f!IY;g;MictZh!v$?76|u)80}C+Q98gMl zX(W$u7LSU*aRejBQ;yR(nLtf&D!ZyWhyeWv7oS;p0P_;gXL6d16B@l?AySwEMs@ZV z6{9i=cE|*G@(IKXWQbikbZLx~`{YUe9T&zF5C7ilV<;kK%tVo`%)$!>O&V%qkox@P zg|J(SejpdZullg$m^15MqD6d2P@)h+iiJ!#3=$=Bs1Od=);0@?DXW=s zMF2)-9svr5r$90}{PjT5-Z`d!E&EH ziIn`acE?PDrNB7$ivq^=p7~mdajAvA#5np|xMCgeRiIjhJ`>(E0|{iv18mK}qFU<3 zKQ<#$$7EY;MEbkV|Moqf{~JDc5TAe1M>aC%gX9~I+2)z2f8zWdXKny0e&%~m{k+wg zYoPGqOT#7~`(1}_I!qmu@YTUdExPDhMH@C8AQG|Tj>_g!YH=dL+!MYZztIBbV*irF zlrcptHI}HphFMbY8P?j{s{>Emn<|TWWyOpmd{{Hwj8H>nrveKZ8wr0O{ECE1`{iUy zv}a`rM@0C2O6~a=uX)d8yW^dz3Czvj^Zr+h3R+jmo~E&1ZBW}tJt-YIEiCIW<>z*_ zx<{T0xk9WFb4nu|Ym7vH$QIe+Cd~rJW~>>@A?yynzf-~PnW21@$m^I@8O2=J9B?Mq zZUM)yuFeD{gI=hFFVPhxF6cQZ%hTdfTA~j22Y-*{2^3AG_AbWFJD#}#CGk3DNEQ)> zApN~B=wc5>w*=|;v6#cgf0}W3AW(jMt>f#m3i6E&nsW>_Em#Gm^L~7-#VPbcQkU1k z1LeJ#pH6+?Gb$sQLQlEoKPXLZAu40ReqEL=>gE`P$gPNoX0Hc>mpMvQ>;(4soj=0S zM&f9j5D{zODB&Mttjsf}L&sx2!GBa8^9AdrSVUjz;s`L;mv5Z$kX0~|7Eb8o7_qSH z$hed_#A0L4K&%C#*-Ht-o8S;!z8{_}86uWM?|y+&cj(HebQnPAdNmj*m%dO>HpJop z2)8K3*3$Y*Xh~S!^F6$GTtr&!jO`>`sG5~;y~SGl1IOY54L4jSX#Z7S-gyz^ZPYe749?oRtgWp36jCbgSiKCqer6 zMVGTvSRfIfQkT2g}1tW#-$ z&Y`&PWHlyxs1VpHp{nnWRjKC6u5wmWHQ#VcGbzH#Id6?QPDKIOtyBP(a7y*kL1Ch5 ze|Mu;wJy!O1x&G&26^$BC#pTyQYW86AK`@Tr3Ll&9`%tj%Jz_$!A5?x1~GmSFeN-x zCTc8X>E0*FZE3pogo%iI>APd@e^wg624%OTlPmm+RqIG^amrj*$e}6`9hV%cVo9q2 zHiQ-ydJ$Q7gPXbq{cP;h1&m{*?XWav==;3dODi&OU##mWsQP?k9 zUKIyIDIg7qYe1V2y<^dJ?Js{V!5u1aO1LS);5b`} zF9a~U;rXEYSFq6BNADaisQN{zqpssBT6AeS>r<@MC+C=EB&{xmSVD^^)7!Oq?Yk#w z3Re~{h55F=nH+B`sUL9}#owp}7Rudt-mov>ZI(MA>=rBLOG)K-l%ZboM5_g0fa-US ze2S_5vrA;LOMFsh5Y=r_%}YEv7xKGm{1jcX2xj{FGiNM@VZGZS6dYGmD45Fd~+e zTKPRan-SNK1%%1IDMWT{mJ!q9@MHM;871r9`>ri0X1(U7&-Z1gK*HkZ?vT=Od_Qv? zI{tyFI}TlukD^?7-CRa;!yiELA;MjMRU`4Iwc&hJ6ftiG ze-8$!#s);STBFAGqLvb7a?0&iva3}gFcZGi2! zwK2BCmkQfk$etaa-nmLWrAHAZ_^ifO^_~S6^UDNt7JeQ@P~%pK7Z^al(^pH3hSLoN z9iKi%W)8ydJF(__B>hz+eVspw=vh~^7P$l!u-$;cMH?a_@7AbC57g?SgZR)v7?0?n zIv=al!vf^Q(!QCFFFuF+(}g%oHb^X3uCG;M={bXE;KExe?E4-$B6VYu{w-g7 zpNy^4Qcua5Cp0xLr?uWk`C!qzaopw;(76$;wi#kU8+%N##mUzR42)HzV*1seoP-tx;5b z#fJ0(&YUNIFc_rI9T;;tLPC4QHXttoUq->D4}07avK_ECcY;1KH>M&V)T3qWSxKxpsWI z;wbsFVJ-daUo45M0ApBfDI4q^Zs&Ik@Daesb@C)cQpd8*ab&XILA+EkIYA{yPvDIv znE2L4?X*+QL(q+42?iJ~w;}At&lQ!#KLXJR5QCZ!nG~(0Q2!nOse0c+A=d9ZyErd@ zCLWnhtS94_RO_2-JdjC&ik6vY-=#hL;;uQIVNkJ)wuRAlf`y=zOt8g#W2{*oZU$yG*=#!Js z4VGPf$KTNpUtq!4R}gLY0B0d1F;pcx?-QB42JKSO_{zK_SrmtYFAP_7B;gB=`*_h$Aln}M;g>^aNqpJ&9V4Q@#vxeC>_ZSaG^Unl6wZ!A zu?XU-1Ek`ZPeXRGBmym)ZrhnhmFSe zRZACEqg5*?bhn!GkLeZ$>ZCCJ-q9Z;y67!Vg z-AFyPNAED?|EQ7~(KM}elFEKqJ3~%l$ye64)5xK3RBktpi_T+KOta> zSy!RaqrV+VOe-HtYIxX}MSMVR=Ld#qRuSwBx|s#|*)%X+}ul*LKC zKx9;{2PwY&`HyNI0=N%2oB<(-Lg9rJoY3IeB=l-z(TS=z&g3-g7K{W)NjXlajke;} z8H#&L=@pxb(nlmvyo%inSGT82%*6!b_6 zi9sYeB;f%vGWwFnOvp0%ewLC;VMRG4;p{-|%6IBWgCKRqgeu5^5;9S*n52tMP_hB3 z*{FXkQ(}bs(RU{>>qXpU6nOkwk>a6Qn&k88)U`J&&DKaIG{S4+F9b5evHg`5RzbSC z=_zPlo2UxYxT5Kj zo|`I9pM0`>-kx+F{<-=CvuQj<`2fx5kCJtA_uHGem07MEzSPS?;~~-c1m_@I{R8_6 zZyQ%v4%u9R@+AUP1}a zvkgM*gqk-W0XzMT0$7v=C0qa(d8qaMYig2@#o_r|pV@g`4=MvQcy!}R&t<(sB$#B-JrCwx}qWs*a z(6dyueNkq}#u|QI@5A3UP3CGZBuB+WdYp+6T!f1Ap>b_pSDY$&&2dOHAz;;wcP?m6 zlThPCole*SZf{ARSzew|ir#U=5xbPllb<#@*R;x~+2)Kk?nm0NPgB(k(r)Nocmjc0 zep%!!3u6$DqiS?#D3(+xE-^;BTo4umZun-EVEsH6X(Wn+Y_uvd)3UKHHcy!vml2&m zBlOwW)WU`(-&S_K)=M@|h^7|HjWN8~a_4s$#Y2b}B~V1aFqjWFIu^}4xOzAnju;D= z6=Ys@6n$J1zT#aPQd|NKkF}P%@?UgV3)wGa04C|!GD;IL^M<$K2WC(RKvI0k;i6k96R@l& zChbZ(z~WI3Sn3XSH(fbTRm_t&T|F5=&k0PxMHqENnK)5%SKv^n-k6fxhLg!8gf3w; z;z~p+aly{dj^`rOF=0fZ3>`+qLeZ6gjVZ%TBNZGh{t&kp8RH;YhR0JQ;{tIwC!a{! zR&H7JijrVUA?KlZgFwD)&E$|GixL!-N;Dg<^l5z1gf%_ybIrHaDI18Fe$zQPg>-Pq z=mEUOp{ug|#1+=KAp7ws0#ufI9>E9!l`)Z`2E>e49KolqxVl~m(`|il40M@{oF##V z6uY85^D0UwbfmXmVWXon!j(~SkN2LHXtw)FF<38+zvYPc=7jBCt2r&-^6VhJ|A#3L zDzuje9lO3>KbO3WkH1BG;Z&&5Djn-&iob^A0}C-%$Ht9gk~BdDXjxxudQ}{0p=1)0 zG{K>6-O8a5#^bV)AU8hMBsC^BxviKHlZb1nn;eqgbmBjsQl!raj|FJn%}ZpeBkOW1 zEtT910`&|CaEa;kQ;W_D-AVxSI8+QarwaATI;);74;4k2kRF!>O6E0TCzZdj);ahP zF_n(+u+}bGE_0#h7AaVW+*eY%Bb3Ez5hosx2)ovz5Ub_k+6&J=@9c2s{4-aE$5RO| zXcLzXSkD+RzSELKcZ?BtcUql2Jp*X+<5}o3GVzZMKJx%hivgI%s{wdDoNSn6YTZdM zhld#Sy+s-`OQwU4C7zLD* zB~00b@Ct@Z(F8vc7^?IEGu|7HoH-I;C~!x0E2oF6@?3wn3@q?ugV^B4A z^8f1e1;@hZfPehJjkL)n;%T!X5dxBCfz`~`pE*Il{lPB^cb&-7=jabiyx-1=_cDY+ zIP@AE+d!gyL&hx#mqMgsNF+%VSDhj=+VAD&j99cO~}XTO3i&1io&#;Q=#klGdDQ!Vw_HdDx5C2R!1cVfBVOS1hvfaHza02q0P zu#8gBGLe(DvmE|p1|e@11sGy<6&rwJ)^-iEzv=W**E)VJJ@>3QsopALH|^2{=*3t7 zjeY$h`jx`<@EZ{2%C2~Oc2zZAKSaz(s84S{#iTfpVaiPm(_pj&bjd&s4;Fq+K0+P4 zB09&F46er0qVp_15BZfIg`-*?&T4))V^mAW{-uR*Jda-1BCsV${pT$zwk2wgZ3#NM zmzaWt03A}Z)V0sFdN`pwZtjsU(Tmk3AC&AdBtD^iM}`xeW#Cx_UcT}qry@Mjg1}dc#Uryw+MJmHhQaU++K^` z1V@!2)&U)X!XB52CqF1>PGi+YgO{Fn{`qITdF9YZUEw8_39hw&=V)ot6}quT0rBXW zy(w1&EX7}0=)hP;%=O*)07qJi`mRP+0m=rq9zIxW|Mm;|^-`$_aaAfE(aG)+MzR*+ zoUJ5YZr#mFgNVyC)dmc%^q)~kqvG5JNV37);T58w%utZ_cdC|X93xRoACru$0a@?P zO$p)5QSptdux$OA&#HK79aoMS*Tw5Gbflnf)3^l+|8@=-)=>(pDC{x9=jZ0!e}P%P zwMb8vO^&-N&{j}!BshAinCfV$NPMNxix5M8M~yMCh5o1X3L{NKz#3^!hIpZ}flKva zLtJl5zviZRIW=Xiuyjo}8ZJm58zeG9tZ>NWkUBcjjLHRtLBPUDI)J0S(q#m=aj?lL zk~D9pAN-Rp4nTLgm^aiR!&VM0U6nvmupC+L3aG?3LzarG^hBveei__M7+gPUmb5E^ z>>uR-FPt)kl*lpEkq(yGHKkHghQj6)kQk|iErGbRm0p}N99c`VCuL*SYxzp({5{F2 z{Il&tv(_nEB3|zp!W@{H#2?dQHwL-`rl5qHQb=DC9*JS*Y6^h?LG!hj&S&&JHg6Z4 zvMq5}j@w<%6ngL(`fe!zDtAtIp@&h~Fp+hadwR6o%aWnM`~hU7EE=k>5*J|rMMrT5 z5U((xXgd9l>sSp9ZIA5Gh!t_SJ9=uR_YX)c6PwR{6)r_&MZ$B31ci*xMn^z)=LAG8 zNfWr~Hu9AqDz@}1MseR~Jrm(t!*R4g36r@cec=r>P6K3dvq*r$?&D*fdy>`$D!h`y zQfwLR9XFjf>WpOp9y1~luD)54hcSP+TuT?d` zC{G&v?8Z2nd(WatdR3)PvWF;g)F(X&Nx>OKao{w&+FMB_MoGKb1(NID(X>gD`;Hj)!8C*+ss8Aa-IJ&XdLcT2$#2 zR=^AHZptqPEV=r6!m0~yP{($;H2tv-U25q>fqn^HW*|s^Y>iNQVh>!wc9vlIcHkMS zM50&1;n|EfHkXwl=|NiUV*+yGLd8-Zml($DWY%MX4P#;QcU`9FJlCUJg=qj(B503( z8uTGvyx1zDmu7QF_4eS5$3JTFWD%B(M~JQ;D!cF>ok~_qU3`q>dR&qaAiW{7?TMs^ z%dPq-Qc2ychylzbb4<7Y%e>Lhtzu4;gNNGw*b5HQNDry&E*Xv;)sfI@HvlZ-otJ}L z6N%&{YOS3jQ4t8!HcrSO-=iN35momZFK+M4t8t|iLkpKU?l)_e!rjxTM`ALXN`Ii^T=RE<#7` z8PjJYQ?S(gE47Y;OFlkwnho~pdXY0!x0B?KqsTC4ROu298j+aR;r_-FMsru$#TX=E zJvr+*Cg=hId3qsD38?sNCwmYYacG8heZfQSWu#sUv9qJJd@Yw@nQ@t7UalWmbjwIo z#mZG=1P6qcF*a)(J)ukf0YS=QJL4n7WSwI^yFjF)okZzqt3jn8K8{IgAcB4PK1CoY zFN93P4nDkUA9#As}y$VKE>VORw%{Z*n%`s}ItxCR3yV-Ut2b zxkTJ}BF`8e0EtdH))+hopRKd>8{Mi-BWvrbu*fR;NO{?Kgfybz-pZq@e5akXdn<&cU z1}?aPr=`}WfPy3s^VatJ7wd`rMc!In1oEO}s=WJdd0^^}gMV3TZe6kvgDfi18t3!f zo&$_9=YkN01;%BLT&%ZKo~V*2ihJgo2r(0V-(sQn?7s(vNBrD&_N;o(Ng_{9UA|`h z=MKpUh544Kzsg7x=OC;X-x@NMSEHx|Wy-PI+;Q}uS@gx*>C@E~R$>-54R1Jw{NVL9 zE4g0o4f{HkPEbb#m<)XvCkzrfo9{9*p2SyC?o{VqY)Kq0Zb~H0#kQ1s{PSu{YMqvT zwN4nZTP?NYt#zaP!;H%dQr~%u9%GcI(N^ok_YR2f3CA-#0^%$E!td2e6@3bIN;lez z`9TV@UjZ@XhZ0C)k}+Gaeb?{|#WJXcSR?s=|MoeDDkHM#!ze1?c*^a}1Q0c0>;wRSBWb#arKO0FOO;L%dopO+2W#Q!1*dr=CXK^^H(%vyLh(ols>UNd0;~MXTXC z8znA-)Q>B%&K&BN6G4qwn$0F51Ba1npX=AsXJ_LvC^BY-Fn|h|(zfEEVOU`Fk&`qh z3DWLmu@j)AKzxb?A1Cv8?P6ADqn|v8%KtfLqA0-nH_wfXOT)N84~)>D`)bQ#frLSl zXQ{Yi(g{9w?Jj#G9@cL=Db|AnJ;cm37(JowDbTO6NfXpIu09d$F+&lTSiz$tdDzGf zm+oe=oa%lwW?pkj4xDY1=Zi+cP}0Glp_qgL0zOw#Qt_5J6!vMEp%|n;^Dg{ll@nF~i|-P4%m#C}U%iGmQ6y2*u0i z#-=N?pktPy4dqqj8g7712hCBFCrLI{5K&=x=oxwz4^hk-(@_7>qr~DCOzQ1EkQ4ev zC1LYC+kgFWgW4Eu76r?Mtw4J^;b0Hkg`340M4hwv+l6!iLCy8tGC_u`cgWhsD`gQc z=XxW=$P>faqL4kt!(jOlz=m%G@oW``qt2*xIWGd6cn*3~gM=MeW%X`~WR_Rfs--^h zfh(#GN7d20oOtHmI2**w$nZ}-SDWT6*~Rjm zke7`>e-h$aEY&c$WuV&ga+Ntnso@<+W>kmImls)gqClJoP&0s0~-h%EV^>Ur? zLH5-q9%O(J(@V*+kf2_-tK=L*t|5K}1PoOn;;S-6hNy}e`tkh(NeUAcFq2SEedJJ6 zw+BKX7S8#C+h9mgRsQqF9I`}^dj8`u67`gHa?)<(8HS}#8CR2+oM=d+3%1<_qzZl^ zgyG+LIQU&!T)K!4c5%^xMwhbwci|JzUFKip#O#t87G3qYmt=|177o~xp1?n!I&GGC z9(J435lQEzRu05jJ@Bk?-D7nKRfQfxa^?HeqKtH0%KphJT3YCjm(wB$@dq*+V#}6r z_p$rlHhOB?Yj!W9LQQjWrIORP@bTrfy&8SX!{wlDz4o-f)LFtB_M3gJ24Z?LVy7nA zYbM-C@>%?vXIy>MlqABNQ>ucF?xq_iIiKVvaHZWpjf|_*ga((wH|u<(*(FpJzKIgl z(#OxUVz1GlR3_(g@_Ky1JLil)Zi-HC{zDu|Q6@)wN^*6cDHda?i}Dyh#0GS1!)Y0*s4nW#>3-V0q~%Av;yGvBmgPgNM&v& zV24Ye5qxp9kUnHW4EYBm2=GDWVUF+c)=Buem!1jN;d2P^e;_)oU$0P#OLt=Sk2jrKex)ByhOSIyj`_1z z?~i_2>BWkrX9Eqq|EJ{Y=MT4$LyYtlq|oFPKzKwGq1e1srs&m?^p1BR#99~vEQ;5+ zt%`ayGj3P_JpM+P5MtupBb~sIJi%J}x!<~G&O;fEN{cS^QG=J@(`Iv_Fz#Kuaxh3g z_hBG*mAo#kro-{!4>h-(QYm+EYu(pzE}&1~mjpwi{we&@&IpWwr5xnjX9H$NpwOSIio5VbNVP08^)oXDLe1c=n z^W&?x;#)*O(W|5+@4giC`jD~Aa{;sK zxe5DWV3C|aLp3ivgqlwg0V=QxpedfQ77N5?96ZgnMi?!)Od^v-HjdB>(m<`nKyeXN zzDaxF9%N7PbAM?z5fpX=o6zvNS%cB1^A1{}^}@!cw{NafGkIK(Z`!is zr8!^PJ^$N#y{?}gq{Dw5D9WFF|K_P6{qlawls3XiSFPj;T$_X2(O zz3&F;T4Y}{y>Fz?OvRy(yCu;3H<#S1XPlp4pKxsZUSOOU9MKy;DIRL42yiL*>6+4j z;bU$Yu)&XsR9t<^LPMRfZ}J15Y{p?{rWb?l{@RAvfQ@S!hqJ&34uv>|nJvecxs2XuQQK}ti&z48 zjQzn;(xa~}-u3#7J9uAEuFjEu+MfYhWKNE#PCBqr! zH?|TPa$InkojK@_B=;S_1IRB7sGktlm6_QhX10S*)aAUW3`_GAc|>y%zC(znbVfwj zzk%%{3aAgm6-10a%_#hM9LZX(#I!NoD_RU@@lK|G^@?^8NEf7bP2wYIq94mIq@6jw z4BRz=9o7|GvO&k4A2ZxXQa0viHBuD|+ur8*`DW|oDzqwh8A@kkY z_Ik&4|M&K)4;OFU06*;(BREc>mj3S>NG3;%x`>qm-O5Adqhs(fmf~dYKM+5_a&=n? zD2Z2x?q8C0$-yebYz9CXV`qdZrX02as<9yhs=$~)xtbNM=|cwp-+*<_@nyIq!iwUn z!iVytYpF+f*Ug91;GWmN9p5+=gCd=YU>l0pV^w;ba;!^ffRXo<8)rt|^lkrQz&c3( z=&1iASO;_e*Lch&pkxc>#P65&>ssIuyU;P@h!b#y3PYeia50r1PDe%hv@;*W5eK0maU90ZkqsCp*8D*OqdS zoF(tH*-mps)%7g{2})K4Ywo=7cNAQ3dc=FpS`6N^; z;E62;g``&i4`~x)fW%c6`3CZ9XVp~H&%gh6CY5D=mnsJ!&P;&AEDj^NZY)!Pn@bUO ze&OcEY3s`CCDO9x1(nCsLS2Bxc#pBm>#C*ux4;Iw)^trx1q(O6rta%vBl1`Vj2?wx zuf83s*IC%BZ{u{l7yMr_p892u;Hcii*gNy+yJEdjOQD$hF}osD*9kaR|6bjkMwtx* z@kyqkiHP<$Zc;SvhLaf03ik(dP=vY_iSm4C#v&02V_uQ-gjj3`X{$0f(2YYKT>FcX zT$XGl8@a%NrX4#HZjU>))tY(#M6U=|DaUNstXFRWqdy(+}z_8M(H18=$Z zKwQ(;x`@~vM$?W)6dH+lc-?91*Ok_<%O-BJzPOFkVE(-?`&M0=Z{49<_RISL2j=7X}h8{P69d_KoAJgGBd%sXGoN_=+B_N%iZ($%)h)8vs929tIP%A%<;3QG^ZELOnf z)2Q+yIP#SaS(v_LTV+ALC2q>_TlP8h92S>oL&eOM1LBPCxR50XN^FZBj$}Mle%x4C zmqLLmHZB%Gc#L9p<2Wzoi=#jY5{jA#TKcg`7l#AXkg8 zBZE~~X7?r11>D&~t(mj$RGcQ=eRvVQf$juKA)bD|m#T-z3c(=P0J-H7!uTcc2@q)X z<#<4gkKL8H$SSe&{fLZO5;F>N9Pzde<+=e(=xuvb@Q`oh9<(QsgMW7Y>ukZj&n~67 z`ZaFJ4mxgJuu{0An%;By!dK;cE@Lt@MY^sy$_CMl4T>^W9d?9%t6=W~UmEsfPf?5L z9u8n3J7O4Pxs(h{mO2^TO)>ezJTRf5SOjuH5vnw!%)+y&#x$OjHfGY34~Wo@)rHk% zsfcE#vrgDg!`*#9de`ShsM;a^o0BW~eqaChDTtKvJH9WX=$g2@PGD8o)T2%ZZy6q*BWr|vrF8$ajUC`UknqY!rcJy_(Uw>ON1-`>teLEIb%BRH9GW4MCi zV7vVc`geOU-3EF&u_#=G7&rCTIqStJUxd zEx{4P;#ocDCU$B`Ou~+kB^E$XaZ2nE7uq1#l@p=4V@|m&y(HqD0u|hpgc-6598I_( zO&AqngMCS;D34e%Q|t*>tO&c{e+p1VQK068zBoM0VJk2!yFc}u&BIqRmFD3qJbb0M zd3dJSL41W3X%I-_CT5qAYucazTSaKS!3hAUHX58cs0mS3KzlZb(jM)SyV1T>v~B_0 zQ3e9Kwb5w{yKDl*sNT27`&K&(`+&gq_Vt9>tnuOK34IbnM^%RwGqePn0jOB*DETnn z!L#x#_4C~Yvu36&6;83$TW@Q_I)QMv%Q^GiCRO#!zCoy0BJ+xDXa!|$2O)3Uo7r?G zN0Fv=S$W7J3kVlI#qnfDb~c!M_#)!@f!h_T+AgA zWlPE4sc$~Q5*!eBq<(1eGG3P=`9<(Z0da?3^Fx#rW;UD&L+YrWT5}4wScnM7Hq=p> zElmMFN*9x+2brph4v;dYaxI_Qp&Vr<>hkza5pjr_D6@8VT~hACc7S?h5{3WoTG172 zb18M}j)l`9V%_!n#9LW7j?p9Rj?Jeoi;p~R^MpC#Q6Jsn6vTHxBryImIP`CKlJF+h ziJvKyFM4*YJ%?$AM*G;*$@YBJW9_>-yKwKka0EhU@`7o)gP1+cQll&#Agrux2{Y?0 zhDID@Sof;)bGnww8tCF+w9Nh^zTlE9P5VAHrZ{%C#%}___OP9U7+=BagkTSxh{3W) z#YR_S&&`O_NZLeVgjl(Srl{xoK`AA!?aV_>xLa0XpH97KtMS;^NSsHAb5s|l0u;8A z_j)jb-`Jv|PRomt$Td`1k+fJ$`S2@Md{UY<+zybwUF^NB$UB%^b z8-}ssT#i(kk)_Fa3lTXbZ(`C3j_QX>(G}$s=mj3KMCyq`8Gy(u8{}Xzm9t_nhwVw` zpoW(TKjyg0P065NKCN}goxRF3Q`Zl zi}?4fLt@b3ix$%#vZ;{cbX0P8Cuv`unQ)l1MHOwU8#M}Q?Z0;@%mCph2o%j+jFoe8KoHVj1KV8(gI?eGy(e~&Ego3JxbCYMho!+BFOO68+zd-)d{K- zU;%ULoQAQgAeT8sko0sxEDWmfF+vvRMdw`si*!Wlvio>{5494{ad815Rm-LqSiTVW z=y?MSDg%bwf2lui)HiKa@EFC->cj*->#gA>rZ%F0q@h?FB7gB4$_Jw9V7uzs1d6+r z4<`Rs!mzYe zxCtWkwsNeQZPa?(TU2E=9%Jb4WVA8Lty1BO)%59kuxg=Vib5dWvz29Sb#DSmVtNuY z#IKw=zF>zOBEirX@|1A=HRPg6_MlQZ6Mn4thR{ur%A;|)WbrdN;)rr~HqJb_ZrLE3 z35HCASL}t`_UAUmYU0$|pSz1JbQE4i>oY>Qj1;QY1&ECDsgAG_lFlNIw_ouS`3z#> zM5QcHG)kT!EW0~l6+o{rGVxOQ)hy7(hB!rBP%zz|cs5#SR)~SZ{i4MVhtCQI?OvP- zmw;ZpFcbDJTC5FboFWFiv~OV?!YBPbC34wf=qywA7-i5zqv3X3QH4>7cXN%D zaXVfMuMsy6)Y;Y^>8c0#}7oapYGeE(9ZKw-+l*T*2xZMn&*= zbz)q3cV}#xPP04hEVe7v9cIf-Z0`0*!YWpcC);GDWX`4Q?(0#7k}-l;mWB!`AqDWb z%j*hNjk{}NR*8Q3%FUsBkUGTAFJ5dCK6cz+{RsU1m%`f^CH}c>uVUX`U*7V-l%W@k zq}?P1lB*VRGDPFCCK20ZW#p`&4T?0tUJM_#F|Z^&1E@#9uu0yqAqM5Uq=+Dq0nY-4 zI7>D*3hc@%0mdheS!2S)6kX}b73&FArD zN)r(l%&S#w-M zAkYw?iMqLCPjX9%MTu4et-p=$lF5#UAr*vz{DTRH;pUE` z(Jy{W+lSVc>dYpQa`(}5>%(z{Y$!Vg-IAmxrcuc<{jb{-Ipd$-y3HEZE9E;ITW$R&*phoL{&Z zTave$#S-6j!-73&Yz4TETFPaxfi5A1s>QND7{wI1BwFz(6}w^B7;B_^aSUG!{niy>OX@+r`+)vR}ws8G}OsilbiHT7R zBF}Pck`9D(uQTXCKhXiBKxPAP+?Js2-#&0tTU(*fmh#%Cg7mSs!eI41lLuKF`LI0^ z2LAcOnX?#No*m3>d+&-3fC!VIaE@_8>C|1Z8hq(_Kenp=xLfhKj48gU!4DNu2nEQ5 z;n2$SR15+H~Dti9hX#A%HvcA zNbM-1{a}4kaf%{No76kCKbY3_!gK6$#kryia=g8fb1Ja>c}PY9<;|863}f*77D{ot z4^AvdKa$4yoX+b8Mf}F#RPcsV+J?*KJ6ewIVSPjb&1xzAy%nn^iVaJRX|RX^Mp%ch zy>|=)ra{N3u+@bWIXp*;^iOgVBS_FH<|Jp+1*eRMRz{0XPQzG$g#)Bkp$5h!5oHx9 zj|#{8^0`NL?pNF>U(I23B4GYGg52nQA)ya><}lf*yHGD9wX7K`>Fe5r+f3F(WVNiR z#GbHKQwFJcn2gGZm(mDeY9ZWVGRnqve0*o6 zmj2ie_!XAMRo7rp_OnCSpMYu@qQh>qB~bC{#_8*_+3fmykILy0Hv5F#8s<@*YU!s& z8mC_c{jPz2WpW&{V+UiaFeM9L10WKxovK1`(`>N!*qv)-$W;ss4wkxci&UV+64NO| zZ|WwheU_O{-MmPqNWe)qPRABJH0Soxlh+F3X59xFrqehbQ;?tP$1F#*T}A3S6?~;? z(Jnc6Zu*sp`;7(GQqMmhmpsbuB<9S)J#g^MDiO<@w6jR|w4*#9dR^+}v*PXG>fzZ@ zR8YFYXf`cEX(yMIPk9Nka?J;q;51L*gpp z6_Ix9b7h7&#T7T>M4|9ZVJOrWLu8PcA^W0KBJZ~KX-Lez&O+{5bXW(dEesui0e zPV@X6($pP?znC?AY0p zyrn*>o6JIQE22WG;jV&J4BBo!t2l}oO`!bL_80XwaS&KOynsih7XK>%WuvKKy5a<{(wZ~*Q@ zKz>$l{n9d^h1IdD?ZuN}>ivsBn*38++n;lL-Ehkz3kFbPO#KoC#=XAuxwo|K-FDdS zWoI`2%WpgI>`&9bj$EnIw{-W?H@w*S*0%YuEKz`IbW`8L) zPk7rWF4$LnO2hW=?*7s9r))CoI>7)7cX!cb#-}vdaWA)ZEswQz;L|rA)0x?Be(G(8 zPg~ZD+THn<-(9v@eM(DMxclhRu@7BHAIJeb`1B}VnEsR&b|f!Me@Y8`Jr65B6~i9# z;N`*nZTr9n`|yXpvuyXlcipq~G4n%j^RnHqbwB&Quc;5y(0y6UB>CO@U47NXbJd5~ e@Z{a;`v97 D<01F80007FF000FFF801E07C03C01C07800E07000E0E0 -0070E00070FFFFF0FFFFF0FFFFF0E000007000007000007800703C00701F01F00FFFE003FFC000 -FE0014157D941A>101 D110 D<7F83F0FF8FF87FBFFC03FC3C03F01803E00003C00003C00003800003800003800003 -80000380000380000380000380000380000380007FFF00FFFF007FFF0016157E941A>114 -D<00C00001C00001C00001C00001C00001C00001C0007FFFE0FFFFE0FFFFE001C00001C00001C0 -0001C00001C00001C00001C00001C00001C00001C00001C07001C07001C07001C07000E0E000FF -E0007FC0001F00141C7F9B1A>116 D<7F83FCFFC7FE7F83FC0E00E00E00E00E00E00701C00701 -C00701C003838003838003838001C70001C70001C70000EE0000EE0000EE00007C00007C000038 -0017157F941A>118 D<7FC7F87FCFFC7FC7F80703C003838003C70001EF0000FE00007C000078 -00003800007C0000EE0001EE0001C7000383800783C00F01C07FC7FCFFC7FE7FC7FC17157F941A ->120 D E /Fb 1 122 df<1C02260646064606860C0C0C0C0C0C0C18181818181818380C7007B0 -00300060706070C021801E000F147F8D11>121 D E /Fc 2 121 df<70F8F8F87005057C840D> -58 D<03C1C00C62201034701038F02038F020386040700000700000700000700000E00000E000 -00E00000E02061C040F1C040F1C080E2C080446300383C0014147E931A>120 -D E /Fd 47 121 df<000FF000007FFC0001F80E0003E01F0007C03F000F803F000F803F000F80 -1E000F800C000F8000000F8000000F8000000F800000FFFFFF00FFFFFF000F801F000F801F000F -801F000F801F000F801F000F801F000F801F000F801F000F801F000F801F000F801F000F801F00 -0F801F000F801F000F801F000F801F000F801F000F801F007FF0FFE07FF0FFE01B237FA21F>12 -D<387CFEFEFE7C3807077C8610>46 D<0000180000380000380000700000700000E00000E00000 -E00001C00001C0000380000380000380000700000700000700000E00000E00001C00001C00001C -0000380000380000700000700000700000E00000E00001C00001C00001C0000380000380000700 -000700000700000E00000E00000E00001C00001C0000380000380000380000700000700000E000 -00E00000C0000015317DA41C>I<00180000780001F800FFF800FFF80001F80001F80001F80001 -F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001 -F80001F80001F80001F80001F80001F80001F80001F80001F8007FFFE07FFFE013207C9F1C>49 -D<03FC000FFF003C1FC07007E07C07F0FE03F0FE03F8FE03F8FE01F87C01F83803F80003F80003 -F00003F00007E00007C0000F80001F00003E0000380000700000E01801C0180380180700180E00 -380FFFF01FFFF03FFFF07FFFF0FFFFF0FFFFF015207D9F1C>I<00FE0007FFC00F07E01E03F03F -03F03F81F83F81F83F81F81F03F81F03F00003F00003E00007C0001F8001FE0001FF000007C000 -01F00001F80000FC0000FC3C00FE7E00FEFF00FEFF00FEFF00FEFF00FC7E01FC7801F81E07F00F -FFC001FE0017207E9F1C>I<0000E00001E00003E00003E00007E0000FE0001FE0001FE00037E0 -0077E000E7E001C7E00187E00307E00707E00E07E00C07E01807E03807E07007E0E007E0FFFFFE -FFFFFE0007E00007E00007E00007E00007E00007E00007E000FFFE00FFFE17207E9F1C>I<1000 -201E01E01FFFC01FFF801FFF001FFE001FF8001BC00018000018000018000018000019FC001FFF -001E0FC01807E01803E00003F00003F00003F80003F83803F87C03F8FE03F8FE03F8FC03F0FC03 -F07007E03007C01C1F800FFF0003F80015207D9F1C>I<001F8000FFE003F07007C0F00F01F81F -01F83E01F83E01F87E00F07C00007C0000FC0800FC7FC0FCFFE0FD80F0FF00F8FE007CFE007CFC -007EFC007EFC007EFC007E7C007E7C007E7C007E3C007C3E007C1E00F80F00F00783E003FFC000 -FF0017207E9F1C>I<6000007800007FFFFE7FFFFE7FFFFC7FFFF87FFFF87FFFF0E00060E000C0 -C00180C00300C00300000600000C00001C0000180000380000780000780000F00000F00000F000 -01F00001F00001F00003F00003F00003F00003F00003F00003F00003F00001E00017227DA11C> -I<00FE0003FFC00601E00C00701800701800383800383C00383F00383F80783FE0701FF8E01FFF -C00FFF8007FFC003FFE007FFF01E7FF83C1FFC7807FC7801FEF000FEF0003EF0001EF0001EF000 -1CF8001C7800383C00381F01F00FFFC001FF0017207E9F1C>I<000070000000007000000000F8 -00000000F800000000F800000001FC00000001FC00000003FE00000003FE00000003FE00000006 -FF000000067F0000000E7F8000000C3F8000000C3F800000183FC00000181FC00000381FE00000 -300FE00000300FE00000600FF000006007F00000E007F80000FFFFF80000FFFFF800018001FC00 -018001FC00038001FE00030000FE00030000FE000600007F000600007F00FFE00FFFF8FFE00FFF -F825227EA12A>65 D<0003FE0080001FFF818000FF01E38001F8003F8003E0001F8007C0000F80 -0F800007801F800007803F000003803F000003807F000001807E000001807E00000180FE000000 -00FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE000000007E0000 -00007E000001807F000001803F000001803F000003801F800003000F8000030007C000060003F0 -000C0001F800380000FF00F000001FFFC0000003FE000021227DA128>67 -DIII72 DI76 -DI<0007FC0000003FFF800000FC07E00003F001F80007E0 -00FC000FC0007E001F80003F001F80003F003F00001F803F00001F807F00001FC07E00000FC07E -00000FC0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0 -FE00000FE0FE00000FE07E00000FC07F00001FC07F00001FC03F00001F803F80003F801F80003F -000FC0007E0007E000FC0003F001F80000FC07E000003FFF80000007FC000023227DA12A>79 -DI<01FC0407FF8C1F03FC3C007C -7C003C78001C78001CF8000CF8000CFC000CFC0000FF0000FFE0007FFF007FFFC03FFFF01FFFF8 -0FFFFC03FFFE003FFE0003FF00007F00003F00003FC0001FC0001FC0001FE0001EE0001EF0003C -FC003CFF00F8C7FFE080FF8018227DA11F>83 D<7FFFFFFF807FFFFFFF807E03F80F807803F807 -807003F803806003F80180E003F801C0E003F801C0C003F800C0C003F800C0C003F800C0C003F8 -00C00003F800000003F800000003F800000003F800000003F800000003F800000003F800000003 -F800000003F800000003F800000003F800000003F800000003F800000003F800000003F8000000 -03F800000003F800000003F800000003F800000003F8000003FFFFF80003FFFFF80022227EA127 ->I86 D<07FC001FFF803F07C03F03E03F01E0 -3F01F01E01F00001F00001F0003FF003FDF01FC1F03F01F07E01F0FC01F0FC01F0FC01F0FC01F0 -7E02F07E0CF81FF87F07E03F18167E951B>97 DI<00FF8007FFE00F83F01F03F03E03F07E03F07C01E07C0000FC0000FC -0000FC0000FC0000FC0000FC00007C00007E00007E00003E00301F00600FC0E007FF8000FE0014 -167E9519>I<0001FE000001FE0000003E0000003E0000003E0000003E0000003E0000003E0000 -003E0000003E0000003E0000003E0000003E0001FC3E0007FFBE000F81FE001F007E003E003E00 -7E003E007C003E00FC003E00FC003E00FC003E00FC003E00FC003E00FC003E00FC003E00FC003E -007C003E007C003E003E007E001E00FE000F83BE0007FF3FC001FC3FC01A237EA21F>I<00FE00 -07FF800F87C01E01E03E01F07C00F07C00F8FC00F8FC00F8FFFFF8FFFFF8FC0000FC0000FC0000 -7C00007C00007E00003E00181F00300FC07003FFC000FF0015167E951A>I<03FC1E0FFF7F1F0F -8F3E07CF3C03C07C03E07C03E07C03E07C03E07C03E03C03C03E07C01F0F801FFF0013FC003000 -003000003800003FFF801FFFF00FFFF81FFFFC3800FC70003EF0001EF0001EF0001EF0001E7800 -3C7C007C3F01F80FFFE001FF0018217E951C>103 DI<1C003F007F007F007F003F001C00000000000000000000000000 -0000FF00FF001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F -001F00FFE0FFE00B247EA310>I<0038007C00FE00FE00FE007C00380000000000000000000000 -00000003FE03FE003E003E003E003E003E003E003E003E003E003E003E003E003E003E003E003E -003E003E003E003E003E003E003E783EFC3EFC3CFC7C78F87FE01F800F2E83A311>IIIII<00FE0007FFC00F83E01E00F03E00 -F87C007C7C007C7C007CFC007EFC007EFC007EFC007EFC007EFC007EFC007E7C007C7C007C3E00 -F81F01F00F83E007FFC000FE0017167E951C>II114 -D<0FF3003FFF00781F00600700E00300E00300F00300FC00007FE0007FF8003FFE000FFF0001FF -00000F80C00780C00380E00380E00380F00700FC0E00EFFC00C7F00011167E9516>I<01800001 -80000180000180000380000380000780000780000F80003F8000FFFF00FFFF000F80000F80000F -80000F80000F80000F80000F80000F80000F80000F80000F80000F81800F81800F81800F81800F -81800F830007C30003FE0000F80011207F9F16>IIIII -E /Fe 4 112 df<03CC0E2E181C381C301C701CE038E038E038E038C072C072C07260F261341E -180F107C8F14>97 D<307C1E00598663009E0783809E0703809C0703809C070380380E0700380E -0700380E0700380E0E00701C0E40701C0E40701C1C40701C1C80E0380C80601807001A107C8F1F ->109 D<307C005986009E07009E07009C07009C0700380E00380E00380E00381C00701C80701C -80703880703900E01900600E0011107C8F16>I<01F006180C0C180E300E700E600EE00EE00EE0 -0CE01CE018E030606030C01F000F107C8F14>I E /Ff 2 104 df<007001C00380070007000700 -07000700070007000700070007000700070007000E001C00F0001C000E00070007000700070007 -0007000700070007000700070007000700038001C000700C257D9B13>102 -DI E /Fg 35 122 df<00FC000182000703000607000E02000E00000E00000E00000E0000 -0E0000FFFF000E07000E07000E07000E07000E07000E07000E07000E07000E07000E07000E0700 -0E07000E07000E07007F0FE0131A809915>12 D<60F0F868080808101020C0050B7D990B>39 -D<60F0F07010101020204080040B7D830B>44 D<60F0F06004047D830B>46 -D<078018603030303060186018E01CE01CE01CE01CE01CE01CE01CE01CE01CE01CE01CE01C6018 -601870383030186007800E187E9713>48 D<0F8010E02070607870382038007800700070006000 -C00F8000E000700038003C003CE03CE03CC03C4038407030E00F800E187E9713>51 -D<60F0F060000000000000000060F0F0701010102020408004177D8F0B>59 -D<000C0000000C0000000C0000001E0000001E0000003F00000027000000270000004380000043 -8000004380000081C0000081C0000081C0000100E0000100E00001FFE000020070000200700006 -007800040038000400380008001C0008001C001C001E00FF00FFC01A1A7F991D>65 -DI76 D80 D<0FC21836200E6006C006C002C002C0 -02E00070007E003FE01FF807FC003E000E00070003800380038003C002C006E004D81887E0101A -7E9915>83 D<7FFFFF00701C0700401C0100401C0100C01C0180801C0080801C0080801C008000 -1C0000001C0000001C0000001C0000001C0000001C0000001C0000001C0000001C0000001C0000 -001C0000001C0000001C0000001C0000001C0000001C0000001C000003FFE000191A7F991C>I< -FF83FF0FF03C007801C01C007800801C007800800E007801000E007801000E009C010007009C02 -0007009C020007010E020007010E020003810E04000382070400038207040001C207080001C403 -880001C403880000E403900000E403900000E801D000007801E000007801E000007000E0000070 -00E000003000C0000020004000241A7F9927>87 D91 D93 -D<3F8070C070E020700070007007F01C7030707070E070E071E071E0F171FB1E3C10107E8F13> -97 DI<07F80C1C381C30087000E000E000E000E000E000E0007000300438080C -1807E00E107F8F11>I<007E00000E00000E00000E00000E00000E00000E00000E00000E00000E -0003CE000C3E00380E00300E00700E00E00E00E00E00E00E00E00E00E00E00E00E00600E00700E -00381E001C2E0007CFC0121A7F9915>I<07C01C3030187018600CE00CFFFCE000E000E000E000 -6000300438080C1807E00E107F8F11>I<01F0031807380E100E000E000E000E000E000E00FFC0 -0E000E000E000E000E000E000E000E000E000E000E000E000E000E007FE00D1A80990C>I<0FCE -187330307038703870387038303018602FC02000600070003FF03FFC1FFE600FC003C003C003C0 -036006381C07E010187F8F13>I<18003C003C001800000000000000000000000000FC001C001C -001C001C001C001C001C001C001C001C001C001C001C001C00FF80091A80990A>105 -D108 DII<07E01C38300C70 -0E6006E007E007E007E007E007E0076006700E381C1C3807E010107F8F13>II114 -D<1F2060E04020C020C020F0007F003FC01FE000F080708030C030C020F0408F800C107F8F0F> -I<0400040004000C000C001C003C00FFC01C001C001C001C001C001C001C001C001C201C201C20 -1C201C200E4003800B177F960F>III121 D E /Fh 4 52 df<00C00000C00000C00000C00000C00000C00000C00000C000 -00C000FFFF80FFFF8000C00000C00000C00000C00000C00000C00000C00000C00000C00011147E -8F17>43 D<0C003C00CC000C000C000C000C000C000C000C000C000C000C000C000C00FF800910 -7E8F0F>49 D<1F00618040C08060C0600060006000C00180030006000C00102020207FC0FFC00B -107F8F0F>I<1F00218060C060C000C0008001800F00008000400060C060C060804060801F000B -107F8F0F>I E /Fi 5 107 df<07E01FF83FFC7FFE7FFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -7FFE7FFE3FFC1FF807E010127D9317>15 D<000000040000000002000000000200000000010000 -0000008000000000400000000020FFFFFFFFFCFFFFFFFFFC000000002000000000400000000080 -000000010000000002000000000200000000040026107D922D>33 D<000F0038006000E001C001 -C001C001C001C001C001C001C001C001C001C001C001C001C001C0038007001E00F8001E000700 -038001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C000E00060003800 -0F102D7DA117>102 DI106 D E /Fj 3 52 df<03000700FF00070007000700070007000700070007000700070007 -000700070007000700070007007FF00C157E9412>49 D<0F8030E040708030C038E03840380038 -00700070006000C00180030006000C08080810183FF07FF0FFF00D157E9412>I<0FE030306018 -701C701C001C00180038006007E000300018000C000E000EE00EE00EC00C401830300FE00F157F -9412>I E /Fk 46 121 df<3807007C0F80FE1FC0FF1FE0FF1FE07F0FE03B0760030060030060 -0600C00600C00E01C00C0180180300700E0020040013107E9F1B>34 D<387CFEFFFF7F3B030306 -060E0C18702008107C9F0F>39 D<387CFEFEFE7C3807077C860F>46 D<00E00001E0000FE000FF -E000F3E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003 -E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E000FFFF80FFFF8011 -1D7C9C1A>49 D<07F0001FFE00383F007C1F80FE0FC0FE0FC0FE0FE0FE07E07C07E03807E0000F -E0000FC0000FC0001F80001F00003E0000780000F00000E00001C0000380600700600E00601C00 -E01FFFC03FFFC07FFFC0FFFFC0FFFFC0131D7D9C1A>I<01FC0007FF000E0F801E0FC03F07E03F -07E03F07E03F07E01E0FC0000FC0000F80001F0001FC0001FC00000F800007C00003E00003F000 -03F83803F87C03F8FE03F8FE03F8FE03F0FC03F07807E03C0FC01FFF8003FC00151D7E9C1A>I< -0001C00003C00007C00007C0000FC0001FC0003BC00073C00063C000C3C00183C00383C00703C0 -0E03C00C03C01803C03803C07003C0E003C0FFFFFEFFFFFE0007C00007C00007C00007C00007C0 -0007C000FFFE00FFFE171D7F9C1A>I<3803803FFF803FFF003FFE003FFC003FF0003F80003000 -0030000030000030000033F8003FFE003C1F00380F803007C00007C00007E00007E07807E0FC07 -E0FC07E0FC07E0FC07C0780FC0600F80381F001FFC0007F000131D7D9C1A>I<003F0001FFC007 -E0E00F81E01F03F01E03F03E03F07C03F07C01E07C0000FC1000FCFF00FDFFC0FD03E0FE01F0FE -01F0FC01F8FC01F8FC01F8FC01F87C01F87C01F87C01F83C01F03E01F01E03E00F07C007FF8001 -FE00151D7E9C1A>I<6000007FFFF87FFFF87FFFF07FFFE07FFFE0E001C0C00380C00700C00E00 -000C00001C0000380000780000780000F00000F00000F00001F00001F00001F00003F00003F000 -03F00003F00003F00003F00003F00003F00001E000151E7D9D1A>I<01FC0007FF000E07801C01 -C01800E03800E03800E03C00E03F00E03FC1C01FE3801FFF000FFE0007FF8007FFC01FFFE03C3F -F0780FF07803F8F001F8F000F8F00078F00078F000707800707C00E03E03C00FFF8003FC00151D -7E9C1A>I<0000E000000000E000000001F000000001F000000001F000000003F800000003F800 -000006FC00000006FC0000000EFE0000000C7E0000000C7E000000183F000000183F000000303F -800000301F800000701FC00000600FC00000600FC00000C007E00000FFFFE00001FFFFF0000180 -03F000018003F000030001F800030001F800060001FC00060000FC000E0000FE00FFE00FFFE0FF -E00FFFE0231F7E9E28>65 DI<0007FC02003FFF0E00FE03DE03 -F000FE07E0003E0FC0001E1F80001E3F00000E3F00000E7F0000067E0000067E000006FE000000 -FE000000FE000000FE000000FE000000FE000000FE0000007E0000007E0000067F0000063F0000 -063F00000C1F80000C0FC0001807E0003803F0007000FE01C0003FFF800007FC001F1F7D9E26> -IIII73 D76 D<001FF80000FFFF0001F81F8007E007E00FC003F01F8001F81F0000F83F0000FC7F0000FE -7E00007E7E00007EFE00007FFE00007FFE00007FFE00007FFE00007FFE00007FFE00007FFE0000 -7FFE00007F7E00007E7F0000FE7F0000FE3F0000FC3F8001FC1F8001F80FC003F007E007E001F8 -1F8000FFFF00001FF800201F7D9E27>79 DI82 -D<03FC080FFF381E03F83800F8700078700038F00038F00018F00018F80000FC00007FC0007FFE -003FFF801FFFE00FFFF007FFF000FFF80007F80000FC00007C00003CC0003CC0003CC0003CE000 -38E00078F80070FE01E0E7FFC081FF00161F7D9E1D>I<7FFFFFFC7FFFFFFC7C07E07C7007E01C -6007E00C6007E00CE007E00EC007E006C007E006C007E006C007E0060007E0000007E0000007E0 -000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007 -E0000007E0000007E0000007E0000007E00003FFFFC003FFFFC01F1E7E9D24>I<0400800E01C0 -180300300600700E00600C00600C00C01800C01800DC1B80FE1FC0FF1FE0FF1FE07F0FE03E07C0 -1C038013107B9F1B>92 D<07FC001FFF003F0F803F07C03F03E03F03E00C03E00003E0007FE007 -FBE01F03E03C03E07C03E0F803E0F803E0F803E0FC05E07E0DE03FF9FE0FE07E17147F9319>97 -DI<01FE0007FF801F0FC03E0FC03E -0FC07C0FC07C0300FC0000FC0000FC0000FC0000FC0000FC00007C00007E00003E00603F00C01F -81C007FF0001FC0013147E9317>I<0007F80007F80000F80000F80000F80000F80000F80000F8 -0000F80000F80000F80000F801F8F80FFEF81F83F83E01F87E00F87C00F87C00F8FC00F8FC00F8 -FC00F8FC00F8FC00F8FC00F87C00F87C00F87E00F83E01F81F07F80FFEFF03F8FF18207E9F1D> -I<01FE0007FF801F83E03F01F07E00F07E00F8FC00F8FC00F8FFFFF8FFFFF8FC0000FC0000FC00 -007C00007E00003E00183F00380F807007FFE000FF8015147F9318>I<001F8000FFC001F3E003 -E7E003C7E007C7E007C3C007C00007C00007C00007C00007C000FFFC00FFFC0007C00007C00007 -C00007C00007C00007C00007C00007C00007C00007C00007C00007C00007C00007C00007C00007 -C0003FFC003FFC0013207F9F10>I<01FC3C07FFFE0F079E1E03DE3E03E03E03E03E03E03E03E0 -3E03E01E03C00F07800FFF0009FC001800001800001C00001FFF800FFFF007FFF81FFFFC3C007C -70003EF0001EF0001EF0001E78003C78003C3F01F80FFFE001FF00171E7F931A>II<1C003F007F007F007F003F001C000000000000 -00000000000000FF00FF001F001F001F001F001F001F001F001F001F001F001F001F001F001F00 -1F001F00FFE0FFE00B217EA00E>I -107 DIII<01FF0007FFC01F83F03E00F83E00F87C007C7C007CFC007EFC -007EFC007EFC007EFC007EFC007E7C007C7C007C3E00F83E00F81F83F007FFC001FF0017147F93 -1A>II114 D<0FE63FFE701E600EE006E006F800FFC07FF83FFC1FFE03FE001FC007C0 -07E007F006F81EFFFCC7F010147E9315>I<01800180018003800380038007800F803F80FFFCFF -FC0F800F800F800F800F800F800F800F800F800F800F860F860F860F860F8607CC03F801F00F1D -7F9C14>II119 DI -E /Fl 85 127 df<70F8F8F8F8F8F8F8F8F8F8F8F8F8F8F8F870000000000070F8F8F870051C77 -9B18>33 D<4010E038F078E038E038E038E038E038E038E038E038E038E03860300D0E7B9C18> -I<030600078F00078F00078F00078F00078F00078F007FFFC0FFFFE0FFFFE07FFFC00F1E000F1E -000F1E000F1E000F1E000F1E007FFFC0FFFFE0FFFFE07FFFC01E3C001E3C001E3C001E3C001E3C -001E3C000C1800131C7E9B18>I<00C00001C00001C00001C00003F0000FFC003FFE007DCF0071 -C700E1C380E1C780E1C780E1C780F1C00079C0003DC0001FE0000FF80003FC0001DE0001CF0001 -C70061C380F1C380F1C380E1C380E1C70071C70079DE003FFE001FF80007E00001C00001C00001 -C00000C00011247D9F18>I<3803007C07807C0780EE0F80EE0F00EE0F00EE1F00EE1E00EE1E00 -EE3E007C3C007C3C00387C0000780000780000F80000F00001F00001E00001E00003E00003C000 -03C00007C0000783800787C00F87C00F0EE00F0EE01F0EE01E0EE01E0EE03E0EE03C07C03C07C0 -18038013247E9F18>I<01C00007E0000FF0000E70001C38001C38001C38001C38001C73F01C73 -F01CE3F00FE3800FC7000F87000F07001F0E003F0E007B8E0073DC00E1DC00E0F800E0F800E070 -70E0787070FC707FFFE03FCFE00F03C0141C7F9B18>I<387C7C7E3E0E0E0E1C1C38F8F0C0070E -789B18>I<007000F001E003C007800F001E001C00380038007000700070007000E000E000E000 -E000E000E000E000E0007000700070007000380038001C001E000F00078003C001F000F000700C -24799F18>I<6000F00078003C001E000F000780038001C001C000E000E000E000E00070007000 -700070007000700070007000E000E000E000E001C001C0038007800F001E003C007800F0006000 -0C247C9F18>I<01C00001C00001C00001C000C1C180F1C780F9CF807FFF001FFC0007F00007F0 -001FFC007FFF00F9CF80F1C780C1C18001C00001C00001C00001C00011147D9718>I<00600000 -F00000F00000F00000F00000F00000F00000F0007FFFC0FFFFE0FFFFE07FFFC000F00000F00000 -F00000F00000F00000F00000F00000600013147E9718>I<1C3E7E7F3F1F070E1E7CF860080C78 -8518>I<7FFF00FFFF80FFFF807FFF0011047D8F18>I<3078FCFC78300606778518>I<00030000 -0780000780000F80000F00001F00001E00001E00003E00003C00007C0000780000780000F80000 -F00001F00001E00003E00003C00003C00007C0000780000F80000F00000F00001F00001E00003E -00003C00003C00007C0000780000F80000F00000F0000060000011247D9F18>I<01F00007FC00 -0FFE001F1F001C07003803807803C07001C07001C0E000E0E000E0E000E0E000E0E000E0E000E0 -E000E0E000E0E000E0F001E07001C07001C07803C03803801C07001F1F000FFE0007FC0001F000 -131C7E9B18>I<01800380038007800F803F80FF80FB8043800380038003800380038003800380 -0380038003800380038003800380038003807FFCFFFE7FFC0F1C7B9B18>I<03F0000FFE003FFF -007C0F807003C0E001C0F000E0F000E06000E00000E00000E00001C00001C00003C0000780000F -00001E00003C0000780000F00001E00007C0000F80001E00E03C00E07FFFE0FFFFE07FFFE0131C -7E9B18>I<07F8001FFE003FFF007807807803C07801C03001C00001C00003C0000380000F0003 -FF0003FE0003FF000007800003C00001C00000E00000E00000E0F000E0F000E0F001C0F003C07C -07803FFF001FFE0003F800131C7E9B18>I<001F00003F0000770000770000E70001E70001C700 -0387000787000707000E07001E07003C0700380700780700F00700FFFFF8FFFFF8FFFFF8000700 -000700000700000700000700000700007FF000FFF8007FF0151C7F9B18>I<1FFF803FFF803FFF -803800003800003800003800003800003800003800003800003BF8003FFE003FFF003C07801803 -C00001C00000E00000E06000E0F000E0F000E0E001C07003C07C0F803FFF001FFC0003F000131C -7E9B18>I55 D<3078FCFC783000000000000000003078FC -FC78300614779318>58 D<183C7E7E3C180000000000000000183C7E7E3E1E0E1C3C78F060071A -789318>I<000300000780001F80003F00007E0001FC0003F00007E0001FC0003F00007E0000FC -0000FC00007E00003F00001FC00007E00003F00001FC00007E00003F00001F8000078000030011 -187D9918>I<7FFFC0FFFFE0FFFFE0FFFFE0000000000000000000000000FFFFE0FFFFE0FFFFE0 -7FFFC0130C7E9318>I<600000F00000FC00007E00003F00001FC00007E00003F00001FC00007E -00003F00001F80001F80003F00007E0001FC0003F00007E0001FC0003F00007E0000FC0000F000 -0060000011187D9918>I<0FF0003FFC007FFF00700F00F00380F00380600780000F00003E0000 -7C0001F00001E00003C00003C00003C00003C00003C00003800000000000000000000000000000 -000003800007C00007C00007C000038000111C7D9B18>I<007C0001FE0007FF000F87801E03C0 -3C1DC0387FC070FFE071E3E071C1E0E1C1E0E380E0E380E0E380E0E380E0E380E0E380E0E1C1C0 -71C1C071E3C070FF80387F003C1C001E00E00F83E007FFC001FF80007E00131C7E9B18>I<0070 -0000F80000F80000D80000D80001DC0001DC0001DC00018C00038E00038E00038E00038E000306 -000707000707000707000707000FFF800FFF800FFF800E03800E03801C01C01C01C07F07F0FF8F -F87F07F0151C7F9B18>II<00F8E003FEE007FFE00F07E01E03E0 -3C01E03800E07000E07000E0700000E00000E00000E00000E00000E00000E00000E00000E00000 -7000007000E07000E03800E03C00E01E01C00F07C007FF8003FE0000F800131C7E9B18>I<7FF8 -00FFFE007FFF001C0F801C03C01C03C01C01E01C00E01C00E01C00F01C00701C00701C00701C00 -701C00701C00701C00701C00701C00F01C00E01C00E01C01E01C01C01C03C01C0F807FFF00FFFE -007FF800141C7F9B18>III<01F1 -C003FDC00FFFC01F0FC01C03C03803C03801C07001C07001C0700000E00000E00000E00000E000 -00E00000E00FF0E01FF0E00FF07001C07001C07003C03803C03803C01C07C01F0FC00FFFC003FD -C001F1C0141C7E9B18>I<7FFF00FFFF807FFF0001C00001C00001C00001C00001C00001C00001 -C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001 -C00001C00001C0007FFF00FFFF807FFF00111C7D9B18>73 D<01FFC003FFC001FFC0000E00000E -00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E -00000E00000E00000E00000E00F00E00F00E00F03C007FFC003FF0000FC000121C7D9B18>I<7F -E000FFE0007FE0000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E -00000E00000E00000E00000E00000E00000E00000E00700E00700E00700E00700E00707FFFF0FF -FFF07FFFF0141C7F9B18>76 DI<7E07F0FF0FF87F07F01D81C01D -81C01D81C01DC1C01CC1C01CC1C01CE1C01CE1C01CE1C01C61C01C71C01C71C01C31C01C39C01C -39C01C39C01C19C01C19C01C1DC01C0DC01C0DC01C0DC07F07C0FF87C07F03C0151C7F9B18>I< -0FF8003FFE007FFF00780F00700700F00780E00380E00380E00380E00380E00380E00380E00380 -E00380E00380E00380E00380E00380E00380E00380E00380E00380F00780700700780F007FFF00 -3FFE000FF800111C7D9B18>II<7FF800FFFE007FFF001C0F801C -03801C03C01C01C01C01C01C01C01C03C01C03801C0F801FFF001FFE001FFE001C0F001C07001C -03801C03801C03801C03801C03801C039C1C039C1C039C7F01F8FF81F87F00F0161C7F9B18>82 -D<7FFFF8FFFFF8FFFFF8E07038E07038E07038E070380070000070000070000070000070000070 -0000700000700000700000700000700000700000700000700000700000700000700000700007FF -0007FF0007FF00151C7F9B18>84 DIII<3FFFE07FFFE07FFFE07001C07003C0700780700700000F00 -001E00001C00003C0000780000700000F00001E00001C00003C0000780000700000F00001E00E0 -1C00E03C00E07800E07000E0FFFFE0FFFFE0FFFFE0131C7E9B18>90 DI<600000F00000F00000 -F800007800007C00003C00003C00003E00001E00001F00000F00000F00000F800007800007C000 -03C00003C00003E00001E00001F00000F00000F800007800007800007C00003C00003E00001E00 -001E00001F00000F00000F8000078000078000030011247D9F18>II<018007C01FF07EFCF83E -E00E0F067C9B18>I<7FFF00FFFF80FFFF807FFF0011047D7F18>I<061E3E387070E0E0E0F8FC7C -7C38070E789E18>I<1FE0003FF8007FFC00781E00300E0000070000070000FF0007FF001FFF00 -7F0700780700E00700E00700E00700F00F00781F003FFFF01FFBF007E1F014147D9318>I<7E00 -00FE00007E00000E00000E00000E00000E00000E00000E3E000EFF800FFFC00FC1E00F80E00F00 -700E00700E00380E00380E00380E00380E00380E00380F00700F00700F80E00FC1E00FFFC00EFF -80063E00151C809B18>I<01FE0007FF001FFF803E0780380300700000700000E00000E00000E0 -0000E00000E00000E000007000007001C03801C03E03C01FFF8007FF0001FC0012147D9318>I< -001F80003F80001F8000038000038000038000038000038003E3800FFB801FFF803C1F80380F80 -700780700380E00380E00380E00380E00380E00380E00380700780700780380F803C1F801FFFF0 -0FFBF803E3F0151C7E9B18>I<01F00007FC001FFE003E0F00380780700380700380E001C0E001 -C0FFFFC0FFFFC0FFFFC0E000007000007001C03801C03E03C01FFF8007FF0001FC0012147D9318 ->I<001F80007FC000FFE000E1E001C0C001C00001C00001C0007FFFC0FFFFC0FFFFC001C00001 -C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0007F -FF007FFF007FFF00131C7F9B18>I<01E1F007FFF80FFFF81E1E301C0E00380700380700380700 -3807003807001C0E001E1E001FFC001FF80039E0003800001C00001FFE001FFFC03FFFE07801F0 -700070E00038E00038E00038E000387800F07E03F01FFFC00FFF8001FC00151F7F9318>I<7E00 -00FE00007E00000E00000E00000E00000E00000E00000E3E000EFF800FFFC00FC1C00F80E00F00 -E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E07FC3FCFFE7 -FE7FC3FC171C809B18>I<03800007C00007C00007C0000380000000000000000000000000007F -C000FFC0007FC00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001 -C00001C00001C00001C000FFFF00FFFF80FFFF00111D7C9C18>I<0038007C007C007C00380000 -0000000000000FFC1FFC0FFC001C001C001C001C001C001C001C001C001C001C001C001C001C00 -1C001C001C001C001C001C001C001C001C6038F078FFF07FE03F800E277E9C18>II<7FE000FFE0007FE00000E00000E00000E00000E00000E00000E00000E00000 -E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000 -E00000E0007FFFC0FFFFE07FFFC0131C7E9B18>I<7CE0E000FFFBF8007FFFF8001F1F1C001E1E -1C001E1E1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C -1C1C001C1C1C001C1C1C007F1F1F00FFBFBF807F1F1F001914819318>I<7E3E00FEFF807FFFC0 -0FC1C00F80E00F00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E0 -0E00E07FC3FCFFE7FE7FC3FC1714809318>I<01F0000FFE001FFF003E0F803803807001C07001 -C0E000E0E000E0E000E0E000E0E000E0F001E07001C07803C03C07803E0F801FFF000FFE0001F0 -0013147E9318>I<7E3E00FEFF807FFFC00FC1E00F80E00F00700E00700E00380E00380E00380E -00380E00380E00380F00700F00700F80E00FC1E00FFFC00EFF800E3E000E00000E00000E00000E -00000E00000E00000E00007FC000FFE0007FC000151E809318>I<01E38007FB801FFF803E1F80 -380F80700780700780E00380E00380E00380E00380E00380E00380700780700780380F803C1F80 -1FFF800FFB8003E380000380000380000380000380000380000380000380003FF8003FF8003FF8 -151E7E9318>I<7F87E0FF9FF07FBFF803F87803F03003E00003C00003C0000380000380000380 -000380000380000380000380000380000380007FFE00FFFF007FFE0015147F9318>I<07F7003F -FF007FFF00780F00E00700E00700E007007C00007FE0001FFC0003FE00001F00600780E00380E0 -0380F00380F80F00FFFF00FFFC00E7F00011147D9318>I<018000038000038000038000038000 -7FFFC0FFFFC0FFFFC0038000038000038000038000038000038000038000038000038000038040 -0380E00380E00380E001C1C001FFC000FF80003E0013197F9818>I<7E07E0FE0FE07E07E00E00 -E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E01E00F03 -E007FFFC03FFFE01FCFC1714809318>I<7F8FF0FF8FF87F8FF01E03C00E03800E03800E038007 -0700070700070700038E00038E00038E00038E0001DC0001DC0001DC0000F80000F80000700015 -147F9318>II<7F8FF07F9F -F07F8FF0070700078E00039E0001DC0001F80000F80000700000F00000F80001DC00039E00038E -000707000F07807F8FF0FF8FF87F8FF015147F9318>I<7F8FF0FF8FF87F8FF00E01C00E03800E -0380070380070700070700038700038600038E0001CE0001CE0000CC0000CC0000DC0000780000 -780000780000700000700000700000F00000E00079E0007BC0007F80003F00001E0000151E7F93 -18>I<3FFFF07FFFF07FFFF07001E07003C0700780000F00001E00003C0000F80001F00003C000 -0780000F00701E00703C0070780070FFFFF0FFFFF0FFFFF014147F9318>I<0007E0001FE0007F -E000780000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00001E0 -007FC000FF8000FF80007FC00001E00000E00000E00000E00000E00000E00000E00000E00000E0 -0000E00000E00000E000007800007FE0001FE00007E013247E9F18>I<60F0F0F0F0F0F0F0F0F0 -F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0600424769F18>I<7C0000FF0000 -FFC00003C00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E000 -00F000007FC0003FE0003FE0007FC000F00000E00000E00000E00000E00000E00000E00000E000 -00E00000E00000E00000E00003C000FFC000FF00007C000013247E9F18>I<060C1F1E3FBEFBF8 -F1F060C00F067C9B18>I E /Fm 33 122 df<00003FE00000E010000180380003807800030078 -00070030000700000007000000070000000E0000000E0000000E000000FFFFE0000E00E0001C01 -C0001C01C0001C01C0001C01C0001C038000380380003803800038038000380700003807000070 -07000070071000700E2000700E2000700E2000E00E2000E0064000E0038000E0000000C0000001 -C0000001C000003180000079800000F3000000620000003C0000001D29829F1A>12 -D<00003FC0FF800000E0E38040000181E600E0000381EC01E0000300DC01E00007001C00C00007 -00180000000700380000000E00380000000E00380000000E00380000000E0070000000FFFFFFFF -80001C00700380001C00700700001C00700700001C00700700001C00E00700001C00E00E000038 -00E00E00003800E00E00003800E00E00003801C01C00003801C01C00007001C01C00007001C01C -40007001C0388000700380388000700380388000E00380388000E00380190000E003000E0000E0 -0700000000C00700000001C00600000001C00600000031860E000000798F0C000000F31E180000 -00620C300000003C07C00000002B29829F28>14 D<0E1F3F3F1D0102020404081020C0080E779F -0E>39 D<000200020006000E003C00DC031C001C0038003800380038007000700070007000E000 -E000E000E001C001C001C001C003800380038003800780FFF80F1E7B9D17>49 -D<070F1F1F0E0000000000000000000070F8F8F0E008147B930E>58 D<0000FE0200078186001C -004C0038003C0060003C00C0001C01C0001803800018070000180F0000181E0000101E0000103C -0000003C00000078000000780000007800000078000000F0000000F0000000F0000000F0000000 -F00000807000008070000080700001003800010038000200180004000C001800060020000381C0 -0000FE00001F217A9F21>67 D<01FFFFFC001E0038001E0018001E0008001E0008003C0008003C -0008003C0008003C00080078001000780800007808000078080000F0100000F0300000FFF00000 -F0300001E0200001E0200001E0200001E0200003C0000003C0000003C0000003C0000007800000 -0780000007800000078000000F800000FFF800001E1F7D9E1E>70 D<01FF007FE0001F000F0000 -1F0004000017800400001780040000278008000023C008000023C008000023C008000041E01000 -0041E010000041F010000040F010000080F0200000807820000080782000008078200001003C40 -0001003C400001003C400001001E400002001E800002001E800002000F800002000F800004000F -0000040007000004000700000C000700001C00020000FF80020000231F7D9E22>78 -D<01FFFF80001E00E0001E0070001E0038001E003C003C003C003C003C003C003C003C003C0078 -007800780078007800F0007800E000F003C000F00F0000FFFC0000F0000001E0000001E0000001 -E0000001E0000003C0000003C0000003C0000003C0000007800000078000000780000007800000 -0F800000FFF000001E1F7D9E1F>80 D<00F1800389C00707800E03801C03803C03803807007807 -00780700780700F00E00F00E00F00E00F00E20F01C40F01C40703C40705C40308C800F07001314 -7C9317>97 D<07803F8007000700070007000E000E000E000E001C001C001CF01D0C3A0E3C0E38 -0F380F700F700F700F700FE01EE01EE01EE01CE03CE038607060E031C01F0010207B9F15>I<00 -7E0001C1000300800E07801E07801C07003C0200780000780000780000F00000F00000F00000F0 -0000F0000070010070020030040018380007C00011147C9315>I<0000780003F8000070000070 -0000700000700000E00000E00000E00000E00001C00001C000F1C00389C00707800E03801C0380 -3C0380380700780700780700780700F00E00F00E00F00E00F00E20F01C40F01C40703C40705C40 -308C800F070015207C9F17>I<007C01C207010E011C013C013802780C7BF07C00F000F000F000 -F0007000700170023804183807C010147C9315>I<00007800019C00033C00033C000718000700 -000700000E00000E00000E00000E00000E0001FFE0001C00001C00001C00001C00003800003800 -00380000380000380000700000700000700000700000700000700000E00000E00000E00000E000 -00C00001C00001C0000180003180007B0000F300006600003C00001629829F0E>I<003C6000E2 -7001C1E00380E00700E00F00E00E01C01E01C01E01C01E01C03C03803C03803C03803C03803C07 -003C07001C0F001C17000C2E0003CE00000E00000E00001C00001C00301C00783800F0700060E0 -003F8000141D7E9315>I<01E0000FE00001C00001C00001C00001C00003800003800003800003 -8000070000070000071E000763000E81800F01C00E01C00E01C01C03801C03801C03801C038038 -0700380700380700380E10700E20700C20701C20700C40E00CC060070014207D9F17>I<00C001 -E001E001C000000000000000000000000000000E003300230043804300470087000E000E000E00 -1C001C001C003840388030807080310033001C000B1F7C9E0E>I<0001800003C00003C0000380 -000000000000000000000000000000000000000000003C00004600008700008700010700010700 -020E00000E00000E00000E00001C00001C00001C00001C00003800003800003800003800007000 -00700000700000700000E00000E00030E00079C000F180006300003C00001228829E0E>I<01E0 -000FE00001C00001C00001C00001C0000380000380000380000380000700000700000703C00704 -200E08E00E11E00E21E00E40C01C80001D00001E00001FC00038E0003870003870003838407070 -80707080707080703100E03100601E0013207D9F15>I<03C01FC0038003800380038007000700 -070007000E000E000E000E001C001C001C001C0038003800380038007000700070007100E200E2 -00E200E200640038000A207C9F0C>I<1C0F80F0002630C318004740640C004780680E00470070 -0E004700700E008E00E01C000E00E01C000E00E01C000E00E01C001C01C038001C01C038001C01 -C038001C01C0708038038071003803806100380380E10038038062007007006600300300380021 -147C9325>I<1C0F802630C04740604780604700704700708E00E00E00E00E00E00E00E01C01C0 -1C01C01C01C01C03843803883803083807083803107003303001C016147C931A>I<007C0001C3 -000301800E01C01E01C01C01E03C01E07801E07801E07801E0F003C0F003C0F003C0F00780F007 -00700F00700E0030180018700007C00013147C9317>I<01C1E002621804741C04781C04701E04 -701E08E01E00E01E00E01E00E01E01C03C01C03C01C03C01C0380380780380700380E003C1C007 -2380071E000700000700000E00000E00000E00000E00001C00001C0000FFC000171D809317>I< -1C1E002661004783804787804707804703008E00000E00000E00000E00001C00001C00001C0000 -1C000038000038000038000038000070000030000011147C9313>114 D<00FC030206010C030C -070C060C000F800FF007F803FC003E000E700EF00CF00CE008401020601F8010147D9313>I<01 -8001C0038003800380038007000700FFF007000E000E000E000E001C001C001C001C0038003800 -38003820704070407080708031001E000C1C7C9B0F>I<0E00C03300E02301C04381C04301C047 -01C08703800E03800E03800E03801C07001C07001C07001C07101C0E20180E20180E201C1E200C -264007C38014147C9318>I<0E03803307802307C04383C04301C04700C08700800E00800E0080 -0E00801C01001C01001C01001C02001C02001C04001C04001C08000E300003C00012147C9315> -I<0E00C1C03300E3C02301C3E04381C1E04301C0E04701C060870380400E0380400E0380400E03 -80401C0700801C0700801C0700801C0701001C0701001C0602001C0F02000C0F04000E13080003 -E1F0001B147C931E>I<0383800CC4401068E01071E02071E02070C040E00000E00000E00000E0 -0001C00001C00001C00001C040638080F38080F38100E5810084C60078780013147D9315>I<0E -00C03300E02301C04381C04301C04701C08703800E03800E03800E03801C07001C07001C07001C -07001C0E00180E00180E001C1E000C3C0007DC00001C00001C00003800F03800F07000E06000C0 -C0004380003E0000131D7C9316>I E /Fn 74 123 df<001F83E000F06E3001C078780380F878 -0300F03007007000070070000700700007007000070070000700700007007000FFFFFF80070070 -000700700007007000070070000700700007007000070070000700700007007000070070000700 -7000070070000700700007007000070070000700700007007000070070007FE3FF001D20809F1B ->11 D<003F0000E0C001C0C00381E00701E00701E0070000070000070000070000070000070000 -FFFFE00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E0 -0700E00700E00700E00700E00700E00700E07FC3FE1720809F19>I<003FE000E0E001C1E00381 -E00700E00700E00700E00700E00700E00700E00700E00700E0FFFFE00700E00700E00700E00700 -E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700 -E00700E07FE7FE1720809F19>I<001F81F80000F04F040001C07C06000380F80F000300F00F00 -0700F00F00070070000007007000000700700000070070000007007000000700700000FFFFFFFF -000700700700070070070007007007000700700700070070070007007007000700700700070070 -070007007007000700700700070070070007007007000700700700070070070007007007000700 -700700070070070007007007007FE3FE3FF02420809F26>I<07070F1C383060C00808779F17> -19 D<7038F87CFC7EFC7E743A0402040204020804080410081008201040200F0E7E9F17>34 -D<70F8FCFC74040404080810102040060E7C9F0D>39 D<0020004000800100020006000C000C00 -180018003000300030007000600060006000E000E000E000E000E000E000E000E000E000E000E0 -00E0006000600060007000300030003000180018000C000C000600020001000080004000200B2E -7DA112>I<800040002000100008000C00060006000300030001800180018001C000C000C000C0 -00E000E000E000E000E000E000E000E000E000E000E000E000C000C000C001C001800180018003 -000300060006000C00080010002000400080000B2E7DA112>I<70F8FCFC740404040808101020 -40060E7C840D>44 DI<70F8F8F87005057C840D>I<0003000300070006 -0006000E000C000C001C0018001800380030003000700060006000E000C000C001C00180018001 -800380030003000700060006000E000C000C001C0018001800380030003000700060006000E000 -C000C000102D7DA117>I<03F0000E1C001C0E00180600380700700380700380700380700380F0 -03C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C070 -03807003807003807807803807001806001C0E000E1C0003F000121F7E9D17>I<018003800F80 -F38003800380038003800380038003800380038003800380038003800380038003800380038003 -800380038003800380038007C0FFFE0F1E7C9D17>I<03F0000C1C00100E002007004007808007 -80F007C0F803C0F803C0F803C02007C00007C0000780000780000F00000E00001C000038000070 -0000600000C0000180000300000600400C00401800401000803FFF807FFF80FFFF80121E7E9D17 ->I<03F0000C1C00100E00200F00780F80780780780780380F80000F80000F00000F00000E0000 -1C0000380003F000003C00000E00000F000007800007800007C02007C0F807C0F807C0F807C0F0 -0780400780400F00200E001C3C0003F000121F7E9D17>I<000600000600000E00000E00001E00 -002E00002E00004E00008E00008E00010E00020E00020E00040E00080E00080E00100E00200E00 -200E00400E00C00E00FFFFF0000E00000E00000E00000E00000E00000E00000E0000FFE0141E7F -9D17>I<1803001FFE001FFC001FF8001FE00010000010000010000010000010000010000011F0 -00161C00180E001007001007800003800003800003C00003C00003C07003C0F003C0F003C0E003 -80400380400700200600100E000C380003E000121F7E9D17>I<007C000182000701000E03800C -07801C0780380300380000780000700000700000F1F000F21C00F40600F80700F80380F80380F0 -03C0F003C0F003C0F003C0F003C07003C07003C07003803803803807001807000C0E00061C0001 -F000121F7E9D17>I<4000007FFFC07FFF807FFF80400100800200800200800400000800000800 -00100000200000200000400000400000C00000C00001C000018000038000038000038000038000 -078000078000078000078000078000078000078000030000121F7D9D17>I<03F0000C0C001006 -003003002001806001806001806001807001807803003E03003F06001FC8000FF00003F80007FC -000C7E00103F00300F806003804001C0C001C0C000C0C000C0C000C0C000806001802001001002 -000C0C0003F000121F7E9D17>I<03F0000E18001C0C00380600380700700700700380F00380F0 -0380F003C0F003C0F003C0F003C0F003C07007C07007C03807C0180BC00E13C003E3C000038000 -0380000380000700300700780600780E00700C002018001070000FC000121F7E9D17>I<70F8F8 -F8700000000000000000000070F8F8F87005147C930D>I<70F8F8F87000000000000000000000 -70F0F8F878080808101010202040051D7C930D>I<7FFFFFE0FFFFFFF000000000000000000000 -00000000000000000000000000000000000000000000FFFFFFF07FFFFFE01C0C7D9023>61 -D<000100000003800000038000000380000007C0000007C0000007C0000009E0000009E0000009 -E0000010F0000010F0000010F00000207800002078000020780000403C0000403C0000403C0000 -801E0000801E0000FFFE0001000F0001000F0001000F00020007800200078002000780040003C0 -0E0003C01F0007E0FFC03FFE1F207F9F22>65 DI<000FC04000 -7030C001C009C0038005C0070003C00E0001C01E0000C01C0000C03C0000C07C0000407C000040 -78000040F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F80000 -00780000007C0000407C0000403C0000401C0000401E0000800E000080070001000380020001C0 -040000703800000FC0001A217D9F21>I69 -DI<000FE0200078186000E004E0038002E0070001E00F0000E0 -1E0000601E0000603C0000603C0000207C00002078000020F8000000F8000000F8000000F80000 -00F8000000F8000000F8000000F8007FFCF80003E0780001E07C0001E03C0001E03C0001E01E00 -01E01E0001E00F0001E0070001E0038002E000E0046000781820000FE0001E217D9F24>III76 DII<001F800000F0F00001C0380007801E000F000F000E0007001E0007803C0003C0 -3C0003C07C0003E0780001E0780001E0F80001F0F80001F0F80001F0F80001F0F80001F0F80001 -F0F80001F0F80001F0F80001F0780001E07C0003E07C0003E03C0003C03C0003C01E0007800E00 -07000F000F0007801E0001C0380000F0F000001F80001C217D9F23>II82 D<07E0800C198010078030038060018060 -0180E00180E00080E00080E00080F00000F000007800007F00003FF0001FFC000FFE0003FF0000 -1F800007800003C00003C00001C08001C08001C08001C08001C0C00180C00380E00300F00600CE -0C0081F80012217D9F19>I<7FFFFFE0780F01E0600F0060400F0020400F0020C00F0030800F00 -10800F0010800F0010800F0010000F0000000F0000000F0000000F0000000F0000000F0000000F -0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F000000 -0F0000000F0000000F0000001F800007FFFE001C1F7E9E21>IIII -91 D<080410082010201040204020804080408040B85CFC7EFC7E7C3E381C0F0E7B9F17>II<1FE000303000781800781C00300E00000E00000E00000E0000FE0007 -8E001E0E00380E00780E00F00E10F00E10F00E10F01E10781E103867200F83C014147E9317>97 -D<0E0000FE00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E3E -000EC3800F01C00F00E00E00E00E00700E00700E00780E00780E00780E00780E00780E00780E00 -700E00700E00E00F00E00D01C00CC300083E0015207F9F19>I<03F80E0C1C1E381E380C700070 -00F000F000F000F000F000F00070007000380138011C020E0C03F010147E9314>I<000380003F -8000038000038000038000038000038000038000038000038000038000038003E380061B801C07 -80380380380380700380700380F00380F00380F00380F00380F00380F003807003807003803803 -803807801C07800E1B8003E3F815207E9F19>I<03F0000E1C001C0E0038070038070070070070 -0380F00380F00380FFFF80F00000F00000F000007000007000003800801800800C010007060001 -F80011147F9314>I<007C00C6018F038F07060700070007000700070007000700FFF007000700 -07000700070007000700070007000700070007000700070007000700070007007FF01020809F0E ->I<0000E003E3300E3C301C1C30380E00780F00780F00780F00780F00780F00380E001C1C001E -380033E0002000002000003000003000003FFE001FFF800FFFC03001E0600070C00030C00030C0 -0030C000306000603000C01C038003FC00141F7F9417>I<0E0000FE00000E00000E00000E0000 -0E00000E00000E00000E00000E00000E00000E00000E3E000E43000E81800F01C00F01C00E01C0 -0E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C0 -FFE7FC16207F9F19>I<1C001E003E001E001C000000000000000000000000000E007E000E000E -000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E00FFC00A1F809E0C> -I<00E001F001F001F000E0000000000000000000000000007007F000F000700070007000700070 -00700070007000700070007000700070007000700070007000700070007000706070F060F0C061 -803F000C28829E0E>I<0E0000FE00000E00000E00000E00000E00000E00000E00000E00000E00 -000E00000E00000E0FF00E03C00E03000E02000E04000E08000E10000E30000E70000EF8000F38 -000E1C000E1E000E0E000E07000E07800E03800E03C00E03E0FFCFF815207F9F18>I<0E00FE00 -0E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E -000E000E000E000E000E000E000E000E000E00FFE00B20809F0C>I<0E1F01F000FE618618000E -81C81C000F00F00E000F00F00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E00 -0E00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E000E00E00E -000E00E00E00FFE7FE7FE023147F9326>I<0E3E00FE43000E81800F01C00F01C00E01C00E01C0 -0E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C0FFE7FC -16147F9319>I<01F800070E001C03803801C03801C07000E07000E0F000F0F000F0F000F0F000 -F0F000F0F000F07000E07000E03801C03801C01C0380070E0001F80014147F9317>I<0E3E00FE -C3800F01C00F00E00E00E00E00F00E00700E00780E00780E00780E00780E00780E00780E00700E -00F00E00E00F01E00F01C00EC3000E3E000E00000E00000E00000E00000E00000E00000E00000E -0000FFE000151D7F9319>I<03E0800619801C05803C0780380380780380700380F00380F00380 -F00380F00380F00380F003807003807803803803803807801C0B800E138003E380000380000380 -000380000380000380000380000380000380003FF8151D7E9318>I<0E78FE8C0F1E0F1E0F0C0E -000E000E000E000E000E000E000E000E000E000E000E000E000E00FFE00F147F9312>I<1F9030 -704030C010C010C010E00078007F803FE00FF00070803880188018C018C018E030D0608F800D14 -7E9312>I<020002000200060006000E000E003E00FFF80E000E000E000E000E000E000E000E00 -0E000E000E000E080E080E080E080E080610031001E00D1C7F9B12>I<0E01C0FE1FC00E01C00E -01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E -03C00603C0030DC001F1FC16147F9319>III<7FC3FC0F01E00701C007018003810001C20000E40000EC -00007800003800003C00007C00004E000087000107000303800201C00601E01E01E0FF07FE1714 -809318>II<3FFF380E200E201C40384078407000E001E0 -01C00380078007010E011E011C0338027006700EFFFE10147F9314>I E -/Fo 41 122 df<0001FF0000001FFFC000007F80F00000FE00F80003FC01FC0003F803FC0007F0 -03FC0007F003FC0007F003FC0007F001F80007F000F00007F000000007F000000007F000000007 -F0000000FFFFFFFC00FFFFFFFC00FFFFFFFC0007F001FC0007F001FC0007F001FC0007F001FC00 -07F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC -0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001FC0007F001 -FC0007F001FC007FFF1FFFC07FFF1FFFC07FFF1FFFC0222A7FA926>12 D<000E00001E00007E00 -07FE00FFFE00FFFE00F8FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00 -00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00 -00FE0000FE0000FE0000FE0000FE0000FE0000FE007FFFFE7FFFFE7FFFFE17277BA622>49 -D<00FF800003FFF0000FFFFC003F03FF007C00FF807C007FC0FE007FC0FF003FE0FF003FE0FF00 -3FE0FF001FE07E001FE03C003FE000003FE000003FC000003FC000007F8000007F800000FF0000 -01FE000001FC000003F0000007E000000FC000001F0000003E0000007C00E0007800E000F000E0 -01E001C0038001C0070001C00FFFFFC01FFFFFC03FFFFFC07FFFFFC0FFFFFF80FFFFFF80FFFFFF -801B277DA622>I<007F800003FFF00007FFFC001F81FE001F00FF003F80FF003F807F803FC07F -803F807F803F807F801F007F800000FF800000FF000000FF000001FE000003F8000007F00000FF -C00000FFF0000001FC000000FF0000007F8000007FC000003FC000003FE000003FE000003FE03C -003FE07E003FE0FF003FE0FF003FE0FF003FC0FF007FC0FE007F807C00FF803F01FF001FFFFC00 -07FFF00000FF80001B277DA622>I<00000E0000001E0000003E0000007E000000FE000000FE00 -0001FE000003FE0000077E00000E7E00000E7E00001C7E0000387E0000707E0000E07E0000E07E -0001C07E0003807E0007007E000E007E000E007E001C007E0038007E0070007E00E0007E00FFFF -FFF8FFFFFFF8FFFFFFF80000FE000000FE000000FE000000FE000000FE000000FE000000FE0000 -00FE00007FFFF8007FFFF8007FFFF81D277EA622>I<0C0003000F803F000FFFFE000FFFFE000F -FFFC000FFFF8000FFFE0000FFFC0000FFE00000E0000000E0000000E0000000E0000000E000000 -0E0000000E7FC0000FFFF8000F80FE000E007F000C003F8000003F8000001FC000001FC000001F -E000001FE018001FE07E001FE0FE001FE0FE001FE0FE001FE0FE001FE0FE001FC078003FC07800 -3F803C007F001F01FE000FFFFC0003FFF00000FF80001B277DA622>I<0007F000003FFC0000FF -FF0001FC0F0007F01F800FE03F800FC03F801FC03F803F803F803F801F007F8000007F0000007F -0000007F000000FF000000FF0FC000FF3FF800FF70FE00FFE03F00FFC03F80FF801FC0FF801FC0 -FF801FC0FF001FE0FF001FE0FF001FE0FF001FE07F001FE07F001FE07F001FE07F001FE03F801F -C03F801FC01F803F800FC03F8007E0FF0003FFFC0000FFF000003FC0001B277DA622>I<380000 -003E0000003FFFFFF03FFFFFF03FFFFFF07FFFFFE07FFFFFC07FFFFFC07FFFFF8070000F007000 -1E0070003C00E0003800E0007800E000F0000001E0000003C0000003C000000780000007800000 -0F0000001F0000001F0000001F0000003F0000003F0000003E0000007E0000007E0000007E0000 -007E000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE00 -00003800001C297CA822>I<000003800000000007C00000000007C0000000000FE0000000000F -E0000000000FE0000000001FF0000000001FF0000000003FF8000000003FF8000000003FF80000 -000073FC0000000073FC00000000F3FE00000000E1FE00000000E1FE00000001C0FF00000001C0 -FF00000003C0FF80000003807F80000007807FC0000007003FC0000007003FC000000E003FE000 -000E001FE000001E001FF000001C000FF000001FFFFFF000003FFFFFF800003FFFFFF800007800 -07FC0000700003FC0000700003FC0000E00001FE0000E00001FE0001E00001FF0001C00000FF00 -01C00000FF00FFFE001FFFFEFFFE001FFFFEFFFE001FFFFE2F297EA834>65 -D69 DI73 D76 DI80 -D<007F806003FFF0E00FFFFFE01F807FE03F001FE07E0007E07E0003E07C0003E0FC0001E0FC00 -01E0FC0000E0FE0000E0FE0000E0FF000000FFC000007FFE00007FFFE0003FFFFC003FFFFF001F -FFFF8007FFFFC003FFFFE000FFFFF00007FFF000007FF000000FF8000007F8000003F8E00003F8 -E00001F8E00001F8E00001F8F00001F8F00001F0F80003F0FC0003E0FF0007E0FFE01FC0FFFFFF -00E0FFFE00C01FF0001D297CA826>83 D<7FFFFFFFFFC07FFFFFFFFFC07FFFFFFFFFC07F803FC0 -3FC07E003FC007C078003FC003C078003FC003C070003FC001C0F0003FC001E0F0003FC001E0E0 -003FC000E0E0003FC000E0E0003FC000E0E0003FC000E0E0003FC000E000003FC0000000003FC0 -000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000 -003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0 -000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000003FC0000000 -003FC00000007FFFFFE000007FFFFFE000007FFFFFE0002B287EA730>I86 D<01FF800007FFF0000F81FC001FC0FE001FC07F001FC07F001FC0 -3F800F803F8000003F8000003F8000003F80000FFF8000FFFF8007FC3F801FE03F803F803F807F -803F807F003F80FE003F80FE003F80FE003F80FE007F80FF007F807F00FFC03F83DFFC0FFF0FFC -01FC03FC1E1B7E9A21>97 DI<001FF80000 -FFFE0003F01F000FE03F801FC03F803F803F803F803F807F801F007F000000FF000000FF000000 -FF000000FF000000FF000000FF000000FF000000FF000000FF0000007F0000007F8000003F8001 -C03FC001C01FC003C00FE0078003F01F0000FFFC00001FE0001A1B7E9A1F>I<00003FF8000000 -3FF80000003FF800000003F800000003F800000003F800000003F800000003F800000003F80000 -0003F800000003F800000003F800000003F800000003F800000003F800001FE3F80000FFFBF800 -03F03FF8000FE00FF8001FC007F8003F8003F8003F8003F8007F8003F8007F0003F800FF0003F8 -00FF0003F800FF0003F800FF0003F800FF0003F800FF0003F800FF0003F800FF0003F800FF0003 -F8007F0003F8007F0003F8003F8003F8003F8007F8001FC00FF8000FE01FF80003F03FFF8000FF -F3FF80003FC3FF80212A7EA926>I<003FE00001FFF80003F07E000FE03F001FC01F803F800FC0 -3F800FC07F000FC07F0007E0FF0007E0FF0007E0FF0007E0FFFFFFE0FFFFFFE0FF000000FF0000 -00FF000000FF0000007F0000007F8000003F8000E03F8001E01FC001C00FE003C003F81F8000FF -FE00001FF0001B1B7E9A20>I<0007F0003FFC00FE3E01FC7F03F87F03F87F07F07F07F03E07F0 -0007F00007F00007F00007F00007F00007F000FFFFC0FFFFC0FFFFC007F00007F00007F00007F0 -0007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F0 -0007F00007F00007F00007F0007FFF807FFF807FFF80182A7EA915>I<00FF81F003FFE7FC0FC1 -FE7C1F80FC7C3F80FE7C3F007E107F007F007F007F007F007F007F007F007F007F007F007F003F -007E003F80FE001F80FC000FC1F8001FFFE00018FF8000380000003C0000003C0000003E000000 -3FFFF8003FFFFF001FFFFFC00FFFFFE007FFFFF01FFFFFF07E0007F87C0001F8F80001F8F80000 -F8F80000F8F80000F8FC0001F87E0003F03F0007E00FC01F8003FFFE00007FF0001E287E9A22> -II<07001FC01FE03FE03FE03FE01FE01FC0 -07000000000000000000000000000000FFE0FFE0FFE00FE00FE00FE00FE00FE00FE00FE00FE00F -E00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0FFFEFFFEFFFE0F2B7DAA14>I107 DIII<003FE00001FFFC0003F07E000FC01F801F800F -C03F800FE03F0007E07F0007F07F0007F07F0007F0FF0007F8FF0007F8FF0007F8FF0007F8FF00 -07F8FF0007F8FF0007F8FF0007F87F0007F07F0007F03F800FE03F800FE01F800FC00FC01F8007 -F07F0001FFFC00003FE0001D1B7E9A22>II114 -D<03FE300FFFF03E03F07800F07000F0F00070F00070F80070FC0000FFE000FFFE007FFFC03FFF -E01FFFF007FFF800FFFC0003FC0000FCE0007CE0003CF0003CF0003CF80078FC0078FF01F0F7FF -C0C1FF00161B7E9A1B>I<00700000700000700000700000F00000F00000F00001F00003F00003 -F00007F0001FFFF0FFFFF0FFFFF007F00007F00007F00007F00007F00007F00007F00007F00007 -F00007F00007F00007F00007F00007F03807F03807F03807F03807F03807F03807F03803F87001 -F8F000FFE0001F8015267FA51B>I -III< -FFFC0FFF00FFFC0FFF00FFFC0FFF0007F003C00003F807800001FC07800000FE0F000000FF1E00 -00007F3C0000003FF80000001FF00000000FF00000000FF000000007F000000007F80000000FFC -0000001FFE0000001EFE0000003C7F000000783F800000F01FC00001E01FE00001C00FE00003C0 -07F000FFF01FFF80FFF01FFF80FFF01FFF80211B7F9A24>II -E /Fp 13 118 df<0F001F003F803F007E00F800F000C0000A08769C18>19 -D<00038000000380000007C0000007C0000007C000000FE000000FE000001FF000001BF000001B -F0000031F8000031F8000061FC000060FC0000E0FE0000C07E0000C07E0001803F0001FFFF0003 -FFFF8003001F8003001F8006000FC006000FC00E000FE00C0007E0FFC07FFEFFC07FFE1F1C7E9B -24>65 D<07F8201FFEE03C07E07801E07000E0F000E0F00060F00060F80000FE0000FFE0007FFE -003FFF003FFF800FFFC007FFE0007FE00003F00001F00000F0C000F0C000F0C000E0E000E0F001 -C0FC03C0EFFF0083FC00141C7D9B1B>83 D<0FF8001C1E003E0F803E07803E07C01C07C00007C0 -007FC007E7C01F07C03C07C07C07C0F807C0F807C0F807C0780BC03E13F80FE1F815127F9117> -97 DI<03FC000E0E001C1F003C1F00781F00780E00F800 -00F80000F80000F80000F80000F800007800007801803C01801C03000E0E0003F80011127E9115 ->I<1E003F003F003F003F001E00000000000000000000000000FF00FF001F001F001F001F001F -001F001F001F001F001F001F001F001F001F00FFE0FFE00B1E7F9D0E>105 -D109 D<01FC000F07801C01C03C01E07800F07800 -F0F800F8F800F8F800F8F800F8F800F8F800F87800F07800F03C01E01E03C00F078001FC001512 -7F9118>111 D114 -D<1FD830786018E018E018F000FF807FE07FF01FF807FC007CC01CC01CE01CE018F830CFC00E12 -7E9113>I<0300030003000300070007000F000F003FFCFFFC1F001F001F001F001F001F001F00 -1F001F001F0C1F0C1F0C1F0C0F08079803F00E1A7F9913>II E /Fq 19 118 df<387C7E7E3E0E1E3C7CF860070B798416>44 -DI<70F8F8F8700505788416>I<00F80003FE000FFF001F0F -803E3F803C7F8078FFC071E7C0F1C3C0E3C3C0E381C0E381C0E381C0E381C0E381C0E3C3C0F1C3 -8071E78078FF003C7E003E3C001F03C00FFFC003FF0000FC0012197E9816>64 -D<1FE0007FF8007FFC00783C00301E00000E00000E0003FE001FFE007E0E00F00E00E00E00E00E -00F01E00F83E007FFFE03FE7E00F83E013127E9116>97 D<7E0000FE00007E00000E00000E0000 -0E00000E00000E3E000EFF800FFFC00F83E00F01E00E00F00E00F00E00700E00700E00700E0070 -0E00F00F00E00F01E00F83C00FFFC00EFF00063C001419809816>I<03F80FFE1FFE3C1E780C70 -00F000E000E000E000E000F000700778073E0F1FFE0FFC03F010127D9116>I<003F00007F0000 -3F0000070000070000070000070003C7000FF7003FFF003C1F00780F00F00700F00700E00700E0 -0700E00700E00700F00700F00F00781F007C3F003FFFE01FF7F007C7E014197F9816>I<03E00F -F81FFC3C1E780E7007E007FFFFFFFFFFFFE000E000700778073C0F1FFE0FFC03F010127D9116> -I<001F00007F8000FF8001E78001C30001C00001C0007FFF00FFFF00FFFF0001C00001C00001C0 -0001C00001C00001C00001C00001C00001C00001C00001C00001C0003FFE007FFF003FFE001119 -7F9816>I<7E0000FE00007E00000E00000E00000E00000E00000E3C000EFF000FFF800F87800F -03800F03800E03800E03800E03800E03800E03800E03800E03800E03800E03807FC7F0FFE7F87F -C7F01519809816>104 D<018003C003C0018000000000000000007FC07FC07FC001C001C001C0 -01C001C001C001C001C001C001C001C001C07FFFFFFF7FFF101A7D9916>I108 -D<03E0000FF8001FFC003C1E00780F00700700E00380E00380E00380E00380E00380F007807007 -00780F003C1E001FFC000FF80003E00011127E9116>111 D<7E3E00FEFF807FFFC00F83E00F01 -E00E00F00E00F00E00700E00700E00700E00700E00F00F00E00F01E00F83C00FFFC00EFF000E3C -000E00000E00000E00000E00000E00000E00007FC000FFE0007FC000141B809116>I114 D<0FEC3FFC7FFCF03CE01CE01CF0007F801FF007 -FC003EE00EE00EF00EF81EFFFCFFF8C7E00F127D9116>I<030000070000070000070000070000 -7FFF00FFFF00FFFF00070000070000070000070000070000070000070000070100070380070380 -07078007878003FF0003FE0000F80011177F9616>I<7E1F80FE3F807E1F800E03800E03800E03 -800E03800E03800E03800E03800E03800E03800E03800E07800F0F800FFFF007FFF803E3F01512 -809116>I E /Fr 44 127 df<007E0001C1800301800703C00E03C00E01800E00000E00000E00 -000E00000E0000FFFFC00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01 -C00E01C00E01C00E01C00E01C00E01C00E01C07F87F8151D809C17>12 D16 -D<1C1C3C3870C0800707779C15>19 D<1C001E00078003C001C00380FF000A077B7E12>24 -D45 D<60F0F06004047C830C>I<030007003F00C70007000700070007 -000700070007000700070007000700070007000700070007000700070007000700070007000F80 -FFF80D1C7C9B15>49 D<07C01830201C400C400EF00FF80FF807F8077007000F000E000E001C00 -1C00380070006000C00180030006010C01180110023FFE7FFEFFFE101C7E9B15>I<0006000000 -06000000060000000F0000000F0000000F00000017800000178000001780000023C0000023C000 -0023C0000041E0000041E0000041E0000080F0000080F0000180F8000100780001FFF80003007C -0002003C0002003C0006003E0004001E0004001E000C001F001E001F00FF80FFF01C1D7F9C1F> -65 D<001F808000E0618001801980070007800E0003801C0003801C0001803800018078000080 -7800008070000080F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00000 -00700000807800008078000080380000801C0001001C0001000E000200070004000180080000E0 -3000001FC000191E7E9C1E>67 D69 D73 D76 D<003F800000E0E000038038 -0007001C000E000E001C0007003C00078038000380780003C0780003C0700001C0F00001E0F000 -01E0F00001E0F00001E0F00001E0F00001E0F00001E0F00001E0700001C0780003C0780003C038 -0003803C0007801C0007000E000E0007001C000380380000E0E000003F80001B1E7E9C20>79 -DI82 D<7FFFFFC0700F01C0600F00C0400F0040400F -0040C00F0020800F0020800F0020800F0020000F0000000F0000000F0000000F0000000F000000 -0F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000 -000F0000000F0000001F800003FFFC001B1C7F9B1E>84 DI<1FC000307000783800 -781C00301C00001C00001C0001FC000F1C00381C00701C00601C00E01C40E01C40E01C40603C40 -304E801F870012127E9115>97 DI<07E00C301878307870 -306000E000E000E000E000E000E00060007004300418080C3007C00E127E9112>I<003F000007 -0000070000070000070000070000070000070000070000070000070003E7000C1700180F003007 -00700700600700E00700E00700E00700E00700E00700E00700600700700700300700180F000C37 -0007C7E0131D7E9C17>I<03E00C301818300C700E6006E006FFFEE000E000E000E00060007002 -300218040C1803E00F127F9112>I<00F8018C071E061E0E0C0E000E000E000E000E000E00FFE0 -0E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E007FE00F1D809C0D ->I<00038003C4C00C38C01C3880181800381C00381C00381C00381C001818001C38000C300013 -C0001000003000001800001FF8001FFF001FFF803003806001C0C000C0C000C0C000C060018030 -03001C0E0007F800121C7F9215>II<18003C003C001800 -0000000000000000000000000000FC001C001C001C001C001C001C001C001C001C001C001C001C -001C001C001C001C00FF80091D7F9C0C>I<00C001E001E000C000000000000000000000000000 -000FE000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E0 -00E000E060E0F0C0F1C061803E000B25839C0D>I108 DII<03F0000E1C00180600300300700380600180E001C0E001C0E001C0 -E001C0E001C0E001C06001807003803003001806000E1C0003F00012127F9115>II<03C1000C3300180B00300F00700700700700E00700E00700E00700E00700E00700E0070060 -0700700700300F00180F000C370007C70000070000070000070000070000070000070000070000 -3FE0131A7E9116>II<1F9030704030C010C010E010F8007F803FE00FF000F880388018 -C018C018E010D0608FC00D127F9110>I<04000400040004000C000C001C003C00FFE01C001C00 -1C001C001C001C001C001C001C001C101C101C101C101C100C100E2003C00C1A7F9910>IIII<7F8FF00F03800F030007020003840001C80001D80000F00000700000780000F800009C -00010E00020E000607000403801E07C0FF0FF81512809116>II124 D<1C043F0843F080E00E047D9B15>126 D E /Fs 7 115 -df<003FC000FFF003C0F00780300F00001E00003C00003C0000780000780000780000F00000F0 -0000F00000F00000F00000F00000F00000F00000F000007800007800007800003C00003C00001E -00000F000807801803C07800FFF0003F80151F7D9D1B>67 D<003F8001FFF003C0F80780380F00 -181E00003C00003C0000780000780000780000F00000F00000F00000F00000F00000F00000F007 -F8F007F8F000387800387800387800383C00383C00381E00380F003807803803C0F801FFF0003F -80151F7D9D1C>71 D84 D<0FC03FF07FF87038401C001C001C00FC0FFC3FFC781CE0 -1CE01CE01CF07C7FFC7FDC3F1C0E127E9114>97 D<07C01FE03FF078787018601CFFFCFFFCFFFC -E000E000E000700070043C1C3FFC1FF807E00E127E9112>101 D<00FC01FC03FC07000E000E00 -0E000E000E000E000E00FFE0FFE00E000E000E000E000E000E000E000E000E000E000E000E000E -000E000E000E000E1D809C0D>I114 D E /Ft 31 123 df<70F8FCFC74040404040808 -10102040060F7C840E>44 D<008003800F80F38003800380038003800380038003800380038003 -800380038003800380038003800380038003800380038003800380038003800380038007C0FFFE -0F217CA018>49 D<1000801E07001FFF001FFE001FF80013E00010000010000010000010000010 -000010000010F800130E001407001803801003800001C00001C00001E00001E00001E00001E070 -01E0F001E0F001E0E001C08001C04003C04003802007001006000C1C0003F00013227EA018>53 -D<01F800060E000803001001802001802000C06000C06000C06000C07000C07801803E01003F02 -001FC4000FF80003F80003FC00067F00083F80100F803007C06001C06000E0C000E0C00060C000 -60C00060C000606000406000C03000801803000E0E0003F00013227EA018>56 -D<01F000060C000C0600180700380380700380700380F001C0F001C0F001C0F001E0F001E0F001 -E0F001E0F001E07001E07003E03803E01805E00C05E00619E003E1E00001C00001C00001C00003 -80000380300300780700780600700C002018001030000FC00013227EA018>I<0007E010003818 -3000E0063001C00170038000F0070000F00E0000701E0000701C0000303C0000303C0000307C00 -00107800001078000010F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8 -00000078000000780000107C0000103C0000103C0000101C0000201E0000200E00004007000040 -0380008001C0010000E0020000381C000007E0001C247DA223>67 D70 D72 D -I76 D82 D87 -D<0FE0001838003C0C003C0E0018070000070000070000070000FF0007C7001E07003C07007807 -00700700F00708F00708F00708F00F087817083C23900FC1E015157E9418>97 -D<0E0000FE00001E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00 -000E00000E1F000E61C00E80600F00300E00380E003C0E001C0E001E0E001E0E001E0E001E0E00 -1E0E001E0E001E0E001C0E003C0E00380F00700C80600C41C0083F0017237FA21B>I<01FE0007 -03000C07801C0780380300780000700000F00000F00000F00000F00000F00000F00000F0000070 -00007800403800401C00800C010007060001F80012157E9416>I<0000E0000FE00001E00000E0 -0000E00000E00000E00000E00000E00000E00000E00000E00000E00000E001F8E00704E00C02E0 -1C01E03800E07800E07000E0F000E0F000E0F000E0F000E0F000E0F000E0F000E07000E07800E0 -3800E01801E00C02E0070CF001F0FE17237EA21B>I<01FC000707000C03801C01C03801C07801 -E07000E0F000E0FFFFE0F00000F00000F00000F00000F000007000007800203800201C00400E00 -8007030000FC0013157F9416>I<00007001F198071E180E0E181C07001C07003C07803C07803C -07803C07801C07001C07000E0E000F1C0019F0001000001000001800001800001FFE000FFFC00F -FFE03800F0600030400018C00018C00018C000186000306000303800E00E038003FE0015217F95 -18>103 D<0E0000FE00001E00000E00000E00000E00000E00000E00000E00000E00000E00000E -00000E00000E00000E1F800E60C00E80E00F00700F00700E00700E00700E00700E00700E00700E -00700E00700E00700E00700E00700E00700E00700E00700E00700E0070FFE7FF18237FA21B>I< -1C001E003E001E001C00000000000000000000000000000000000E00FE001E000E000E000E000E -000E000E000E000E000E000E000E000E000E000E000E000E000E00FFC00A227FA10E>I<0E00FE -001E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E00 -0E000E000E000E000E000E000E000E000E000E000E000E000E00FFE00B237FA20E>108 -D<0E1FC07F00FE60E183801E807201C00F003C00E00F003C00E00E003800E00E003800E00E0038 -00E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E00 -3800E00E003800E00E003800E00E003800E00E003800E0FFE3FF8FFE27157F942A>I<0E1F80FE -60C01E80E00F00700F00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E -00700E00700E00700E00700E00700E0070FFE7FF18157F941B>I<01FC000707000C01801800C0 -3800E0700070700070F00078F00078F00078F00078F00078F00078F000787000707800F03800E0 -1C01C00E038007070001FC0015157F9418>I<01F8200704600E02601C01603801E07800E07800 -E0F000E0F000E0F000E0F000E0F000E0F000E0F000E07000E07800E03801E01C01E00C02E0070C -E001F0E00000E00000E00000E00000E00000E00000E00000E00000E00000E0000FFE171F7E941A ->113 D<0E3CFE461E8F0F0F0F060F000E000E000E000E000E000E000E000E000E000E000E000E -000E000F00FFF010157F9413>I<0F8830786018C018C008C008E008F0007F803FE00FF001F800 -3C801C800C800CC00CC008E018D0308FC00E157E9413>I<02000200020002000600060006000E -001E003E00FFF80E000E000E000E000E000E000E000E000E000E000E000E040E040E040E040E04 -0E040708030801F00E1F7F9E13>I<0E0070FE07F01E00F00E00700E00700E00700E00700E0070 -0E00700E00700E00700E00700E00700E00700E00700E00700E00F00E00F006017003827800FC7F -18157F941B>I121 -D<3FFFC0380380300780200700600E00401C00403C0040380000700000E00001E00001C0000380 -400700400F00400E00C01C0080380080780180700780FFFF8012157F9416>I -E /Fu 21 118 df<78FCFCFCFC7806067A8512>46 D<00080000380000780001F8003FF800FE78 -00C078000078000078000078000078000078000078000078000078000078000078000078000078 -000078000078000078000078000078000078000078000078000078000078000078000078000078 -0000780000780000780000780000780000780000780000780000780000780000780000780000FC -007FFFF87FFFF8152F7AAE21>49 D<007F800001FFF0000701F8000C007E0018003F0010001F00 -20000F8040000FC0400007C0400007E0B00007E0F80003E0FC0003E0FC0003E0FC0003E0780007 -E0000007E0000007C0000007C000000F8000000F8000001F0000001F0000003E0000003C000000 -78000000F0000000E0000001C0000003800000070000000E0000001C0000001800000030000000 -60000000C000200180002003000020060000400C00004008000040100000C03FFFFFC07FFFFF80 -FFFFFF80FFFFFF801B2F7DAE21>I76 -DI< -FFFFFFC000FFFFFFF80007E000FE0003E0001F0003E0000F8003E00007C003E00003E003E00003 -F003E00001F003E00001F003E00001F803E00001F803E00001F803E00001F803E00001F803E000 -01F803E00001F003E00001F003E00003E003E00003E003E00007C003E0000F8003E0001F0003E0 -00FC0003FFFFF00003E000000003E000000003E000000003E000000003E000000003E000000003 -E000000003E000000003E000000003E000000003E000000003E000000003E000000003E0000000 -03E000000003E000000003E000000003E000000003E000000003E000000003E000000007F00000 -00FFFF800000FFFF80000025317CB02D>80 D82 D<00FE00000303C0000C00E00010007000100038003C003C00 -3E001C003E001E003E001E0008001E0000001E0000001E0000001E00000FFE0000FC1E0003E01E -000F801E001F001E003E001E003C001E007C001E00F8001E04F8001E04F8001E04F8003E04F800 -3E0478003E047C005E043E008F080F0307F003FC03E01E1F7D9E21>97 D<003F8000E060038018 -0700040F00041E001E1C003E3C003E7C003E7C0008780000F80000F80000F80000F80000F80000 -F80000F80000F80000F800007800007C00007C00003C00011E00011E00020F0002070004038018 -00E060003F80181F7D9E1D>99 D<003F800000E0E0000380380007003C000E001E001E001E001C -000F003C000F007C000F0078000F8078000780F8000780F8000780FFFFFF80F8000000F8000000 -F8000000F8000000F8000000F8000000780000007C0000003C0000003C0000801E0000800E0001 -000F0002000780020001C00C0000F03000001FC000191F7E9E1D>101 D<0007E0001C10003838 -00707C00E07C01E07C01C03803C00003C00003C00003C00003C00003C00003C00003C00003C000 -03C00003C00003C000FFFFC0FFFFC003C00003C00003C00003C00003C00003C00003C00003C000 -03C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C000 -03C00003C00003C00003C00003C00007E0007FFF007FFF0016327FB114>I<000000F0007F0308 -01C1C41C0380E81C070070080F0078001E003C001E003C003E003E003E003E003E003E003E003E -003E003E003E003E001E003C001E003C000F007800070070000780E00009C1C000087F00001800 -0000180000001800000018000000180000001C0000000E0000000FFFF80007FFFF0003FFFF800E -000FC0180001E0300000F070000070E0000038E0000038E0000038E0000038E000003870000070 -70000070380000E01C0001C00700070001C01C00003FE0001E2F7E9F21>I<01800000003F8000 -0000FF80000000FF800000000F8000000007800000000780000000078000000007800000000780 -000000078000000007800000000780000000078000000007800000000780000000078000000007 -8000000007800000000780FE00000783078000078C03C000079001E00007A001E00007A000F000 -07C000F00007C000F000078000F000078000F000078000F000078000F000078000F000078000F0 -00078000F000078000F000078000F000078000F000078000F000078000F000078000F000078000 -F000078000F000078000F000078000F000078000F000078000F000078000F0000FC001F800FFFC -1FFF80FFFC1FFF8021327EB125>I<07000F801F801F800F800700000000000000000000000000 -0000000000000000000001801F80FF80FF800F8007800780078007800780078007800780078007 -8007800780078007800780078007800780078007800780078007800FC0FFF8FFF80D307EAF12> -I<01803F80FF80FF800F8007800780078007800780078007800780078007800780078007800780 -078007800780078007800780078007800780078007800780078007800780078007800780078007 -80078007800780078007800780078007800FC0FFFCFFFC0E327EB112>108 -D<0180FE001FC0003F83078060F000FF8C03C1807800FF9001E2003C000FA001E4003C0007A000 -F4001E0007C000F8001E0007C000F8001E00078000F0001E00078000F0001E00078000F0001E00 -078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0 -001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E0007 -8000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F000 -1E000FC001F8003F00FFFC1FFF83FFF0FFFC1FFF83FFF0341F7E9E38>I<0180FE00003F830780 -00FF8C03C000FF9001E0000FA001E00007A000F00007C000F00007C000F000078000F000078000 -F000078000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 -00F000078000F000078000F000078000F000078000F000078000F000078000F000078000F00007 -8000F000078000F000078000F0000FC001F800FFFC1FFF80FFFC1FFF80211F7E9E25>I<001FC0 -0000F0780001C01C00070007000F0007801E0003C01C0001C03C0001E03C0001E0780000F07800 -00F0780000F0F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F8F80000F878 -0000F07C0001F03C0001E03C0001E01E0003C01E0003C00F00078007800F0001C01C0000F07800 -001FC0001D1F7E9E21>I<0183E03F8C18FF907CFF907C0FA07C07C03807C00007C00007C00007 -800007800007800007800007800007800007800007800007800007800007800007800007800007 -80000780000780000780000780000780000FC000FFFE00FFFE00161F7E9E19>114 -D<00400000400000400000400000400000C00000C00000C00001C00001C00003C00007C0000FC0 -001FFFE0FFFFE003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C0 -0003C00003C00003C00003C00003C00003C01003C01003C01003C01003C01003C01003C01003C0 -1001C02001E02000E0400078C0001F00142C7FAB19>116 D<01800030003F8007F000FF801FF0 -00FF801FF0000F8001F000078000F000078000F000078000F000078000F000078000F000078000 -F000078000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 -00F000078000F000078000F000078000F000078000F000078001F000078001F000078001F00003 -8002F00003C004F00001C008F800007030FF80001FC0FF80211F7E9E25>I -E end -%%EndProlog -%%BeginSetup -%%Feature: *Resolution 300 -TeXDict begin @a4 /a4 where {pop a4} if -%%EndSetup -%%Page: 1 1 -bop 96 342 a Fu(Reference)22 b(Man)n(ual)f(of)g(the)h(Programming)e(Language) -h(Lua)h(2.1)87 468 y Ft(Rob)q(erto)17 b(Ierusalimsc)o(h)o(y)46 -b(Luiz)16 b(Henrique)e(de)i(Figueiredo)48 b(W)l(aldemar)15 -b(Celes)h(Filho)736 548 y Fs(T)m(eC)797 561 y(Graf)885 548 -y Fr(|)e(PUC-Rio)562 606 y Fq(roberto,lhf,cele)o(s@ica)o(d.puc)o(-rio)o(.br) -741 720 y Ft(F)l(ebruary)i(8,)h(1995)830 888 y Fp(Abstract)102 -963 y Fr(Lua)12 b(is)g(an)f(extension)i(programming)c(language)i(designed)h -(to)g(b)q(e)h(used)g(as)f(a)g(con\014guration)g(language)102 -1013 y(for)h(an)o(y)g(program)f(that)i(needs)h(one.)j(This)13 -b(do)q(cumen)o(t)g(describ)q(es)j(v)o(ersion)e(2.1)e(of)h(the)h(Lua)f -(program-)102 1063 y(ming)g(language)h(and)g(the)i(API)f(that)g(allo)o(ws)f -(in)o(teraction)g(b)q(et)o(w)o(een)j(Lua)d(programs)g(and)h(its)g(host)g(C) -102 1113 y(program.)h(It)e(also)f(presen)o(ts)j(some)d(examples)g(of)h(using) -f(the)i(main)c(features)k(of)f(the)g(system.)869 1328 y Fp(Sum\023)-24 -b(ario)102 1396 y Fr(Lua)9 b(\023)-20 b(e)11 b(uma)d(linguagem)g(de)j -(extens~)-21 b(ao)11 b(pro)r(jetada)f(para)h(ser)g(usada)f(como)f(linguagem)f -(de)j(con\014gura\030)-18 b(c~)d(ao)102 1446 y(em)19 b(qualquer)h(programa)f -(que)h(precise)i(de)f(uma.)35 b(Este)21 b(do)q(cumen)o(to)f(descrev)o(e)i(a)e -(v)o(ers~)-21 b(ao)21 b(2.1)e(da)102 1496 y(linguagem)f(de)i(programa\030)-18 -b(c~)d(ao)19 b(Lua)h(e)h(a)f(In)o(terface)h(de)g(Programa\030)-18 -b(c~)d(ao)19 b(que)i(p)q(ermite)f(a)g(in)o(tera\030)-18 b(c~)d(ao)102 -1545 y(en)o(tre)15 b(programas)e(Lua)h(e)h(o)f(programa)e(C)j(hosp)q(edeiro.) -20 b(O)14 b(do)q(cumen)o(to)g(tam)o(b)o(\023)-20 b(em)12 b(apresen)o(ta)j -(alguns)102 1595 y(exemplos)e(de)h(uso)g(das)g(principais)g(caracter)-5 -b(\023)-16 b(\020sticas)15 b(do)f(sistema.)-12 1738 y Fo(1)69 -b(In)n(tro)r(duction)-12 1840 y Fn(Lua)18 b(is)f(an)g(extension)h -(programming)f(language)g(designed)i(to)d(supp)q(ort)h(general)h(pro)q -(cedural)g(program-)-12 1896 y(ming)j(features)f(with)g(data)g(description)h -(facilities.)37 b(It)20 b(is)h(supp)q(osed)g(to)f(b)q(e)h(used)f(as)g(a)g -(con\014guration)-12 1953 y(language)e(for)f(an)o(y)g(program)f(that)h(needs) -h(one.)27 b(Its)18 b(main)g(extensions)g(are)f(related)h(to)f(ob)s -(ject-orien)o(ted)-12 2009 y(facilities,)f(and)e(fallbac)o(ks,)g(but)g(it)g -(has)g(some)g(other)f(minor)h(con)o(tributions.)20 b(Lua)14 -b(has)g(b)q(een)h(designed)g(and)-12 2066 y(implemen)o(ted)i(b)o(y)e(W.)g -(Celes)h(F.,)e(L.)h(H.)g(de)g(Figueiredo)i(and)e(R.)g(Ierusalimsc)o(h)o(y)l -(.)59 2122 y(Lua)k(is)g(implemen)o(ted)h(as)e(a)g(library)l(,)i(written)f(in) -g(C.)f(Being)h(an)g(extension)g(language,)g(Lua)g(has)f(no)-12 -2179 y(notion)i(of)f(a)g(\\main")g(program:)28 b(it)19 b(only)h(w)o(orks)f -Fm(emb)n(e)n(dde)n(d)g Fn(in)h(a)f(host)g(clien)o(t,)j(called)f(the)e -Fm(emb)n(e)n(dding)-12 2235 y Fn(program.)g(This)c(host)g(program)e(can)i(in) -o(v)o(ok)o(e)g(functions)h(to)e(execute)h(a)g(piece)h(of)e(co)q(de)i(in)f -(Lua,)g(can)g(write)-12 2291 y(and)i(read)g(Lua)h(v)m(ariables,)g(and)f(can)g -(register)g(C)g(functions)h(to)e(b)q(e)i(called)g(b)o(y)f(Lua)h(co)q(de.)25 -b(Through)17 b(the)-12 2348 y(use)d(of)g(C)f(functions,)i(Lua)f(can)g(b)q(e)h -(augmen)o(ted)e(to)g(cop)q(e)i(with)f(rather)f(di\013eren)o(t)h(domains,)g -(th)o(us)g(creating)-12 2404 y(customized)i(programming)f(languages)g -(sharing)h(a)f(syn)o(tactical)g(framew)o(ork.)59 2461 y(Lua)k(is)g(free)g -(distribution)h(soft)o(w)o(are,)e(and)h(pro)o(vided)g(as)g(usual)g(with)g(no) -g(guaran)o(tees.)30 b(The)19 b(imple-)-12 2517 y(men)o(tation)c(describ)q(ed) -i(in)f(this)g(man)o(ual)f(is)h(a)o(v)m(ailable)h(b)o(y)e(anon)o(ymous)g(ftp)g -(from)60 2611 y Fl(ftp.icad.puc-rio.br:/pub)o(/lua/lua)o(-2.1.ta)o(r.Z)-12 -2705 y Fn(or)g(b)o(y)g(WWW)f(\(W)l(orld)h(Wide)h(W)l(eb\))g(from)60 -2799 y Fl(http://www.inf.puc-rio.b)o(r/projet)o(os/robe)o(rto/lua)o(.html)910 -2976 y Fn(1)p eop -%%Page: 2 2 -bop -12 160 a Fo(2)69 b(En)n(vironmen)n(t)21 b(and)i(Mo)r(dules)-12 -261 y Fn(All)15 b(statemen)o(ts)d(in)j(Lua)e(are)h(executed)g(in)g(a)f -Fm(glob)n(al)h(envir)n(onment)t Fn(.)k(This)d(en)o(vironmen)o(t,)e(whic)o(h)i -(k)o(eeps)e(all)-12 318 y(global)19 b(v)m(ariables)g(and)f(functions,)g(is)h -(initialized)i(at)c(the)h(b)q(eginning)i(of)d(the)h(em)o(b)q(edding)h -(program)e(and)-12 374 y(p)q(ersists)f(un)o(til)g(its)g(end.)59 -430 y(The)i(global)g(en)o(vironmen)o(t)g(can)g(b)q(e)g(manipulated)i(b)o(y)d -(Lua)h(co)q(de)h(or)e(b)o(y)h(the)f(em)o(b)q(edding)j(program,)-12 -487 y(whic)o(h)c(can)g(read)f(and)g(write)g(global)h(v)m(ariables)h(using)f -(functions)g(in)g(the)f(library)h(that)e(implemen)o(ts)j(Lua.)59 -543 y(Global)22 b(v)m(ariables)g(do)f(not)g(need)h(declaration.)39 -b(An)o(y)22 b(v)m(ariable)g(is)g(assumed)g(to)e(b)q(e)i(global)g(unless)-12 -600 y(explicitly)17 b(declared)f(lo)q(cal)g(\(see)e(lo)q(cal)h(declarations,) -g(Section)h(4.4.5\).)h(Before)e(the)f(\014rst)g(assignmen)o(t,)g(the)-12 -656 y(v)m(alue)j(of)d(a)h(global)h(v)m(ariable)h(is)e Fk(nil)p -Fn(.)59 713 y(The)g(unit)h(of)f(execution)h(of)f(Lua)h(is)f(called)i(a)e -Fm(mo)n(dule)s Fn(.)20 b(The)c(syn)o(tax)e(for)h(mo)q(dules)h(is:)1563 -696 y Fj(1)72 785 y Fm(mo)n(dule)50 b Fi(!)g(f)p Fm(statement)32 -b Fi(j)16 b Fm(function)s Fi(g)-12 857 y Fn(A)f(mo)q(dule)h(ma)o(y)f(con)o -(tain)g(statemen)o(ts)f(and)h(function)g(de\014nitions,)i(and)e(ma)o(y)f(b)q -(e)i(in)g(a)e(\014le)i(or)f(in)h(a)e(string)-12 913 y(inside)i(the)f(host)f -(program.)k(When)d(a)f(mo)q(dule)i(is)f(executed,)g(\014rst)f(all)h(its)g -(functions)g(and)f(statemen)o(ts)g(are)-12 970 y(compiled,)g(and)f(the)f -(functions)h(added)g(to)f(the)g(global)h(en)o(vironmen)o(t;)g(then)g(the)f -(statemen)o(ts)f(are)h(executed)-12 1026 y(in)k(sequen)o(tial)g(order.)k(All) -d(mo)q(di\014cations)f(a)f(mo)q(dule)h(e\013ects)f(on)g(the)g(global)h(en)o -(vironmen)o(t)f(p)q(ersist)h(after)-12 1083 y(its)g(end.)k(Those)15 -b(include)j(mo)q(di\014cations)e(to)f(global)g(v)m(ariables)i(and)e -(de\014nitions)i(of)e(new)g(functions)1736 1066 y Fj(2)1757 -1083 y Fn(.)-12 1226 y Fo(3)69 b(T)n(yp)r(es)-12 1327 y Fn(Lua)16 -b(is)h(a)e(dynamically)j(t)o(yp)q(ed)e(language.)22 b(V)l(ariables)17 -b(do)f(not)f(ha)o(v)o(e)g(t)o(yp)q(es;)h(only)g(v)m(alues)h(do.)22 -b(All)17 b(v)m(alues)-12 1384 y(carry)e(their)h(o)o(wn)e(t)o(yp)q(e.)20 -b(Therefore,)15 b(there)g(are)g(no)g(t)o(yp)q(e)g(de\014nitions)i(in)f(the)g -(language.)59 1440 y(There)e(are)f(sev)o(en)i(basic)f(t)o(yp)q(es)g(in)h -(Lua:)k Fm(nil)p Fn(,)13 b Fm(numb)n(er)p Fn(,)g Fm(string)p -Fn(,)g Fm(function)p Fn(,)h Fm(CF)m(unction)p Fn(,)e Fm(user)n(data)p -Fn(,)i(and)-12 1497 y Fm(table)p Fn(.)25 b Fm(Nil)16 b Fn(is)h(the)g(t)o(yp)q -(e)g(of)g(the)g(v)m(alue)h Fk(nil)p Fn(,)g(whose)f(main)g(prop)q(ert)o(y)g -(is)g(to)f(b)q(e)i(di\013eren)o(t)f(from)f(an)o(y)h(other)-12 -1553 y(v)m(alue.)k Fm(Numb)n(er)15 b Fn(represen)o(ts)h(real)f(\(\015oating)g -(p)q(oin)o(t\))g(n)o(um)o(b)q(ers,)g(while)i Fm(string)d Fn(has)i(the)f -(usual)h(meaning.)59 1610 y(F)l(unctions)f(are)e(considered)j(\014rst-class)e -(v)m(alues)i(in)f(Lua.)k(This)c(means)f(that)g(functions)h(can)f(b)q(e)h -(stored)-12 1666 y(in)h(v)m(ariables,)g(passed)f(as)f(argumen)o(ts)g(to)h -(other)f(functions)i(and)f(returned)g(as)g(results.)20 b(When)15 -b(a)f(function)-12 1723 y(is)j(de\014ned)h(in)g(Lua,)e(its)h(b)q(o)q(dy)h(is) -f(compiled)h(and)f(stored)f(in)h(a)f(giv)o(en)h(v)m(ariable.)26 -b(Lua)17 b(can)f(call)i(\(and)f(ma-)-12 1779 y(nipulate\))e(functions)g -(written)f(in)h(Lua)f(and)g(functions)h(written)f(in)g(C;)g(the)g(latter)f -(ha)o(v)o(e)h(t)o(yp)q(e)g Fm(CF)m(unction)s Fn(.)59 1836 y(The)i(t)o(yp)q(e) -g Fm(user)n(data)h Fn(is)f(pro)o(vided)h(to)e(allo)o(w)i(arbitrary)e(C)h(p)q -(oin)o(ters)g(to)g(b)q(e)h(stored)e(in)i(Lua)f(v)m(ariables.)-12 -1892 y(It)21 b(corresp)q(onds)f(to)g Fl(void*)g Fn(and)g(has)g(no)h -(pre-de\014ned)h(op)q(erations)e(in)h(Lua,)h(b)q(esides)g(assignmen)o(t)e -(and)-12 1948 y(equalit)o(y)15 b(test.)k(Ho)o(w)o(ev)o(er,)13 -b(b)o(y)h(using)h(fallbac)o(ks,)f(the)h(programmer)d(ma)o(y)i(de\014ne)h(op)q -(erations)f(for)g Fm(user)n(data)-12 2005 y Fn(v)m(alues;)i(see)g(Section)g -(4.7.)59 2061 y(The)d(t)o(yp)q(e)h Fm(table)e Fn(implemen)o(ts)j(asso)q -(ciativ)o(e)e(arra)o(ys,)f(that)h(is,)h(arra)o(ys)e(whic)o(h)i(can)f(b)q(e)h -(indexed)h(not)e(only)-12 2118 y(with)20 b(n)o(um)o(b)q(ers,)g(but)f(with)g -(an)o(y)g(v)m(alue)h(\(except)g Fk(nil)p Fn(\).)32 b(Therefore,)19 -b(this)h(t)o(yp)q(e)f(ma)o(y)g(b)q(e)g(used)h(not)f(only)-12 -2174 y(to)c(represen)o(t)h(ordinary)g(arra)o(ys,)e(but)h(also)h(sym)o(b)q(ol) -g(tables,)g(sets,)f(records,)g(etc.)21 b(T)l(o)16 b(represen)o(t)f(a)h -(record,)-12 2231 y(Lua)h(uses)f(the)g(\014eld)i(name)e(as)g(an)g(index.)24 -b(The)17 b(language)f(supp)q(orts)g(this)h(represen)o(tation)f(b)o(y)g(pro)o -(viding)-12 2287 y Fl(a.name)f Fn(as)h(syn)o(tactic)g(sugar)g(for)f -Fl(a["name"])p Fn(.)22 b(T)l(ables)17 b(ma)o(y)e(also)h(carry)g(metho)q(ds.) -23 b(Because)17 b(functions)-12 2344 y(are)g(\014rst)g(class)h(v)m(alues,)h -(table)f(\014elds)g(ma)o(y)f(con)o(tain)h(functions.)27 b(The)17 -b(form)g Fl(t:f\(x\))g Fn(is)h(syn)o(tactic)f(sugar)-12 2400 -y(for)e Fl(t.f\(t,x\))p Fn(,)e(whic)o(h)j(calls)h(the)e(metho)q(d)g -Fl(f)g Fn(from)g(the)g(table)h Fl(t)f Fn(passing)g(itself)i(as)d(the)i -(\014rst)e(parameter.)59 2457 y(It)i(is)g(imp)q(ortan)o(t)f(to)g(notice)i -(that)e(tables)h(are)f(ob)s(jects,)g(and)h(not)f(v)m(alues.)23 -b(V)l(ariables)17 b(cannot)e(con)o(tain)-12 2513 y(tables,)e(only)h -(references)f(to)f(them.)19 b(Assignmen)o(t,)13 b(parameter)f(passing)i(and)e -(returns)h(alw)o(a)o(ys)f(manipulate)-12 2569 y(references)18 -b(to)f(tables,)h(and)f(do)h(not)f(imply)h(an)o(y)f(kind)i(of)e(cop)o(y)l(.)26 -b(Moreo)o(v)o(er,)16 b(tables)i(m)o(ust)e(b)q(e)j(explicitly)-12 -2626 y(created)c(b)q(efore)h(used;)f(see)h(Section)g(4.5.7.)p --12 2665 747 2 v 40 2692 a Fh(1)57 2708 y Fg(As)d(usual,)h -Ff(f)p Fe(a)s Ff(g)f Fg(means)g(0)g(or)h(more)f Fe(a)s Fg('s,)e([)p -Fe(a)s Fg(])h(means)i(an)f(optional)i Fe(a)e Fg(and)g Ff(f)p -Fe(a)s Ff(g)1208 2692 y Fh(+)1247 2708 y Fg(means)g(one)g(or)g(more)h -Fe(a)s Fg('s.)40 2738 y Fh(2)57 2754 y Fg(Actually)m(,)g(a)f(function)i -(de\014nition)h(is)d(an)g(assignmen)o(t)i(to)e(a)g(global)i(v)n(ariable;)g -(see)e(Section)i(3.)910 2976 y Fn(2)p eop -%%Page: 3 3 -bop -12 160 a Fo(4)69 b(The)23 b(Language)-12 261 y Fn(This)16 -b(section)g(describ)q(es)h(the)e(lexis,)h(syn)o(tax)e(and)i(seman)o(tics)f -(of)g(Lua.)-12 383 y Fd(4.1)56 b(Lexical)17 b(Con)n(v)n(en)n(tions)-12 -469 y Fn(Lua)c(is)g(a)f(case)g(sensitiv)o(e)i(language.)19 -b(Iden)o(ti\014ers)14 b(can)e(b)q(e)h(an)o(y)f(string)h(of)f(letters,)g -(digits,)i(and)e(underscores,)-12 525 y(not)h(b)q(eginning)h(with)f(a)g -(digit.)20 b(The)13 b(follo)o(wing)g(w)o(ords)f(are)h(reserv)o(ed,)g(and)g -(cannot)f(b)q(e)h(used)h(as)e(iden)o(ti\014ers:)203 619 y Fl(and)143 -b(do)190 b(else)143 b(elseif)95 b(end)203 675 y(function)23 -b(if)190 b(local)119 b(nil)167 b(not)203 732 y(or)g(repeat)94 -b(return)h(until)119 b(then)95 b(while)59 826 y Fn(The)15 b(follo)o(wing)h -(strings)f(denote)h(other)e(tok)o(ens:)203 919 y Fl(~=)47 b(<=)h(>=)f(<)72 -b(>)f(==)48 b(=)71 b(..)48 b(+)71 b(-)g(*)h(/)203 976 y(\045)f(\()h(\))f({)h -(})f([)h(])f(;)h(,)f(.)59 1070 y Fn(Literal)17 b(strings)f(can)h(b)q(e)g -(delimited)h(b)o(y)f(matc)o(hing)f(single)i(or)d(double)j(quotes,)e(and)g -(can)h(con)o(tain)f(the)-12 1126 y(C-lik)o(e)f(escap)q(e)g(sequences)g -Fl('\\n')p Fn(,)e Fl('\\t')h Fn(and)g Fl('\\r')p Fn(.)19 b(Commen)o(ts)13 -b(start)g(an)o(ywhere)h(outside)g(a)g(string)g(with)-12 1183 -y(a)h(double)i(h)o(yphen)f(\()p Fl(--)p Fn(\))e(and)h(run)h(un)o(til)g(the)f -(end)h(of)f(the)g(line.)59 1239 y(Numerical)e(constan)o(ts)e(ma)o(y)g(b)q(e)h -(written)g(with)g(an)f(optional)h(decimal)i(part,)d(and)h(an)g(optional)g -(decimal)-12 1296 y(exp)q(onen)o(t.)21 b(Examples)15 b(of)g(v)m(alid)i(n)o -(umerical)f(constan)o(ts)f(are:)155 1389 y Fl(4)119 b(4.)g(.4)g(4.57e-3)g -(.3e12)-12 1511 y Fd(4.2)56 b(Co)r(ercion)-12 1597 y Fn(Lua)17 -b(pro)o(vides)g(some)g(automatic)f(con)o(v)o(ersions.)24 b(An)o(y)17 -b(arithmetic)g(op)q(eration)g(applied)i(to)d(a)g(string)h(tries)-12 -1653 y(to)12 b(con)o(v)o(ert)g(that)g(string)g(to)g(a)g(n)o(um)o(b)q(er,)h -(follo)o(wing)g(the)g(usual)g(rules.)20 b(Con)o(v)o(ersely)l(,)13 -b(whenev)o(er)g(a)f(n)o(um)o(b)q(er)h(is)-12 1710 y(used)h(when)f(a)f(string) -h(is)g(exp)q(ected,)i(that)d(n)o(um)o(b)q(er)h(is)g(con)o(v)o(erted)g(to)f(a) -g(string,)h(according)h(to)e(the)h(follo)o(wing)-12 1766 y(rule:)20 -b(if)15 b(the)f(n)o(um)o(b)q(er)h(is)g(an)f(in)o(teger,)g(it)h(is)f(written)h -(without)f(exp)q(onen)o(t)h(or)e(decimal)j(p)q(oin)o(t;)f(otherwise,)f(it)-12 -1823 y(is)i(formatted)e(follo)o(wing)i(the)f(\\)p Fl(\045g)p -Fn(")f(con)o(v)o(ersion)i(sp)q(eci\014cation)h(of)e(the)g(standard)g -Fl(printf)f Fn(C)h(function.)-12 1944 y Fd(4.3)56 b(Adjustmen)n(t)-12 -2030 y Fn(F)l(unctions)16 b(in)h(Lua)e(can)h(return)f(man)o(y)g(v)m(alues.)22 -b(Because)16 b(there)f(are)h(no)f(t)o(yp)q(e)g(declarations,)h(the)g(system) --12 2087 y(do)q(es)21 b(not)f(kno)o(w)g(ho)o(w)g(man)o(y)g(v)m(alues)i(a)e -(function)h(will)h(return,)g(or)e(ho)o(w)g(man)o(y)g(parameters)f(it)i -(needs.)-12 2143 y(Therefore,)14 b(sometimes,)f(a)h(list)g(of)f(v)m(alues)i -(m)o(ust)e(b)q(e)h Fm(adjuste)n(d)5 b Fn(,)14 b(at)f(run)h(time,)g(to)f(a)g -(giv)o(en)h(length.)20 b(If)14 b(there)-12 2200 y(are)19 b(more)g(v)m(alues)i -(than)e(are)g(needed,)i(the)f(last)f(v)m(alues)i(are)e(thro)o(wn)f(a)o(w)o(a) -o(y)l(.)31 b(If)20 b(there)f(are)h(more)e(needs)-12 2256 y(than)d(v)m(alues,) -h(the)g(list)g(is)g(extended)g(with)g(as)f(man)o(y)f Fk(nil)p -Fn('s)i(as)f(needed.)22 b(Adjustmen)o(t)15 b(o)q(ccurs)g(in)h(m)o(ultiple)-12 -2312 y(assignmen)o(t)f(and)h(function)g(calls.)-12 2434 y Fd(4.4)56 -b(Statemen)n(ts)-12 2520 y Fn(Lua)18 b(supp)q(orts)f(an)g(almost)f(con)o(v)o -(en)o(tional)i(set)e(of)h(statemen)o(ts.)24 b(The)18 b(con)o(v)o(en)o(tional) -f(commands)g(include)-12 2576 y(assignmen)o(t,)d(con)o(trol)h(structures)f -(and)h(pro)q(cedure)g(calls.)21 b(Non-con)o(v)o(en)o(tional)15 -b(commands)g(include)i(table)-12 2633 y(constructors,)d(explained)j(in)f -(Section)h(4.5.7,)c(and)i(lo)q(cal)h(v)m(ariable)h(declarations.)910 -2976 y(3)p eop -%%Page: 4 4 -bop -12 160 a Fk(4.4.1)52 b(Blo)q(c)o(ks)-12 245 y Fn(A)13 -b(blo)q(c)o(k)g(is)g(a)f(list)i(of)e(statemen)o(ts,)g(executed)h(sequen)o -(tially)l(.)21 b(An)o(y)13 b(statemen)o(t)e(can)i(b)q(e)g(optionally)h(follo) -o(w)o(ed)-12 302 y(b)o(y)h(a)g(semicolon.)72 370 y Fm(blo)n(ck)49 -b Fi(!)h(f)p Fm(stat)16 b(sc)s Fi(g)f Fn([)p Fm(r)n(et)h(sc)s -Fn(])128 427 y Fm(sc)49 b Fi(!)h Fn([';'])-12 495 y(F)l(or)14 -b(syn)o(tactic)h(reasons,)e(a)i(return)f(statemen)o(t)g(can)g(only)h(b)q(e)g -(written)g(as)f(the)h(last)f(statemen)o(t)g(of)g(a)g(blo)q(c)o(k.)-12 -551 y(This)i(restriction)g(also)f(a)o(v)o(oids)g(some)g(\\statemen)o(t)e(not) -i(reac)o(hed")g(errors.)-12 671 y Fk(4.4.2)52 b(Assignmen)n(t)-12 -757 y Fn(The)17 b(language)g(allo)o(ws)g(m)o(ultiple)i(assignmen)o(t.)24 -b(Therefore,)17 b(the)g(syn)o(tax)f(de\014nes)i(a)e(list)i(of)e(v)m(ariables) -i(on)-12 814 y(the)13 b(left)g(side,)g(and)g(a)f(list)i(of)e(expressions)h -(on)g(the)f(righ)o(t)h(side.)20 b(Both)12 b(lists)h(ha)o(v)o(e)f(their)h -(elemen)o(ts)h(separated)-12 870 y(b)o(y)h(commas.)146 938 -y Fm(stat)49 b Fi(!)i Fm(varlist1)16 b Fn('=')g Fm(explist1)72 -995 y(varlist1)49 b Fi(!)i Fm(var)16 b Fi(f)p Fn(',')f Fm(var)5 -b Fi(g)-12 1063 y Fn(This)16 b(statemen)o(t)d(\014rst)i(ev)m(aluates)g(all)h -(v)m(alues)g(on)e(the)h(righ)o(t)g(side)g(and)g(ev)o(en)o(tual)g(indices)i -(on)e(the)g(left)g(side,)-12 1119 y(and)h(then)f(mak)o(es)g(the)g(assignmen)o -(ts.)20 b(Therefore,)14 b(it)i(can)f(b)q(e)h(used)g(to)e(exc)o(hange)i(t)o(w) -o(o)e(v)m(alues,)i(as)e(in)60 1213 y Fl(x,)23 b(y)h(=)g(y,)f(x)-12 -1307 y Fn(Before)18 b(the)g(assignmen)o(t,)g(the)g(list)g(of)g(v)m(alues)h -(is)f Fm(adjuste)n(d)g Fn(to)f(the)h(length)h(of)e(the)h(list)h(of)e(v)m -(ariables;)j(see)-12 1364 y(Section)c(4.3.)72 1436 y Fm(var)50 -b Fi(!)g Fm(name)-12 1508 y Fn(A)15 b(single)i(name)e(can)g(denote)h(a)f -(global)h(or)e(a)h(lo)q(cal)i(v)m(ariable,)f(or)e(a)h(formal)g(parameter.)72 -1580 y Fm(var)50 b Fi(!)g Fm(var)17 b Fn('[')e Fm(exp1)i Fn(']')-12 -1652 y(Square)f(brac)o(k)o(ets)f(are)g(used)h(to)f(index)i(a)e(table.)21 -b(If)16 b Fl(var)f Fn(results)h(in)g(a)f(table)h(v)m(alue,)h(the)e(\014eld)i -(indexed)g(b)o(y)-12 1708 y(the)i(expression)g(v)m(alue)h(gets)e(the)h -(assigned)g(v)m(alue.)32 b(Otherwise,)20 b(the)f(fallbac)o(k)g -Fm(settable)f Fn(is)h(called,)i(with)-12 1765 y(three)15 b(parameters:)j(the) -c(v)m(alue)i(of)e Fl(var)p Fn(,)f(the)i(v)m(alue)g(of)f(expression,)h(and)g -(the)f(v)m(alue)h(b)q(eing)h(assigned)f(to)e(it;)-12 1821 y(see)j(Section)g -(4.7.)72 1893 y Fm(var)50 b Fi(!)g Fm(var)17 b Fn('.')j Fm(name)-12 -1966 y Fn(The)c(syn)o(tax)e Fl(var.NAME)g Fn(is)i(just)f(syn)o(tactic)g -(sugar)g(for)f Fl(var["NAME"])p Fn(.)-12 2086 y Fk(4.4.3)52 -b(Con)o(trol)17 b(Structures)-12 2171 y Fn(The)e(condition)h(expression)f(of) -f(a)h(con)o(trol)f(structure)g(can)h(return)g(an)o(y)f(v)m(alue.)21 -b(All)16 b(v)m(alues)f(di\013eren)o(t)g(from)-12 2228 y Fk(nil)f -Fn(are)f(considered)h(true,)f(while)i Fk(nil)f Fn(is)g(considered)g(false.)20 -b Fl(if)p Fn('s,)12 b Fl(while)p Fn('s)g(and)h Fl(repeat)p -Fn('s)f(ha)o(v)o(e)g(the)i(usual)-12 2284 y(meaning.)100 2352 -y Fm(stat)50 b Fi(!)g Fk(while)17 b Fm(exp1)g Fk(do)f Fm(blo)n(ck)g -Fk(end)275 2409 y Fi(j)32 b Fk(rep)q(eat)17 b Fm(blo)n(ck)f -Fk(un)o(til)h Fm(exp1)275 2465 y Fi(j)32 b Fk(if)17 b Fm(exp1)g -Fk(then)f Fm(blo)n(ck)g Fi(f)p Fm(elseif)8 b Fi(g)16 b Fn([)p -Fk(else)g Fm(blo)n(ck)5 b Fn(])15 b Fk(end)72 2522 y Fm(elseif)49 -b Fi(!)h Fk(elseif)17 b Fm(exp1)f Fk(then)h Fm(blo)n(ck)59 -2615 y Fn(A)g Fl(return)g Fn(is)h(used)h(to)e(return)g(v)m(alues)i(from)e(a)g -(function.)28 b(Because)18 b(a)g(function)g(ma)o(y)f(return)h(more)-12 -2672 y(than)d(one)h(v)m(alue,)g(the)f(syn)o(tax)f(for)h(a)g(return)g -(statemen)o(t)f(is:)72 2744 y Fm(r)n(et)49 b Fi(!)i Fk(return)15 -b Fm(explist)910 2976 y Fn(4)p eop -%%Page: 5 5 -bop -12 160 a Fk(4.4.4)52 b(Expressions)16 b(as)i(Statemen)o(ts)-12 -245 y Fn(All)c(expressions)e(with)h(p)q(ossible)h(side-e\013ects)e(can)h(b)q -(e)f(executed)h(as)f(statemen)o(ts.)18 b(These)12 b(include)i(function)-12 -302 y(calls)i(and)g(table)f(constructors:)72 361 y Fm(stat)50 -b Fi(!)g Fm(functionc)n(al)r(l)72 418 y(stat)g Fi(!)g Fm(table)n(c)n -(onstructor)-12 486 y Fn(Ev)o(en)o(tual)16 b(returned)g(v)m(alues)h(are)f -(thro)o(wn)f(a)o(w)o(a)o(y)l(.)20 b(F)l(unction)c(calls)h(are)f(explained)i -(in)e(Section)h(4.5.8;)d(con-)-12 542 y(structors)g(are)h(the)h(sub)s(ject)f -(of)f(Section)i(4.5.7.)-12 662 y Fk(4.4.5)52 b(Lo)q(cal)20 -b(Declarations)-12 748 y Fn(Lo)q(cal)c(v)m(ariables)g(can)f(b)q(e)g(declared) -h(an)o(ywhere)f(inside)h(a)f(blo)q(c)o(k.)20 b(Their)c(scop)q(e)f(b)q(egins)h -(after)e(the)h(declara-)-12 805 y(tion)i(and)h(lasts)f(un)o(til)h(the)f(end)h -(of)e(the)h(blo)q(c)o(k.)27 b(The)17 b(declaration)h(ma)o(y)e(include)k(an)d -(initial)i(assignmen)o(t:)122 921 y Fm(stat)50 b Fi(!)g Fk(lo)q(cal)18 -b Fm(de)n(clist)e Fn([)p Fm(init)t Fn(])72 977 y Fm(de)n(clist)49 -b Fi(!)h Fm(name)16 b Fi(f)p Fn(',')f Fm(name)s Fi(g)125 1033 -y Fm(init)50 b Fi(!)g Fn('=')16 b Fm(explist1)-12 1102 y Fn(If)d(there)f(is)h -(an)g(initial)h(assignmen)o(t,)f(it)f(has)h(the)f(same)g(seman)o(tics)h(of)f -(a)g(m)o(ultiple)i(assignmen)o(t.)19 b(Otherwise,)-12 1158 -y(all)d(v)m(ariables)h(are)e(initialized)j(with)e Fk(nil)p -Fn(.)-12 1280 y Fd(4.5)56 b(Expressions)-12 1366 y Fk(4.5.1)c(Simple)16 -b(Expressions)-12 1452 y Fn(Simple)h(expressions)f(are:)72 -1520 y Fm(exp)50 b Fi(!)g Fn('\(')15 b Fm(exp)i Fn('\)')72 -1576 y Fm(exp)50 b Fi(!)g Fk(nil)72 1633 y Fm(exp)g Fi(!)g -Fn('n)o(um)o(b)q(er')72 1689 y Fm(exp)g Fi(!)g Fn('literal')72 -1746 y Fm(exp)g Fi(!)g Fm(var)-12 1816 y Fn(Num)o(b)q(ers)17 -b(\(n)o(umerical)h(constan)o(ts\))d(and)i(string)g(literals)g(are)g -(explained)i(in)e(Section)h(4.1.)23 b(V)l(ariables)18 b(are)-12 -1873 y(explained)f(in)g(Section)f(4.4.2.)-12 1993 y Fk(4.5.2)52 -b(Arithmetic)16 b(Op)q(erators)-12 2079 y Fn(Lua)j(supp)q(orts)f(the)h(usual) -g(arithmetic)g(op)q(erators.)28 b(These)19 b(op)q(erators)e(are)h(the)g -(binary)h Fl(+)p Fn(,)g Fl(-)p Fn(,)f Fl(*)p Fn(,)h Fl(/)f -Fn(and)-12 2135 y Fl(^)j Fn(\(exp)q(onen)o(tiation\),)h(and)f(the)f(unary)h -Fl(-)p Fn(.)36 b(If)21 b(the)g(op)q(erands)g(are)f(n)o(um)o(b)q(ers,)i(or)e -(strings)h(that)f(can)h(b)q(e)-12 2192 y(con)o(v)o(erted)15 -b(to)f(n)o(um)o(b)q(ers,)h(according)h(to)e(the)h(rules)h(giv)o(en)f(in)h -(Section)g(4.2,)e(all)i(op)q(erations)f(but)g(exp)q(onen-)-12 -2248 y(tiation)i(ha)o(v)o(e)e(the)i(usual)f(meaning.)24 b(Otherwise,)17 -b(the)f(fallbac)o(k)h(\\arith")e(is)i(called;)h(see)e(Section)h(4.7.)22 -b(An)-12 2305 y(exp)q(onen)o(tiation)17 b(alw)o(a)o(ys)d(calls)i(this)g -(fallbac)o(k.)-12 2425 y Fk(4.5.3)52 b(Relational)20 b(Op)q(erators)-12 -2510 y Fn(Lua)c(o\013ers)e(the)h(follo)o(wing)h(relational)g(op)q(erators:) -155 2604 y Fl(<)72 b(>)f(<=)48 b(>=)f(~=)g(==)-12 2698 y Fn(All)17 -b(return)e Fk(nil)h Fn(as)f(false)g(and)h(1)f(as)f(true.)59 -2754 y(Equalit)o(y)19 b(\014rst)f(compares)g(the)g(t)o(yp)q(es)h(of)f(its)h -(op)q(erands.)30 b(If)18 b(they)h(are)f(di\013eren)o(t,)h(the)g(result)g(is)g -Fk(nil)p Fn(.)-12 2811 y(Otherwise,)h(their)e(v)m(alues)i(are)d(compared.)29 -b(Num)o(b)q(ers)19 b(and)f(strings)g(are)g(compared)g(in)h(the)g(usual)f(w)o -(a)o(y)l(.)910 2976 y(5)p eop -%%Page: 6 6 -bop -12 160 a Fn(T)l(ables,)13 b(CF)l(unctions,)h(and)e(functions)h(are)f -(compared)h(b)o(y)f(reference,)h(that)f(is,)h(t)o(w)o(o)e(tables)i(are)f -(considered)-12 216 y(equal)k(only)g(if)g(they)f(are)g(the)g(same)g(table.)20 -b(The)c(op)q(erator)e Fl(~=)h Fn(is)h(exactly)f(the)g(negation)h(of)f -(equalit)o(y)g(\()p Fl(=)p Fn(\).)59 273 y(The)i(other)g(op)q(erators)g(w)o -(ork)f(as)h(follo)o(ws.)26 b(If)17 b(b)q(oth)h(argumen)o(ts)e(are)h(n)o(um)o -(b)q(ers,)h(they)f(are)g(compared)-12 329 y(as)f(suc)o(h.)23 -b(Otherwise,)16 b(if)h(b)q(oth)f(argumen)o(ts)f(can)h(b)q(e)h(con)o(v)o -(erted)f(to)f(strings,)h(their)g(v)m(alues)i(are)d(compared)-12 -385 y(using)h(lexicographical)i(order.)h(Otherwise,)d(the)f(fallbac)o(k)h -(\\order")e(is)i(called;)h(see)e(Section)h(4.7.)-12 505 y Fk(4.5.4)52 -b(Logical)20 b(Op)q(erators)-12 590 y Fn(All)g(logical)g(op)q(erators,)f(lik) -o(e)h(con)o(trol)e(structures,)h(consider)h Fk(nil)g Fn(as)e(false)i(and)f -(an)o(ything)g(else)g(as)g(true.)-12 647 y(Lik)o(e)d(relational)g(op)q -(erators,)e(they)i(return)f Fk(nil)h Fn(as)f(false)g(and)h(1)f(as)f(true.)20 -b(The)c(logical)g(op)q(erators)e(are:)298 736 y Fl(and)72 b(or)f(not)-12 -825 y Fn(The)18 b(op)q(erators)f Fl(and)g Fn(and)h Fl(or)g -Fn(use)g(short-cut)f(ev)m(aluation,)j(that)d(is,)h(the)g(second)h(op)q(erand) -f(is)g(ev)m(aluated)-12 881 y(only)e(if)g(necessary)l(.)-12 -1000 y Fk(4.5.5)52 b(Concatenation)-12 1086 y Fn(Lua)11 b(o\013ers)f(a)h -(string)f(concatenation)h(op)q(erator,)g(denoted)g(b)o(y)g(\\)p -Fl(..)p Fn(".)17 b(If)11 b(op)q(erands)g(are)g(strings)f(or)g(n)o(um)o(b)q -(ers,)-12 1142 y(they)20 b(are)f(con)o(v)o(erted)g(to)g(strings)h(according)g -(to)e(the)i(rules)g(in)h(Section)f(4.2.)32 b(Otherwise,)21 -b(the)f(fallbac)o(k)-12 1199 y(\\concat")15 b(is)g(called;)i(see)e(Section)h -(4.7.)-12 1318 y Fk(4.5.6)52 b(Precedence)-12 1404 y Fn(Op)q(erator)15 -b(precedence)i(follo)o(ws)e(the)h(table)f(b)q(elo)o(w,)h(from)e(the)h(lo)o(w) -o(er)g(to)g(the)g(higher)h(priorit)o(y:)298 1493 y Fl(and)72 -b(or)298 1549 y(<)g(>)f(<=)48 b(>=)f(~=)h(=)298 1606 y(..)298 -1662 y(+)72 b(-)298 1718 y(*)g(/)298 1775 y(not)48 b(-)23 b(\(unary\))298 -1831 y(^)-12 1920 y Fn(All)17 b(binary)e(op)q(erators)g(are)g(left)g(asso)q -(ciativ)o(e,)g(except)h(for)f Fl(^)p Fn(,)f(whic)o(h)i(is)g(righ)o(t)f(asso)q -(ciativ)o(e.)-12 2039 y Fk(4.5.7)52 b(T)l(able)18 b(Constructors)-12 -2125 y Fn(T)l(able)c(constructors)d(are)h(expressions)i(that)e(create)g -(tables.)19 b(They)13 b(can)g(b)q(e)g(used)g(to)f(create)g(empt)o(y)g -(tables,)-12 2182 y(or)j(to)f(create)h(a)g(table)h(and)f(initialize)k(some)c -(\014elds.)59 2238 y(The)g(general)h(syn)o(tax)e(for)h(constructors)f(is:)72 -2306 y Fm(table)n(c)n(onstructor)49 b Fi(!)h Fn(')p Fi(f)p -Fn(')16 b([)p Fm(\014eld)r(list)t Fn(])e(')p Fi(g)p Fn(')241 -2363 y Fm(\014eld)r(list)49 b Fi(!)h Fm(l\014eld)r(list1)15 -b Fn([','])241 2419 y Fm(\014eld)r(list)49 b Fi(!)h Fm(\016eld)r(list1)16 -b Fn([','])241 2476 y Fm(\014eld)r(list)49 b Fi(!)h Fm(l\014eld)r(list1)15 -b Fn(';')g Fm(\016eld)r(list1)h Fn([','])59 2569 y(The)f(form)g -Fm(l\014eld)r(list1)f Fn(is)h(used)h(to)f(initialize)j(lists.)72 -2641 y Fm(l\014eld)r(list1)48 b Fi(!)j Fm(exp)16 b Fi(f)p Fn(',')f -Fm(exp)s Fi(g)-12 2713 y Fn(The)i(expressions)f(in)h(the)g(list)f(are)g -(assigned)h(to)e(consecutiv)o(e)i(n)o(umerical)h(indexes,)f(starting)f(with)g -(1.)22 b(As)-12 2769 y(an)15 b(example:)60 2858 y Fl(a)24 b(=)f({"v1",)g -("v2",)g(34})910 2976 y Fn(6)p eop -%%Page: 7 7 -bop -12 160 a Fn(is)16 b(equiv)m(alen)o(t)h(to:)60 253 y Fl(temp)23 -b(=)h({})60 310 y(temp[1])f(=)g("v1")60 366 y(temp[2])g(=)g("v2")60 -423 y(temp[3])g(=)g(34)60 479 y(a)h(=)f(temp)59 573 y Fn(The)15 -b(next)g(form)g(initializes)j(named)e(\014elds)g(in)g(a)f(table.)72 -632 y Fm(\016eld)r(list1)49 b Fi(!)i Fm(\016eld)16 b Fi(f)p -Fn(',')e Fm(\016eld)5 b Fi(g)157 689 y Fm(\016eld)49 b Fi(!)i -Fm(name)16 b Fn('=')g Fm(exp)-12 757 y Fn(As)f(an)g(example:)60 -851 y Fl(a)24 b(=)f({x)h(=)g(1,)f(y)h(=)g(3})-12 945 y Fn(is)16 -b(equiv)m(alen)o(t)h(to:)60 1039 y Fl(temp)23 b(=)h({})60 1095 -y(temp.x)f(=)h(1)60 1152 y(temp.y)f(=)h(3)60 1208 y(a)g(=)f(temp)-12 -1328 y Fk(4.5.8)52 b(F)l(unction)18 b(Calls)-12 1414 y Fn(A)d(function)h -(call)h(has)e(the)g(follo)o(wing)h(syn)o(tax:)72 1486 y Fm(functionc)n(al)r -(l)49 b Fi(!)h Fm(var)16 b(r)n(e)n(alPar)n(ams)-12 1558 y Fn(Here,)d -Fl(var)g Fn(can)g(b)q(e)h(an)o(y)e(v)m(ariable)j(\(global,)e(lo)q(cal,)h -(indexed,)h(etc\).)k(If)13 b(its)g(t)o(yp)q(e)g(is)g Fm(function)j -Fn(or)d Fm(CF)m(unction)s Fn(,)-12 1615 y(this)k(function)h(is)f(called.)27 -b(Otherwise,)17 b(the)g(fallbac)o(k)g(\\function")h(is)f(called,)h(ha)o(ving) -f(as)g(\014rst)f(parameter)-12 1671 y(the)f(v)m(alue)i(of)e -Fl(var)p Fn(,)f(and)h(then)h(the)f(original)i(call)f(parameters.)59 -1727 y(The)f(form:)72 1800 y Fm(functionc)n(al)r(l)49 b Fi(!)h -Fm(var)16 b Fn(':')k Fm(name)c(r)n(e)n(alPar)n(ams)-12 1872 -y Fn(can)g(b)q(e)f(used)h(to)f(call)h(\\metho)q(ds".)k(A)15 -b(call)h Fl(var:name\(...\))d Fn(is)j(syn)o(tactic)f(sugar)g(for)36 -1965 y Fl(var.name\(var,)22 b(...\))-12 2059 y Fn(except)16 -b(that)e Fl(var)h Fn(is)h(ev)m(aluated)g(only)g(once.)72 2127 -y Fm(r)n(e)n(alPar)n(ams)49 b Fi(!)h Fn('\(')15 b([)p Fm(explist1)6 -b Fn(])16 b('\)')72 2184 y Fm(r)n(e)n(alPar)n(ams)49 b Fi(!)h -Fm(table)n(c)n(onstructor)144 2240 y(explist1)g Fi(!)g Fm(exp1)17 -b Fi(f)p Fn(',')e Fm(exp1)6 b Fi(g)-12 2309 y Fn(All)14 b(argumen)o(t)e -(expressions)h(are)f(ev)m(aluated)i(b)q(efore)f(the)f(call;)j(then)d(the)h -(list)g(of)g(argumen)o(ts)e(is)i(adjusted)g(to)-12 2365 y(the)j(length)g(of)f -(the)g(list)i(of)e(parameters)f(\(see)h(Section)i(4.3\);)d(\014nally)l(,)i -(this)g(list)g(is)g(assigned)g(to)f(the)h(formal)-12 2422 y(parameters.)j(A)c -(call)i(of)d(the)i(form)e Fl(f{...})g Fn(is)i(syn)o(tactic)f(sugar)g(for)f -Fl(f\({...}\))p Fn(,)g(that)g(is,)i(the)f(parameter)-12 2478 -y(list)h(is)g(a)f(single)h(new)g(table.)59 2534 y(Because)k(a)g(function)g -(can)g(return)g(an)o(y)g(n)o(um)o(b)q(er)g(of)f(results)h(\(see)g(Section)h -(4.4.3\),)e(the)h(n)o(um)o(b)q(er)g(of)-12 2591 y(results)11 -b(m)o(ust)f(b)q(e)h(adjusted)f(b)q(efore)h(used.)19 b(If)10 -b(the)h(function)g(is)g(called)h(as)e(an)g(statemen)o(t)f(\(see)h(Section)i -(4.4.4\),)-12 2647 y(its)19 b(return)g(list)g(is)h(adjusted)f(to)f(0.)30 -b(If)19 b(the)g(function)g(is)h(called)g(in)g(a)e(place)i(that)e(needs)i(a)e -(single)i(v)m(alue)-12 2704 y(\(syn)o(tactically)13 b(denoted)f(b)o(y)g(the)g -(non-terminal)h Fl(exp1)p Fn(\),)f(its)g(return)g(list)h(is)f(adjusted)g(to)g -(1.)18 b(If)12 b(the)g(function)-12 2760 y(is)i(called)h(in)g(a)e(place)i -(that)d(can)i(hold)h(man)o(y)e(v)m(alues)h(\(syn)o(tactically)h(denoted)f(b)o -(y)f(the)h(non-terminal)g Fl(exp)p Fn(\),)-12 2817 y(no)h(adjustmen)o(t)g(is) -h(done.)910 2976 y(7)p eop -%%Page: 8 8 -bop -12 160 a Fd(4.6)56 b(F)-5 b(unction)19 b(De\014nitions)-12 -245 y Fn(F)l(unctions)i(in)f(Lua)g(can)g(b)q(e)g(de\014ned)h(an)o(ywhere)f -(in)g(the)g(global)g(lev)o(el)h(of)e(a)h(mo)q(dule.)34 b(The)20 -b(syn)o(tax)f(for)-12 302 y(function)d(de\014nition)h(is:)72 -374 y Fm(function)49 b Fi(!)i Fk(function)17 b Fm(name)f Fn('\(')f([)p -Fm(p)n(arlist1)6 b Fn(])16 b('\)')f Fm(blo)n(ck)h Fk(end)59 -503 y Fn(When)d(Lua)g(\014nds)h(a)f(function)g(de\014nition,)i(its)e(b)q(o)q -(dy)h(is)g(compiled)g(to)f(in)o(termediate)g(co)q(de)h(and)f(stored,)-12 -559 y(with)j(t)o(yp)q(e)f Fm(function)p Fn(,)f(in)o(to)i(the)f(global)h(v)m -(ariable)g Fl(name)p Fn(.)59 615 y(P)o(arameters)e(act)g(as)h(lo)q(cal)h(v)m -(ariables,)h(initialized)h(with)e(the)f(argumen)o(t)f(v)m(alues.)72 -688 y Fm(p)n(arlist1)49 b Fi(!)i Fm('name')16 b Fi(f)p Fn(',')f -Fm(name)s Fi(g)59 816 y Fn(Results)h(are)e(returned)h(using)h(the)e -Fl(return)g Fn(statemen)o(t)g(\(see)h(Section)g(4.4.3\).)j(If)d(con)o(trol)f -(reac)o(hes)h(the)-12 873 y(end)h(of)f(a)g(function)h(without)f(a)g(return)g -(instruction,)h(the)f(function)h(returns)f(with)h(no)f(results.)59 -929 y(There)e(is)h(a)f(sp)q(ecial)i(syn)o(tax)e(for)f(de\014nition)j(of)e -(metho)q(ds,)h(that)e(is,)i(functions)g(whic)o(h)g(are)f(to)g(b)q(e)h(stored) --12 986 y(in)i(table)g(\014elds.)72 1058 y Fm(function)49 b -Fi(!)i Fk(function)17 b Fm(name)f Fn(':')k Fm(name)c Fn('\(')f([)p -Fm(p)n(arlist1)6 b Fn(])16 b('\)')f Fm(blo)n(ck)g Fk(end)-12 -1130 y Fn(A)g(declaration)h(lik)o(e)-12 1224 y Fl(function)23 -b(t:f)g(\(...\))36 1280 y(...)-12 1336 y(end)-12 1430 y Fn(is)16 -b(equiv)m(alen)o(t)h(to)-12 1524 y Fl(function)23 b(temp)g(\(self,)g(...\))36 -1581 y(...)-12 1637 y(end)-12 1693 y(t.f)h(=)f(temp)-12 1787 -y Fn(that)18 b(is,)i(the)f(function)g(is)g(created)g(with)g(a)f(dumm)o(y)h -(name)g(and)f(then)h(assigned)h(to)e(the)h(\014eld)g Fl(f)g -Fn(of)f(the)-12 1844 y(table)g Fl(t)p Fn(.)24 b(Moreo)o(v)o(er,)16 -b(the)h(function)h(gets)e(an)h(extra)f(formal)h(parameter)f(called)i -Fl(self)p Fn(.)25 b(Notice)17 b(that)f(the)-12 1900 y(v)m(ariable)h -Fl(t)e Fn(m)o(ust)f(b)q(e)i(previously)h(initialized)h(with)e(a)f(table)g(v)m -(alue.)-12 2022 y Fd(4.7)56 b(F)-5 b(allbac)n(ks)-12 2108 y -Fn(Lua)23 b(pro)o(vides)f(a)g(p)q(o)o(w)o(erful)h(mec)o(hanism)g(to)e(extend) -i(its)g(seman)o(tics,)g(called)h Fm(fal)r(lb)n(acks)p Fn(.)40 -b(Basically)l(,)26 b(a)-12 2164 y(fallbac)o(k)15 b(is)g(a)g(programmer)e -(de\014ned)j(function)f(whic)o(h)g(is)g(called)h(whenev)o(er)f(Lua)g(do)q(es) -g(not)f(kno)o(w)g(ho)o(w)g(to)-12 2221 y(pro)q(ceed.)59 2277 -y(Lua)h(supp)q(orts)h(the)f(follo)o(wing)h(fallbac)o(ks,)f(iden)o(ti\014ed)i -(b)o(y)f(the)f(giv)o(en)h(strings:)-12 2371 y Fk(\\arith")25 -b Fn(called)18 b(when)g(an)e(arithmetic)i(op)q(eration)f(is)h(applied)g(to)f -(non)g(n)o(umerical)h(op)q(erands,)f(or)g(when)102 2427 y(the)c(binary)g -Fl(^)g Fn(op)q(eration)g(is)h(called.)21 b(Receiv)o(es)14 b(three)f(argumen)o -(ts:)18 b(the)13 b(t)o(w)o(o)f(op)q(erands)h(\(the)g(second)102 -2484 y(one)i(is)g(nil)h(when)f(the)f(op)q(eration)h(is)g(unary)g(min)o(us\))g -(and)f(one)h(of)f(the)h(follo)o(wing)g(strings)f(describing)102 -2540 y(the)h(o\013ended)h(op)q(erator:)150 2653 y Fl(add)47 -b(sub)g(mul)h(div)f(pow)g(unm)102 2765 y Fn(Its)13 b(return)g(v)m(alue)h(is)f -(the)g(\014nal)h(result)f(of)g(the)g(arithmetic)h(op)q(eration.)19 -b(The)13 b(default)h(function)f(issues)102 2822 y(an)i(error.)910 -2976 y(8)p eop -%%Page: 9 9 -bop -12 160 a Fk(\\order")23 b Fn(called)15 b(when)f(an)f(order)g(comparison) -g(is)h(applied)h(to)e(non)g(n)o(umerical)i(or)e(non)g(string)g(op)q(erands.) -102 216 y(Receiv)o(es)18 b(three)e(argumen)o(ts:)22 b(the)16 -b(t)o(w)o(o)f(op)q(erands)i(and)g(one)f(of)g(the)h(follo)o(wing)g(strings)f -(describing)102 273 y(the)f(o\013ended)h(op)q(erator:)150 383 -y Fl(lt)23 b(gt)h(le)f(ge)102 494 y Fn(Its)d(return)g(v)m(alue)i(is)f(the)f -(\014nal)h(result)g(of)f(the)g(comparison)h(op)q(eration.)35 -b(The)21 b(default)f(function)102 551 y(issues)c(an)f(error.)-12 -644 y Fk(\\concat")25 b Fn(called)20 b(when)f(a)f(concatenation)h(is)g -(applied)h(to)e(non)g(string)g(op)q(erands.)30 b(Receiv)o(es)20 -b(the)f(t)o(w)o(o)102 700 y(op)q(erands)13 b(as)f(argumen)o(ts.)18 -b(Its)13 b(return)f(v)m(alue)i(is)f(the)g(\014nal)g(result)g(of)f(the)h -(concatenation)f(op)q(eration.)102 757 y(The)j(default)h(function)g(issues)g -(an)f(error.)-12 850 y Fk(\\index")24 b Fn(called)13 b(when)f(Lua)g(tries)f -(to)g(retriev)o(e)h(the)f(v)m(alue)i(of)e(an)g(index)i(not)e(presen)o(t)g(in) -i(a)e(table.)19 b(Receiv)o(es)102 907 y(as)c(argumen)o(ts)f(the)i(table)g -(and)f(the)h(index.)21 b(Its)16 b(return)f(v)m(alue)i(is)f(the)f(\014nal)h -(result)g(of)f(the)g(indexing)102 963 y(op)q(eration.)20 b(The)15 -b(default)h(function)g(returns)f(nil.)-12 1056 y Fk(\\gettable")25 -b Fn(called)17 b(when)f(Lua)f(tries)h(to)e(index)j(a)e(non)g(table)h(v)m -(alue.)21 b(Receiv)o(es)c(as)d(argumen)o(ts)h(the)g(non)102 -1113 y(table)i(v)m(alue)h(and)f(the)f(index.)26 b(Its)17 b(return)f(v)m(alue) -i(is)f(the)g(\014nal)h(result)f(of)f(the)h(indexing)h(op)q(eration.)102 -1169 y(The)d(default)h(function)g(issues)g(an)f(error.)-12 -1263 y Fk(\\settable")25 b Fn(called)16 b(when)f(Lua)g(tries)g(to)f(assign)h -(indexed)h(a)e(non)h(table)g(v)m(alue.)21 b(Receiv)o(es)16 -b(as)e(argumen)o(ts)102 1319 y(the)k(non)g(table)h(v)m(alue,)h(the)e(index,)h -(and)g(the)f(assigned)h(v)m(alue.)29 b(The)19 b(default)f(function)h(issues)g -(an)102 1375 y(error.)-12 1469 y Fk(\\function")25 b Fn(called)15 -b(when)e(Lua)h(tries)f(to)f(call)i(a)f(non)g(function)h(v)m(alue.)21 -b(Receiv)o(es)14 b(as)f(argumen)o(ts)f(the)h(non)102 1525 y(function)h(v)m -(alue)g(and)g(the)f(argumen)o(ts)g(giv)o(en)g(in)h(the)g(original)g(call.)20 -b(Its)14 b(return)f(v)m(alues)h(are)f(the)g(\014nal)102 1582 -y(results)i(of)g(the)g(call)i(op)q(eration.)j(The)15 b(default)h(function)g -(issues)g(an)f(error.)-12 1675 y Fk(\\gc")24 b Fn(called)18 -b(during)f(garbage)e(collection.)24 b(Receiv)o(es)18 b(as)d(argumen)o(t)h -(the)g(table)g(b)q(eing)i(collected.)24 b(After)102 1731 y(eac)o(h)15 -b(run)g(of)g(the)g(collector)h(this)f(function)h(is)g(called)g(with)g -(argumen)o(t)e(nil.)21 b(Because)16 b(this)f(function)102 1788 -y(op)q(erates)j(during)i(garbage)d(collection,)k(it)e(m)o(ust)f(b)q(e)h(used) -g(with)g(great)f(care,)h(and)g(programmers)102 1844 y(should)d(a)o(v)o(oid)e -(the)i(creation)f(of)f(new)h(ob)s(jects)g(\(tables)g(or)f(strings\))h(in)g -(this)h(function.)21 b(The)15 b(default)102 1901 y(function)h(do)q(es)f -(nothing.)-12 1994 y Fk(\\error")22 b Fn(called)16 b(when)e(an)g(error)f(o)q -(ccurs.)20 b(Receiv)o(es)15 b(as)e(argumen)o(t)h(a)f(string)h(describing)h -(the)f(error.)19 b(The)102 2050 y(default)d(function)g(prin)o(ts)f(the)g -(message)g(on)g(the)h(standard)e(error)h(output.)59 2143 y(The)e(function)h -Fl(setfallback)d Fn(is)j(used)g(to)e(c)o(hange)h(a)g(fallbac)o(k)h(action.)19 -b(Its)13 b(\014rst)g(argumen)o(t)f(is)i(a)e(string)-12 2199 -y(describing)h(the)f(fallbac)o(k,)g(and)g(the)f(second)h(the)g(new)f -(function)h(to)f(b)q(e)h(called.)20 b(It)12 b(returns)f(the)h(old)f(function) --12 2256 y(for)k(the)g(giv)o(en)h(fallbac)o(k,)f(or)g(nil)i(on)e(error.)59 -2312 y(Section)h(7.4)e(sho)o(ws)h(an)g(example)h(of)f(the)g(use)g(of)g -(fallbac)o(ks.)-12 2434 y Fd(4.8)56 b(Error)18 b(Handling)-12 -2520 y Fn(Because)i(Lua)g(is)g(an)g(extension)g(language,)h(all)f(Lua)g -(actions)f(start)g(from)g(C)g(co)q(de)h(calling)h(a)e(function)-12 -2576 y(from)13 b(the)i(Lua)f(library)l(.)20 b(Whenev)o(er)15 -b(an)f(error)f(o)q(ccurs)h(during)h(Lua)f(compilation)i(or)d(execution,)i(an) -f(error)-12 2632 y(fallbac)o(k)h(function)g(is)g(called,)h(and)e(then)h(the)f -(corresp)q(onden)o(t)g(function)i(from)d(the)h(library)h(\()p -Fl(lua_dofile)p Fn(,)-12 2689 y Fl(lua_dostring)p Fn(,)d Fl(lua_call)p -Fn(,)f(and)j Fl(lua_callfunction)p Fn(\))c(is)j(terminated)h(returning)f(an)g -(error)f(condition.)59 2745 y(The)j(only)h(argumen)o(t)f(to)g(the)g(error)g -(fallbac)o(k)h(function)g(is)g(a)f(string)h(describing)h(the)e(error)g(and)h -(some)-12 2802 y(extra)k(informations,)i(lik)o(e)g(curren)o(t)f(line)i -(\(when)e(the)g(error)f(is)h(at)g(compilation\))g(or)g(curren)o(t)f(function) --12 2858 y(\(when)d(the)f(error)g(is)h(at)f(execution\).)24 -b(F)l(or)16 b(more)g(information)g(ab)q(out)h(an)f(error,)g(the)g(Lua)h -(program)e(can)910 2976 y(9)p eop -%%Page: 10 10 -bop -12 160 a Fn(include)24 b(the)d(compilation)h(pragma)e -Fl($debug)p Fn(.)37 b(This)22 b(pragma)e(m)o(ust)g(b)q(e)i(written)f(in)h(a)f -(line)i(b)o(y)e(itself.)-12 216 y(When)13 b(an)g(error)f(o)q(ccurs)i(in)f(a)g -(program)f(compiled)i(with)g(this)f(option,)g(the)g(error)f(message)h -(includes)i(extra)-12 273 y(information)h(sho)o(wing)f(the)g(stac)o(k)f(of)h -(calls.)59 329 y(The)d(standard)g(error)g(routine)h(only)g(prin)o(ts)g(the)f -(error)g(message)g(to)g Fl(stderr)p Fn(.)18 b(If)13 b(needed,)h(it)f(is)g(p)q -(ossible)-12 385 y(to)i(c)o(hange)g(the)g(error)g(fallbac)o(k)h(routine;)f -(see)h(Section)g(4.7.)59 442 y(Lua)g(co)q(de)h(can)f(generate)g(an)g(error)f -(b)o(y)h(calling)i(the)e(function)h Fl(error)p Fn(.)k(Its)16 -b(optional)h(parameter)e(is)i(a)-12 498 y(string,)e(whic)o(h)h(is)g(used)g -(as)e(the)i(error)e(message.)-12 641 y Fo(5)69 b(The)23 b(Application)e -(Program)h(In)n(terface)-12 742 y Fn(This)e(section)f(describ)q(es)h(the)f -(API)g(for)f(Lua,)i(that)e(is,)i(the)f(set)f(of)g(C)h(functions)g(a)o(v)m -(ailable)i(to)d(the)h(host)-12 799 y(program)13 b(to)g(comm)o(unicate)h(with) -g(the)f(library)l(.)21 b(The)14 b(API)g(functions)g(can)g(b)q(e)g -(classi\014ed)h(in)g(the)f(follo)o(wing)-12 855 y(categories:)44 -945 y(1.)22 b(executing)16 b(Lua)g(co)q(de;)44 1038 y(2.)22 -b(con)o(v)o(erting)15 b(v)m(alues)h(b)q(et)o(w)o(een)g(C)f(and)g(Lua;)44 -1130 y(3.)22 b(manipulating)17 b(\(reading)e(and)g(writing\))h(Lua)f(ob)s -(jects;)44 1222 y(4.)22 b(calling)17 b(Lua)e(functions;)44 -1315 y(5.)22 b(C)15 b(functions)h(to)e(b)q(e)i(called)h(b)o(y)e(Lua;)44 -1407 y(6.)22 b(lo)q(c)o(king)16 b(Lua)g(Ob)s(jects.)-12 1497 -y(All)h(API)e(functions)h(are)f(declared)i(in)f(the)f(\014le)h -Fl(lua.h)p Fn(.)-12 1618 y Fd(5.1)56 b(Executing)17 b(Lua)i(Co)r(de)-12 -1704 y Fn(A)d(host)g(program)e(can)i(execute)h(Lua)f(programs)f(written)h(in) -h(a)e(\014le)i(or)f(in)h(a)e(string,)h(using)h(the)f(follo)o(wing)-12 -1760 y(functions:)-12 1850 y Fl(int)286 b(lua_dofile)357 b(\(char)23 -b(*filename\);)-12 1907 y(int)286 b(lua_dostring)309 b(\(char)23 -b(*string\);)-12 1997 y Fn(Both)15 b(functions)h(return)f(an)g(error)g(co)q -(de:)20 b(0,)15 b(in)h(case)f(of)g(success;)g(non)h(zero,)e(in)i(case)g(of)e -(errors.)-12 2118 y Fd(5.2)56 b(Con)n(v)n(erting)19 b(V)-5 -b(alues)19 b(b)r(et)n(w)n(een)f(C)h(and)g(Lua)-12 2204 y Fn(Because)24 -b(Lua)g(has)g(no)g(static)f(t)o(yp)q(e)h(system,)h(all)f(v)m(alues)h(passed)f -(b)q(et)o(w)o(een)g(Lua)g(and)g(C)f(ha)o(v)o(e)g(t)o(yp)q(e)-12 -2260 y Fl(lua_Object)p Fn(,)14 b(whic)o(h)i(w)o(orks)e(lik)o(e)i(an)f -(abstract)f(t)o(yp)q(e)i(in)g(C)f(that)f(can)i(hold)g(an)o(y)e(Lua)i(v)m -(alue.)59 2317 y(Lua)24 b(has)g(automatic)f(memory)g(managemen)o(t,)i(and)f -(garbage)f(collection.)48 b(Because)24 b(of)g(that,)h(a)-12 -2373 y Fl(lua_Object)15 b Fn(has)h(a)f(limited)j(scop)q(e,)e(and)g(is)h(only) -f(v)m(alid)i(inside)g(the)e Fm(blo)n(ck)k Fn(where)c(it)g(w)o(as)f(created.) -23 b(A)16 b(C)-12 2429 y(function)j(called)g(from)f(Lua)g(is)g(a)g(blo)q(c)o -(k,)h(and)f(its)g(parameters)f(are)h(v)m(alid)h(only)g(un)o(til)g(its)f(end.) -28 b(A)18 b(go)q(o)q(d)-12 2486 y(programming)d(practice)g(is)h(to)e(con)o(v) -o(ert)h(Lua)g(ob)s(jects)g(to)f(C)h(v)m(alues)h(as)f(so)q(on)g(as)g(they)g -(are)g(a)o(v)m(ailable,)h(and)-12 2542 y(nev)o(er)g(to)e(store)h -Fl(lua_Object)p Fn(s)e(in)j(global)g(v)m(ariables.)59 2599 -y(When)h(C)f(co)q(de)i(calls)f(Lua)g(rep)q(eatedly)l(,)h(as)f(in)g(a)g(lo)q -(op,)g(ob)s(jects)f(returned)h(b)o(y)g(there)f(calls)i(ma)o(y)e(acu-)-12 -2655 y(m)o(ulate,)21 b(creating)g(a)f(memory)g(problem.)36 -b(T)l(o)20 b(a)o(v)o(oid)g(this,)i(nested)e(blo)q(c)o(ks)h(can)g(b)q(e)g -(de\014ned)h(with)e(the)-12 2712 y(functions:)-12 2802 y Fl(void)262 -b(lua_beginblock)f(\(void\);)-12 2858 y(void)h(lua_endblock)309 -b(\(void\);)899 2976 y Fn(10)p eop -%%Page: 11 11 -bop -12 160 a Fn(After)15 b(the)g(end)h(of)f(the)g(blo)q(c)o(k,)h(all)g -Fl(lua_Object)p Fn('s)d(created)i(inside)i(it)f(are)f(released.)59 -216 y(T)l(o)g(c)o(hec)o(k)g(the)g(t)o(yp)q(e)h(of)e(a)h Fl(lua_Object)p -Fn(,)f(the)h(follo)o(wing)h(function)g(is)g(a)o(v)m(ailable:)-12 -310 y Fl(int)286 b(lua_type)405 b(\(lua_Object)22 b(object\);)-12 -404 y Fn(plus)16 b(the)g(follo)o(wing)g(macros:)-12 498 y Fl(int)286 -b(lua_isnil)381 b(\(lua_Object)22 b(object\);)-12 554 y(int)286 -b(lua_isnumber)309 b(\(lua_Object)22 b(object\);)-12 610 y(int)286 -b(lua_isstring)309 b(\(lua_Object)22 b(object\);)-12 667 y(int)286 -b(lua_istable)333 b(\(lua_Object)22 b(object\);)-12 723 y(int)286 -b(lua_iscfunction)237 b(\(lua_Object)22 b(object\);)-12 780 -y(int)286 b(lua_isuserdata)261 b(\(lua_Object)22 b(object\);)-12 -874 y Fn(All)17 b(macros)d(return)h(1)g(if)h(the)f(ob)s(ject)g(has)g(the)g -(giv)o(en)h(t)o(yp)q(e,)f(and)g(0)g(otherwise.)59 930 y(The)f(function)h -Fl(lua_type)e Fn(can)h(b)q(e)h(used)g(to)e(distinguish)k(b)q(et)o(w)o(een)d -(di\013eren)o(t)g(kinds)i(of)d(user)i(data;)e(see)-12 987 y(b)q(elo)o(w.)59 -1043 y(T)l(o)i(translate)f(a)h(v)m(alue)i(from)d(t)o(yp)q(e)h -Fl(lua_Object)f Fn(to)h(a)g(sp)q(eci\014c)i(C)e(t)o(yp)q(e,)g(the)g -(programmer)f(can)h(use:)-12 1137 y Fl(double)214 b(lua_getnumber)285 -b(\(lua_Object)22 b(object\);)-12 1193 y(char)238 b(*lua_getstring)285 -b(\(lua_Object)22 b(object\);)-12 1250 y(lua_CFunction)46 b(lua_getcfunction) -213 b(\(lua_Object)22 b(object\);)-12 1306 y(void)238 b(*lua_getuserdata)f -(\(lua_Object)22 b(object\);)-12 1400 y(lua_getnumber)16 b -Fn(con)o(v)o(erts)h(a)h Fl(lua_Object)e Fn(to)h(a)h(\015oat.)27 -b(This)18 b Fl(lua_Object)f Fn(m)o(ust)g(b)q(e)i(a)e(n)o(um)o(b)q(er)h(or)g -(a)-12 1456 y(string)d(con)o(v)o(ertible)i(to)d(n)o(um)o(b)q(er)i(\(see)f -(Section)h(4.2\);)d(otherwise,)i(the)h(function)g(returns)f(0.)59 -1513 y Fl(lua_getstring)f Fn(con)o(v)o(erts)h(a)h Fl(lua_Object)e -Fn(to)i(a)g(string)f(\()p Fl(char)23 b(*)p Fn(\).)f(This)17 -b Fl(lua_Object)d Fn(m)o(ust)i(b)q(e)h(a)-12 1569 y(string)h(or)g(a)g(n)o(um) -o(b)q(er;)i(otherwise,)f(the)f(function)i(returns)e(0)g(\(the)g(n)o(ull)i(p)q -(oin)o(ter\).)29 b(This)19 b(function)g(do)q(es)-12 1626 y(not)14 -b(create)g(a)g(new)g(string,)g(but)g(returns)g(a)g(p)q(oin)o(ter)h(to)e(a)h -(string)g(inside)i(the)e(Lua)h(en)o(vironmen)o(t.)20 b(Because)-12 -1682 y(Lua)14 b(has)f(garbage)f(collection,)k(there)d(is)h(no)f(guaran)o(tee) -g(that)f(suc)o(h)i(p)q(oin)o(ter)g(will)h(b)q(e)f(v)m(alid)h(after)d(the)i -(blo)q(c)o(k)-12 1739 y(ends.)59 1795 y Fl(lua_getcfunction)h -Fn(con)o(v)o(erts)i(a)g Fl(lua_Object)g Fn(to)f(a)i(C)f(function.)28 -b(This)18 b Fl(lua_Object)f Fn(m)o(ust)g(ha)o(v)o(e)-12 1852 -y(t)o(yp)q(e)c Fm(CF)m(unction)s Fn(;)f(otherwise,)i(the)f(function)g -(returns)g(0)g(\(the)f(n)o(ull)j(p)q(oin)o(ter\).)k(The)13 -b(t)o(yp)q(e)g Fl(lua_CFunction)-12 1908 y Fn(is)j(explained)h(in)f(Section)g -(5.5.)59 1965 y Fl(lua_getuserdata)k Fn(con)o(v)o(erts)h(a)h -Fl(lua_Object)e Fn(to)i Fl(void*)p Fn(.)40 b(This)22 b Fl(lua_Object)f -Fn(m)o(ust)h(ha)o(v)o(e)f(t)o(yp)q(e)-12 2021 y Fm(user)n(data)s -Fn(;)16 b(otherwise,)f(the)g(function)h(returns)f(0)g(\(the)g(n)o(ull)i(p)q -(oin)o(ter\).)59 2077 y(The)12 b(rev)o(erse)g(pro)q(cess,)h(that)e(is,)i -(passing)g(a)f(sp)q(eci\014c)i(C)d(v)m(alue)j(to)d(Lua,)i(is)g(done)f(b)o(y)g -(using)h(the)g(follo)o(wing)-12 2134 y(functions:)-12 2228 -y Fl(void)262 b(lua_pushnumber)f(\(double)23 b(n\);)-12 2284 -y(void)262 b(lua_pushstring)f(\(char)23 b(*s\);)-12 2341 y(void)262 -b(lua_pushliteral)237 b(\(char)23 b(*s\);)-12 2397 y(void)262 -b(lua_pushcfunction)189 b(\(lua_CFunction)22 b(f\);)-12 2454 -y(void)262 b(lua_pushusertag)237 b(\(void)23 b(*u,)g(int)h(tag\);)-12 -2547 y Fn(plus)16 b(the)g(macro:)-12 2641 y Fl(void)262 b(lua_pushuserdata) -213 b(\(void)23 b(*u\);)-12 2735 y Fn(All)16 b(of)d(them)h(receiv)o(e)h(a)f -(C)g(v)m(alue,)h(con)o(v)o(ert)f(it)g(to)g(a)f Fl(lua_Object)p -Fn(,)g(and)h(lea)o(v)o(e)h(their)f(results)h(on)f(the)g(top)g(of)-12 -2791 y(the)h(Lua)f(stac)o(k,)g(where)g(it)h(can)g(b)q(e)g(assigned)g(to)e(a)h -(v)m(ariable,)i(passed)f(as)f(paramen)o(ter)f(to)h(a)g(Lua)h(function,)-12 -2848 y(etc)f(\(see)g(b)q(elo)o(w\).)20 b Fl(lua_pushliteral)11 -b Fn(is)k(lik)o(e)g Fl(lua_pushstring)p Fn(,)d(but)i(also)g(puts)f(the)h -(string)g(in)h(the)f(Lua)899 2976 y(11)p eop -%%Page: 12 12 -bop -12 160 a Fn(literal)17 b(table.)k(This)16 b(a)o(v)o(oids)f(the)h(string) -f(to)g(b)q(e)h(garbage)f(collected,)h(and)g(therefore)f(has)h(a)f(b)q(etter)g -(o)o(v)o(erall)-12 216 y(p)q(erformance.)20 b(As)14 b(a)h(rule,)g(when)g(the) -f(string)h(to)e(b)q(e)j(pushed)f(is)g(a)f(literal,)i Fl(lua_pushliteral)c -Fn(should)k(b)q(e)-12 273 y(used.)59 329 y(User)g(data)f(can)i(ha)o(v)o(e)e -(di\013eren)o(t)i(tags,)e(whose)h(seman)o(tics)g(are)g(de\014ned)i(b)o(y)e -(the)g(host)g(program.)21 b(An)o(y)-12 385 y(p)q(ositiv)o(e)e(in)o(teger)f -(can)g(b)q(e)g(used)h(to)e(tag)g(a)g(user)h(data.)27 b(When)18 -b(a)g(user)g(data)f(is)h(retriev)o(ed,)h(the)e(function)-12 -442 y Fl(lua_type)d Fn(can)i(b)q(e)f(used)h(to)f(get)g(its)g(tag.)59 -498 y(T)l(o)d(complete)h(the)g(set,)g(the)f(v)m(alue)i Fk(nil)g -Fn(or)e(a)g Fl(lua_Object)g Fn(can)g(also)h(b)q(e)g(pushed)h(on)o(to)e(the)g -(stac)o(k,)g(with:)-12 588 y Fl(void)262 b(lua_pushnil)333 -b(\(void\);)-12 644 y(void)262 b(lua_pushobject)f(\(lua_Object)22 -b(object\);)-12 765 y Fd(5.3)56 b(Manipulating)18 b(Lua)h(Ob)s(jects)-12 -851 y Fn(T)l(o)c(read)g(the)h(v)m(alue)g(of)f(an)o(y)g(global)g(Lua)h(v)m -(ariable,)g(one)f(can)h(use)f(the)h(function:)-12 940 y Fl(lua_Object)118 -b(lua_getglobal)285 b(\(char)23 b(*varname\);)-12 1029 y Fn(T)l(o)15 -b(store)g(a)f(v)m(alue)j(previously)f(pushed)h(on)o(to)d(the)h(stac)o(k)g(in) -h(a)f(global)g(v)m(ariable,)i(there)e(is)h(the)f(function:)-12 -1119 y Fl(void)262 b(lua_storeglobal)237 b(\(char)23 b(*varname\);)59 -1208 y Fn(T)l(ables)16 b(can)f(also)g(b)q(e)h(manipulated)h(via)e(the)g(API.) -h(The)f(function)-12 1297 y Fl(lua_Object)118 b(lua_getsubscript)213 -b(\(void\);)-12 1386 y Fn(exp)q(ects)15 b(on)g(the)f(stac)o(k)g(a)g(table)h -(and)g(an)f(index,)i(and)e(returns)h(the)f(con)o(ten)o(ts)g(of)g(the)h(table) -g(at)f(that)f(index.)-12 1443 y(As)22 b(in)h(Lua,)g(if)f(the)g(\014rst)g(ob)s -(ject)f(is)h(not)g(a)f(table,)j(or)d(the)h(index)h(is)g(not)e(presen)o(t)h -(in)h(the)f(table,)h(the)-12 1499 y(corresp)q(onden)o(t)16 -b(fallbac)o(k)g(is)f(called.)59 1556 y(F)l(or)f(compatibilit)o(y)j(with)f -(previous)g(v)o(ersions)f(of)g(the)g(API,)g(the)g(follo)o(wing)h(macros)f -(are)g(supp)q(orted:)-12 1645 y Fl(lua_Object)118 b(lua_getindexed)261 -b(\(lua_Object)22 b(table,)h(float)g(index\);)-12 1702 y(lua_Object)118 -b(lua_getfield)309 b(\(lua_Object)22 b(table,)h(char)g(*field\);)-12 -1791 y Fn(The)16 b(\014rst)e(one)i(is)f(used)h(for)f(n)o(umeric)h(indices,)h -(while)f(the)g(second)f(can)h(b)q(e)g(used)f(for)g(an)o(y)g(string)g(index.) -59 1847 y(T)l(o)h(store)g(a)h(v)m(alue)h(in)g(an)f(index,)h(the)f(program)e -(m)o(ust)i(push)g(on)o(to)f(the)h(stac)o(k)f(the)h(table,)g(the)g(index,)-12 -1904 y(and)f(the)f(v)m(alue,)h(and)f(then)h(call)g(the)f(function:)-12 -1993 y Fl(void)24 b(lua_storesubscript)d(\(void\);)-12 2082 -y Fn(Again,)15 b(the)h(corresp)q(onden)o(t)f(fallbac)o(k)h(is)g(called)h(if)e -(needed.)59 2139 y(Finally)l(,)h(the)g(function)-12 2228 y -Fl(lua_Object)118 b(lua_createtable)237 b(\(void\);)-12 2317 -y Fn(creates)15 b(a)g(new)g(table.)59 2374 y Fm(Ple)n(ase)g(Notic)n(e:)24 -b Fn(Most)15 b(functions)h(from)g(the)f(Lua)i(library)f(receiv)o(e)h -(parameters)e(through)h(the)f(stac)o(k.)-12 2430 y(Because)k(other)f -(functions)h(also)f(use)h(the)f(stac)o(k,)g(it)g(is)h(imp)q(ortan)o(t)f(that) -f(these)i(parameters)e(b)q(e)i(pushed)-12 2487 y(just)c(b)q(efore)g(the)f -(corresp)q(onden)o(t)h(call,)h(without)f(in)o(termediate)g(calls)h(to)e(the)h -(Lua)g(library)l(.)21 b(F)l(or)14 b(instance,)-12 2543 y(supp)q(ose)i(the)f -(user)h(w)o(an)o(ts)e(the)h(v)m(alue)i(of)d Fl(a[i])p Fn(.)20 -b(A)15 b(simplistic)i(solution)f(w)o(ould)g(b)q(e:)36 2632 -y Fl(/*)24 b(Warning:)e(WRONG)h(CODE)h(*/)36 2689 y(lua_Object)e(result;)36 -2745 y(lua_pushobject\(lua_getglo)o(bal\("a"\))o(\);)45 b(/*)23 -b(push)h(table)f(*/)36 2802 y(lua_pushobject\(lua_getglo)o(bal\("i"\))o(\);) -45 b(/*)23 b(push)h(index)f(*/)36 2858 y(result)g(=)h(lua_getsubscript\(\);) -899 2976 y Fn(12)p eop -%%Page: 13 13 -bop -12 160 a Fn(Ho)o(w)o(ev)o(er,)12 b(the)g(call)h Fl(lua_getglobal\("i"\)) -c Fn(mo)q(di\014es)14 b(the)e(stac)o(k,)f(and)h(in)o(v)m(alidates)i(the)e -(previous)h(pushed)-12 216 y(v)m(alue.)21 b(A)16 b(correct)e(solution)i -(could)g(b)q(e:)36 310 y Fl(lua_Object)22 b(index,)h(result;)36 -366 y(index)g(=)h(lua_getglobal\("i"\);)36 423 y(lua_pushobject\(lua_getglo)o -(bal\("a"\))o(\);)45 b(/*)23 b(push)h(table)f(*/)36 479 y -(lua_pushobject\(index\);)355 b(/*)23 b(push)h(index)f(*/)36 -536 y(result)g(=)h(lua_getsubscript\(\);)-12 657 y Fd(5.4)56 -b(Calling)18 b(Lua)h(F)-5 b(unctions)-12 743 y Fn(F)l(unctions)12 -b(de\014ned)h(in)f(Lua)g(b)o(y)f(a)h(mo)q(dule)g(executed)g(with)g -Fl(dofile)f Fn(or)g Fl(dostring)f Fn(can)h(b)q(e)i(called)g(from)d(the)-12 -800 y(host)h(program.)17 b(This)12 b(is)g(done)g(using)g(the)f(follo)o(wing)h -(proto)q(col:)18 b(\014rst,)11 b(the)g(argumen)o(ts)g(to)f(the)i(function)g -(are)-12 856 y(pushed)17 b(on)o(to)e(the)h(Lua)g(stac)o(k)f(\(see)h(Section)g -(5.2\),)f(in)h(direct)h(order,)e(i.e.,)h(the)f(\014rst)h(argumen)o(t)f(is)h -(pushed)-12 913 y(\014rst.)24 b(Again,)18 b(it)f(is)g(imp)q(ortan)o(t)f(to)g -(emphasize)i(that,)e(during)i(this)f(phase,)g(no)g(other)f(Lua)i(function)f -(can)-12 969 y(b)q(e)f(called.)59 1026 y(Then,)f(the)g(function)h(is)g -(called)h(using)-12 1119 y Fl(int)286 b(lua_call)405 b(\(char)23 -b(*functionname\);)-12 1213 y Fn(or)-12 1307 y Fl(int)286 b(lua_callfunction) -213 b(\(lua_Object)22 b(function\);)-12 1401 y Fn(Both)16 b(functions)g -(return)g(an)f(error)g(co)q(de:)21 b(0,)15 b(in)i(case)e(of)g(success;)h(non) -g(zero,)f(in)i(case)f(of)f(errors.)20 b(Finally)l(,)-12 1457 -y(the)15 b(returned)g(v)m(alues)g(\(a)f(Lua)h(function)h(ma)o(y)e(return)g -(man)o(y)g(v)m(alues\))i(can)e(b)q(e)h(retriev)o(ed)g(with)g(the)g(macro)-12 -1551 y Fl(lua_Object)118 b(lua_getresult)309 b(\(int)23 b(number\);)-12 -1645 y(number)15 b Fn(is)g(the)h(order)f(of)f(the)i(result,)f(starting)f -(with)i(1.)k(When)15 b(called)i(with)f(a)f(n)o(um)o(b)q(er)g(larger)g(than)g -(the)-12 1701 y(actual)h(n)o(um)o(b)q(er)f(of)g(results,)g(this)h(function)g -(returns)f Fl(LUA_NOOBJECT)p Fn(.)59 1758 y(Tw)o(o)c(sp)q(ecial)i(Lua)g -(functions)f(ha)o(v)o(e)g(exclusiv)o(e)h(in)o(terfaces:)19 -b Fl(error)11 b Fn(and)h Fl(setfallback)p Fn(.)17 b(A)12 b(C)f(function)-12 -1814 y(can)16 b(generate)e(a)h(Lua)h(error)e(calling)j(the)f(function)-12 -1908 y Fl(void)24 b(lua_error)e(\(char)h(*message\);)-12 2002 -y Fn(This)c(function)h(nev)o(er)e(returns.)30 b(If)19 b(the)g(C)f(function)h -(has)g(b)q(een)g(called)i(from)c(Lua,)j(the)e(corresp)q(onding)-12 -2058 y(Lua)g(execution)h(terminates,)f(as)f(if)i(an)e(error)g(had)h(o)q -(ccured)h(inside)h(Lua)e(co)q(de.)28 b(Otherwise,)19 b(the)f(whole)-12 -2115 y(program)c(terminates.)59 2171 y(F)l(allbac)o(ks)i(can)f(b)q(e)h(c)o -(hanged)f(with:)-12 2265 y Fl(lua_Object)23 b(lua_setfallback)e(\(char)j -(*name,)f(lua_CFunction)f(fallback\);)-12 2359 y Fn(The)17 -b(\014rst)g(parameter)f(is)h(the)g(fallbac)o(k)h(name,)e(and)h(the)g(second)h -(a)e(CF)l(unction)i(to)e(b)q(e)h(used)h(as)e(the)h(new)-12 -2415 y(fallbac)o(k.)32 b(This)19 b(function)h(returns)e(a)h -Fl(lua_Object)p Fn(,)f(whic)o(h)h(is)h(the)f(old)g(fallbac)o(k)h(v)m(alue,)g -(or)e(nil)j(on)d(fail)-12 2472 y(\(in)o(v)m(alid)f(fallbac)o(k)f(name\).)k -(This)c(old)f(v)m(alue)i(can)e(b)q(e)h(used)g(for)e(c)o(haining)j(fallbac)o -(ks.)59 2528 y(An)e(example)h(of)f(C)g(co)q(de)h(calling)h(a)e(Lua)g -(function)h(is)g(sho)o(wn)f(in)h(Section)g(7.6.)899 2976 y(13)p -eop -%%Page: 14 14 -bop -12 160 a Fd(5.5)56 b(C)19 b(F)-5 b(unctions)-12 245 y -Fn(T)l(o)15 b(register)g(a)g(C)g(function)h(to)f(Lua,)g(there)g(is)h(the)f -(follo)o(wing)h(macro:)-12 322 y Fl(#define)23 b(lua_register\(n,f\))165 -b(\(lua_pushcfunction\(f\),)21 b(lua_storeglobal\(n\)\))-12 -378 y(/*)j(char)f(*n;)214 b(*/)-12 435 y(/*)24 b(lua_CFunction)e(f;)h(*/)-12 -511 y Fn(whic)o(h)d(receiv)o(es)f(the)g(name)g(the)g(function)g(will)i(ha)o -(v)o(e)d(in)h(Lua,)h(and)f(a)f(p)q(oin)o(ter)i(to)e(the)g(function.)32 -b(This)-12 567 y(p)q(oin)o(ter)16 b(m)o(ust)f(ha)o(v)o(e)f(t)o(yp)q(e)i -Fl(lua_CFunction)p Fn(,)d(whic)o(h)j(is)f(de\014ned)i(as)-12 -644 y Fl(typedef)23 b(void)g(\(*lua_CFunction\))f(\(void\);)-12 -720 y Fn(that)15 b(is,)g(a)g(p)q(oin)o(ter)h(to)e(a)h(function)h(with)g(no)f -(parameters)f(and)h(no)h(results.)59 776 y(In)j(order)f(to)g(comm)o(unicate)g -(prop)q(erly)i(with)e(Lua,)i(a)e(C)g(function)h(m)o(ust)f(follo)o(w)h(a)f -(proto)q(col,)g(whic)o(h)-12 833 y(de\014nes)e(the)g(w)o(a)o(y)e(parameters)g -(and)i(results)f(are)g(passed.)59 889 y(T)l(o)g(access)g(its)g(argumen)o(ts,) -f(a)h(C)g(function)h(calls:)-12 965 y Fl(lua_Object)118 b(lua_getparam)309 -b(\(int)23 b(number\);)-12 1042 y(number)17 b Fn(starts)g(with)h(1)g(to)f -(get)g(the)h(\014rst)g(argumen)o(t.)27 b(When)18 b(called)i(with)e(a)f(n)o -(um)o(b)q(er)i(larger)e(than)h(the)-12 1098 y(actual)d(n)o(um)o(b)q(er)g(of)f -(argumen)o(ts,)f(this)j(function)f(returns)f Fl(LUA_NOOBJECT)p -Fn(.)f(In)i(this)g(w)o(a)o(y)l(,)f(it)g(is)i(p)q(ossible)g(to)-12 -1155 y(write)f(functions)h(that)f(w)o(ork)f(with)i(a)f(v)m(ariable)h(n)o(um)o -(b)q(er)g(of)e(parameters.)59 1211 y(T)l(o)j(return)h(v)m(alues,)i(a)d(C)h -(function)h(just)f(pushes)g(them)g(on)o(to)f(the)i(stac)o(k,)e(in)i(direct)g -(order;)f(see)h(Sec-)-12 1268 y(tion)d(5.2.)j(Lik)o(e)d(a)f(Lua)g(function,)h -(a)f(C)g(function)h(called)g(b)o(y)g(Lua)f(can)g(also)h(return)f(man)o(y)f -(results.)59 1324 y(Section)i(7.5)e(presen)o(ts)h(an)g(example)h(of)f(a)g(CF) -l(unction.)-12 1442 y Fd(5.6)56 b(Lo)r(c)n(king)17 b(Lua)i(Ob)s(jects)-12 -1528 y Fn(As)14 b(already)g(noted,)g Fl(lua_Object)p Fn(s)f(are)g(v)o -(olatile.)21 b(If)14 b(the)g(C)g(co)q(de)g(needs)h(to)e(k)o(eep)i(a)e -Fl(lua_Object)g Fn(outside)-12 1585 y(blo)q(c)o(k)f(b)q(oundaries,)g(it)f -(has)g(to)f Fm(lo)n(ck)g Fn(the)h(ob)s(ject.)18 b(The)11 b(routines)g(to)f -(manipulate)i(lo)q(c)o(king)g(are)e(the)h(follo)o(wing:)-12 -1661 y Fl(int)191 b(lua_lock)22 b(\(void\);)-12 1717 y(lua_Object)h -(lua_getlocked)46 b(\(int)23 b(ref\);)-12 1774 y(void)167 b(lua_pushlocked)22 -b(\(int)h(ref\);)-12 1830 y(void)167 b(lua_unlock)22 b(\(int)h(ref\);)-12 -1907 y Fn(The)f(function)h Fl(lua_lock)d Fn(lo)q(c)o(ks)i(the)g(ob)s(ject)f -(whic)o(h)h(are)g(on)f(the)h(top)f(of)g(the)h(stac)o(k,)g(and)g(returns)g(a) --12 1963 y(reference)g(to)f(it.)37 b(Whenev)o(er)22 b(the)f(lo)q(c)o(k)o(ed)h -(ob)s(ject)f(is)g(needed,)j(a)d(call)h(to)e Fl(lua_getlocked)g -Fn(returns)h(a)-12 2019 y(handle)c(to)f(it,)g(while)h Fl(lua_pushlocked)d -Fn(pushes)j(the)f(handle)h(on)f(the)g(stac)o(k.)22 b(When)16 -b(a)g(lo)q(c)o(k)o(ed)g(ob)s(ject)g(is)-12 2076 y(no)f(longer)h(needed,)g(it) -f(can)h(b)q(e)g(unlo)q(c)o(k)o(ed)g(with)g(a)e(call)j(to)d -Fl(lua_unlock)p Fn(.)-12 2216 y Fo(6)69 b(Prede\014ned)23 b(F)-6 -b(unctions)23 b(and)g(Libraries)-12 2317 y Fn(The)12 b(set)f(of)g -(prede\014ned)i(functions)f(in)g(Lua)g(is)f(small)h(but)g(p)q(o)o(w)o(erful.) -19 b(Most)10 b(of)h(them)g(pro)o(vide)h(features)f(that)-12 -2374 y(allo)o(ws)16 b(some)f(degree)h(of)f(re\015exivit)o(y)h(in)h(the)e -(language.)21 b(Man)o(y)15 b(of)g(these)h(features)f(cannot)g(b)q(e)h(sim)o -(ulated)-12 2430 y(with)g(the)f(rest)g(of)g(the)g(Language)g(nor)g(with)g -(the)h(standard)f(API.)59 2487 y(The)21 b(libraries,)i(on)d(the)h(other)f -(hand,)i(pro)o(vide)g(useful)f(routines)g(that)f(are)h(implemen)o(ted)h -(directly)-12 2543 y(through)13 b(the)f(standard)h(API.)f(Therefore,)h(they)g -(are)f(not)g(necessary)h(to)f(the)h(language,)g(and)g(are)f(pro)o(vided)-12 -2600 y(as)j(separated)g(C)g(mo)q(dules.)21 b(Curren)o(tly)15 -b(there)g(are)g(three)h(standard)e(libraries:)56 2676 y Fi(\017)23 -b Fn(string)15 b(manipulation;)56 2763 y Fi(\017)23 b Fn(mathematical)15 -b(functions)h(\(sin,)f(cos,)g(etc\);)56 2849 y Fi(\017)23 b -Fn(input)16 b(and)f(output;)899 2976 y(14)p eop -%%Page: 15 15 -bop -12 160 a Fd(6.1)56 b(Prede\014ned)18 b(F)-5 b(unctions)-12 -245 y Fl(dofile)23 b(\(filename\))-12 331 y Fn(This)e(function)g(receiv)o(es) -g(a)f(\014le)h(name,)g(op)q(ens)f(it)h(and)f(executes)h(its)f(con)o(ten)o(ts) -g(as)f(a)h(Lua)g(mo)q(dule.)36 b(It)-12 388 y(returns)15 b(1)g(if)h(there)f -(are)g(no)g(errors,)f Fk(nil)i Fn(otherwise.)-12 508 y Fl(dostring)23 -b(\(string\))-12 594 y Fn(This)17 b(function)f(executes)h(a)e(giv)o(en)i -(string)e(as)h(a)f(Lua)i(mo)q(dule.)23 b(It)16 b(returns)f(1)h(if)g(there)g -(are)g(no)f(errors,)g Fk(nil)-12 650 y Fn(otherwise.)-12 770 -y Fl(next)24 b(\(table,)e(index\))-12 856 y Fn(This)16 b(function)h(allo)o -(ws)e(a)g(program)g(to)g(en)o(umerate)g(all)h(\014elds)h(of)e(a)g(table.)21 -b(Its)16 b(\014rst)f(argumen)o(t)g(is)h(a)f(table)-12 912 y(and)i(its)g -(second)g(argumen)o(t)f(is)h(an)g(index)g(in)h(this)f(table;)g(this)g(index)h -(can)f(b)q(e)g(a)g(n)o(um)o(b)q(er)g(or)f(a)g(string.)24 b(It)-12 -969 y(returns)15 b(the)f(next)h(index)h(of)e(the)g(table)h(and)g(the)g(v)m -(alue)h(asso)q(ciated)e(with)h(the)g(index.)21 b(When)15 b(called)h(with)-12 -1025 y Fk(nil)g Fn(as)e(its)g(second)h(argumen)o(t,)f(the)g(function)i -(returns)e(the)h(\014rst)f(index)i(of)e(the)g(table)h(\(and)f(its)h(asso)q -(ciated)-12 1082 y(v)m(alue\).)21 b(When)16 b(called)g(with)g(the)f(last)g -(index,)h(or)f(with)h Fk(nil)g Fn(in)g(an)f(empt)o(y)g(table,)g(it)h(returns) -f Fk(nil)p Fn(.)59 1138 y(In)h(Lua)h(there)f(is)g(no)g(declaration)h(of)e -(\014elds;)i(seman)o(tically)l(,)h(there)e(is)g(no)g(di\013erence)h(b)q(et)o -(w)o(een)f(a)g(\014eld)-12 1195 y(not)i(presen)o(t)f(in)i(a)f(table)g(or)f(a) -h(\014eld)h(with)f(v)m(alue)h Fk(nil)p Fn(.)29 b(Therefore,)18 -b(the)f(function)i(only)f(considers)h(\014elds)-12 1251 y(with)d(non)f(nil)i -(v)m(alues.)k(The)16 b(order)f(the)g(indices)j(are)d(en)o(umerated)g(are)g -(not)g(sp)q(eci\014ed,)i Fm(even)f(for)g(numeric)-12 1308 y(indic)n(es)p -Fn(.)59 1364 y(See)g(Section)g(7.1)e(for)g(an)i(example)g(of)e(the)i(use)f -(of)g(this)h(function.)-12 1484 y Fl(nextvar)23 b(\(name\))-12 -1570 y Fn(This)14 b(function)g(is)g(similar)g(to)e(the)i(function)g -Fl(next)p Fn(,)e(but)i(it)f(iterates)g(o)o(v)o(er)f(the)i(global)f(v)m -(ariables.)21 b(Its)13 b(single)-12 1626 y(argumen)o(t)18 b(is)i(the)f(name)g -(of)g(a)f(global)i(v)m(ariable,)h(or)d Fk(nil)i Fn(to)f(get)f(a)h(\014rst)f -(name.)32 b(Similarly)21 b(to)d Fl(next)p Fn(,)h(it)-12 1683 -y(returns)e(the)f(name)h(of)f(another)g(v)m(ariable)i(and)f(its)g(v)m(alue,)h -(or)e Fk(nil)h Fn(if)h(there)e(are)h(no)f(more)g(v)m(ariables.)26 -b(See)-12 1739 y(Section)16 b(7.1)f(for)f(an)h(example)h(of)f(the)g(use)h(of) -f(this)g(function.)-12 1859 y Fl(print)23 b(\(e1,)h(e2,)f(...\))-12 -1945 y Fn(This)13 b(function)g(receiv)o(es)g(an)o(y)f(n)o(um)o(b)q(er)g(of)g -(argumen)o(ts,)g(and)g(prin)o(ts)g(their)h(v)m(alues)h(in)f(a)e(reasonable)i -(format.)-12 2002 y(Eac)o(h)h(v)m(alue)i(is)e(prin)o(ted)h(in)g(a)f(new)h -(line.)21 b(This)15 b(function)g(is)f(not)g(in)o(tended)i(for)e(formatted)f -(output,)g(but)i(as)-12 2058 y(a)g(quic)o(k)h(w)o(a)o(y)e(to)h(sho)o(w)g(a)g -(v)m(alue,)h(for)f(instance)h(for)e(error)h(messages)g(or)f(debugging.)22 -b(See)15 b(Section)i(6.4)d(for)-12 2114 y(functions)i(for)f(formatted)f -(output.)-12 2235 y Fl(tonumber)23 b(\(e\))-12 2320 y Fn(This)18 -b(function)g(receiv)o(es)f(one)g(argumen)o(t,)g(and)g(tries)g(to)f(con)o(v)o -(ert)h(it)g(to)f(a)h(n)o(um)o(b)q(er.)25 b(If)18 b(the)f(argumen)o(t)f(is)-12 -2377 y(already)e(a)f(n)o(um)o(b)q(er)h(or)f(a)g(string)g(con)o(v)o(ertible)h -(to)f(a)g(n)o(um)o(b)q(er)h(\(see)f(Section)i(4.2\),)d(it)h(returns)h(that)e -(n)o(um)o(b)q(er;)-12 2433 y(otherwise,)j(it)h(returns)f Fk(nil)p -Fn(.)-12 2553 y Fl(type)24 b(\(v\))-12 2639 y Fn(This)16 b(function)g(allo)o -(ws)f(Lua)h(to)e(test)h(the)g(t)o(yp)q(e)g(of)g(a)f(v)m(alue.)21 -b(It)16 b(receiv)o(es)g(one)f(argumen)o(t,)f(and)h(returns)g(its)-12 -2696 y(t)o(yp)q(e,)h(co)q(ded)g(as)g(a)f(string.)21 b(The)16 -b(p)q(ossible)i(results)e(of)f(this)h(function)g(are)g Fl('nil')p -Fn(,)f Fl('number')p Fn(,)f Fl('string')p Fn(,)-12 2752 y Fl('table')p -Fn(,)g Fl('cfunction')p Fn(,)f Fl('function')p Fn(,)h(and)h -Fl('userdata')p Fn(.)899 2976 y(15)p eop -%%Page: 16 16 -bop -12 160 a Fl(error)23 b(\(message\))-12 245 y Fn(This)16 -b(function)h(issues)f(an)f(error)g(message)g(and)h(terminates)g(the)f(last)h -(called)h(function)f(from)f(the)h(library)-12 302 y(\()p Fl(lua_dofile)p -Fn(,)d Fl(lua_dostring)p Fn(,)g Fc(:)8 b(:)g(:)e Fn(\).)20 -b(It)15 b(nev)o(er)g(returns.)-12 422 y Fl(setglobal)23 b(\(name,)g(value\)) --12 508 y Fn(This)18 b(function)g(assigns)g(the)f(giv)o(en)h(v)m(alue)h(to)d -(a)h(global)i(v)m(ariable.)27 b(The)18 b(string)f Fl(name)g -Fn(do)q(es)h(not)f(need)h(to)-12 564 y(b)q(e)g(a)f(syn)o(tactically)h(v)m -(alid)h(v)m(ariable)g(name.)26 b(Therefore,)18 b(this)g(function)g(can)f(set) -g(global)h(v)m(ariables)h(with)-12 621 y(strange)c(names)g(lik)o(e)h -Fl(m)24 b(v)g(1)15 b Fn(or)f Fl(34)p Fn(.)-12 741 y Fl(getglobal)23 -b(\(name\))-12 827 y Fn(This)18 b(function)f(retriev)o(es)g(the)g(v)m(alue)h -(of)f(a)f(global)i(v)m(ariable.)26 b(The)17 b(string)g Fl(name)f -Fn(do)q(es)i(not)e(need)i(to)e(b)q(e)i(a)-12 883 y(syn)o(tactically)e(v)m -(alid)h(v)m(ariable)g(name.)-12 1003 y Fl(setfallback)23 b(\(fallbackname,)e -(newfallback\))-12 1089 y Fn(This)f(function)g(sets)f(a)g(new)g(fallbac)o(k)h -(function)g(to)e(the)h(giv)o(en)h(fallbac)o(k.)32 b(It)20 b(returns)f(the)g -(old)h(fallbac)o(k)-12 1145 y(function,)c(or)f(nil)h(in)g(case)f(of)g(error)g -(\(in)o(v)m(alid)i(fallbac)o(k)f(name,)f(or)f Fl(newfallback)g -Fn(is)i(not)e(a)h(function\).)-12 1267 y Fd(6.2)56 b(String)18 -b(Manipulation)-12 1353 y Fn(This)e(library)f(pro)o(vides)h(generic)g -(functions)f(for)f(string)h(manipulation,)h(suc)o(h)g(as)e(\014nding)i(and)f -(extracting)-12 1409 y(substrings.)20 b(When)14 b(indexing)h(a)e(string,)g -(the)h(\014rst)f(c)o(haracter)f(has)i(p)q(osition)g(1.)19 b(See)14 -b(Section)g(7.2)f(for)g(some)-12 1466 y(examples)j(on)f(string)g -(manipulation)i(in)f(Lua.)-12 1586 y Fl(strfind)23 b(\(str,)g(substr,)g -([init,)g([end]]\))-12 1672 y Fn(Receiv)o(es)15 b(t)o(w)o(o)d(string)i -(argumen)o(ts,)e(and)i(returns)f(a)g(n)o(um)o(b)q(er.)20 b(This)14 -b(n)o(um)o(b)q(er)g(indicates)h(the)e(\014rst)g(p)q(osition)-12 -1728 y(where)20 b(the)f(second)h(argumen)o(t)e(app)q(ears)i(in)g(the)f -(\014rst)g(argumen)o(t.)31 b(If)19 b(the)h(second)g(argumen)o(t)e(is)i(not)f -(a)-12 1785 y(substring)i(of)f(the)g(\014rst)g(one,)i(then)e -Fl(strfind)g Fn(returns)g Fk(nil)p Fn(.)36 b(A)21 b(third)g(optional)f(n)o -(umerical)i(argumen)o(t)-12 1841 y(sp)q(eci\014es)e(where)f(to)f(start)f(the) -i(searc)o(h.)29 b(Another)19 b(optional)g(n)o(umerical)g(argumen)o(t)f(sp)q -(eci\014es)i(where)f(to)-12 1897 y(stop)c(it.)-12 2018 y Fl(strlen)23 -b(\(s\))-12 2103 y Fn(Receiv)o(es)17 b(a)e(string)g(and)g(returns)g(its)h -(length.)-12 2223 y Fl(strsub)23 b(\(s,)h(i,)f(j\))-12 2309 -y Fn(Returns)13 b(another)f(string,)h(whic)o(h)g(is)g(a)f(substring)h(of)f -Fl(s)p Fn(,)h(starting)f(at)g Fl(i)g Fn(and)h(runing)g(un)o(til)h -Fl(j)p Fn(.)k(If)13 b Fl(j)g Fn(is)g(absen)o(t)-12 2366 y(or)18 -b(is)g Fk(nil)p Fn(,)i(it)e(is)g(assumed)h(to)e(b)q(e)i(equal)g(to)e(the)h -(length)h(of)e Fl(s)p Fn(.)29 b(P)o(articularly)l(,)19 b(the)f(call)h -Fl(strsub\(s,1,j\))-12 2422 y Fn(returns)e(a)f(pre\014x)i(of)e -Fl(s)h Fn(with)g(length)g Fl(j)p Fn(,)g(while)h(the)f(call)h -Fl(strsub\(s,i\))d Fn(returns)i(a)f(su\016x)h(of)f Fl(s)p Fn(,)h(starting)-12 -2479 y(at)e Fl(i)p Fn(..)-12 2599 y Fl(strlower)23 b(\(s\))-12 -2684 y Fn(Receiv)o(es)16 b(a)d(string)i(and)f(returns)g(a)f(cop)o(y)h(of)g -(that)f(string)h(with)h(all)g(upp)q(er)g(case)f(letters)g(c)o(hanged)g(to)g -(lo)o(w)o(er)-12 2741 y(case.)20 b(All)d(other)d(c)o(haracters)h(are)g(left)g -(unc)o(hanged.)899 2976 y(16)p eop -%%Page: 17 17 -bop -12 160 a Fl(strupper)23 b(\(s\))-12 245 y Fn(Receiv)o(es)16 -b(a)d(string)i(and)f(returns)g(a)f(cop)o(y)h(of)g(that)f(string)h(with)h(all) -g(lo)o(w)o(er)e(case)h(letters)h(c)o(hanged)f(to)f(upp)q(er)-12 -302 y(case.)20 b(All)d(other)d(c)o(haracters)h(are)g(left)g(unc)o(hanged.)-12 -424 y Fd(6.3)56 b(Mathematical)16 b(F)-5 b(unctions)-12 509 -y Fn(This)20 b(library)f(is)h(an)f(in)o(terface)g(to)f(some)h(functions)h(of) -e(the)h(standard)g(C)f(math)h(library)l(.)32 b(Moreo)o(v)o(er,)18 -b(it)-12 566 y(registers)d(a)f(fallbac)o(k)h(for)f(the)h(binary)g(op)q -(erator)f Fl(^)h Fn(whic)o(h,)g(when)g(applied)i(to)d(n)o(um)o(b)q(ers)h -Fl(x^y)p Fn(,)e(returns)i Fc(x)1821 549 y Fb(y)1842 566 y Fn(.)59 -622 y(The)g(library)h(pro)o(vides)g(the)f(follo)o(wing)h(functions:)-12 -716 y Fl(abs)24 b(acos)f(asin)g(atan)h(ceil)f(cos)g(floor)h(log)f(log10)-12 -773 y(max)h(min)47 b(mod)g(sin)h(sqrt)23 b(tan)-12 866 y Fn(Most)16 -b(of)g(them)h(are)g(only)g(in)o(terfaces)g(to)f(the)h(homon)o(ymous)f -(functions)i(in)g(the)f(C)f(library)l(,)i(except)f(that,)-12 -923 y(for)e(the)g(trigonometric)g(functions,)h(all)g(angles)f(are)g -(expressed)h(in)g(degrees.)59 979 y(The)d(function)g Fl(max)g -Fn(returns)f(the)h(maxim)o(um)g(v)m(alue)h(in)f(a)g(list)g(of)g(n)o(umeric)g -(argumen)o(ts.)19 b(Similarly)l(,)c Fl(min)-12 1036 y Fn(computes)g(the)h -(minim)o(um.)21 b(Both)15 b(can)g(b)q(e)h(used)g(with)f(an)g(unlimited)j(n)o -(um)o(b)q(er)d(of)g(argumen)o(ts.)59 1092 y(The)g(function)h -Fl(mod)f Fn(is)h(equiv)m(alen)o(t)h(to)d(the)h Fl(\045)g Fn(op)q(erator)g(in) -h(C.)-12 1214 y Fd(6.4)56 b(I/O)18 b(F)-5 b(acilities)-12 1300 -y Fn(All)16 b(I/O)g(op)q(erations)f(in)h(Lua)f(are)g(done)g(o)o(v)o(er)f(t)o -(w)o(o)g Fm(curr)n(ent)h Fn(\014les,)g(one)h(for)e(reading)i(and)f(one)g(for) -f(writing.)-12 1356 y(Initially)l(,)k(the)d(curren)o(t)g(input)h(\014le)h(is) -e Fl(stdin)p Fn(,)f(and)i(the)f(curren)o(t)g(output)g(\014le)h(is)g -Fl(stdout)p Fn(.)59 1413 y(Unless)g(otherwised)g(stated,)e(all)i(I/O)g -(functions)g(return)f(1)g(on)g(success)h(and)f Fk(nil)h Fn(on)f(failure.)-12 -1533 y Fl(readfrom)23 b(\(filename\))-12 1619 y Fn(This)17 -b(function)g(op)q(ens)g(a)f(\014le)h(named)g Fl(filename)e -Fn(and)i(sets)f(it)g(as)g(the)g Fm(curr)n(ent)h Fn(input)g(\014le.)24 -b(When)17 b(called)-12 1675 y(without)e(parameters,)f(this)i(function)g -(restores)e Fl(stdin)h Fn(as)g(the)g(curren)o(t)g(input)h(\014le.)-12 -1795 y Fl(writeto)23 b(\(filename\))-12 1881 y Fn(This)16 b(function)g(op)q -(ens)g(a)f(\014le)h(named)f Fl(filename)f Fn(and)i(sets)e(it)i(as)f(the)g -Fm(curr)n(ent)g Fn(output)g(\014le.)21 b(Notice)15 b(that,)-12 -1937 y(if)21 b(the)g(\014le)g(already)g(exists,)h(it)f(is)g(completely)h -(erased)e(with)h(this)g(op)q(eration.)36 b(When)21 b(called)h(without)-12 -1994 y(parameters,)14 b(this)i(function)g(restores)e Fl(stdout)h -Fn(as)f(the)i(curren)o(t)f(output)g(\014le.)-12 2114 y Fl(appendto)23 -b(\(filename\))-12 2200 y Fn(This)18 b(function)g(op)q(ens)f(a)g(\014le)h -(named)f Fl(filename)f Fn(and)h(sets)g(it)g(as)g(the)g Fm(curr)n(ent)g -Fn(output)f(\014le.)27 b(Unlik)o(e)18 b(the)-12 2256 y Fl(writeto)d -Fn(op)q(eration,)h(this)g(function)g(do)q(es)g(not)g(erase)f(an)o(y)h -(previous)g(con)o(ten)o(t)f(of)g(the)h(\014le.)23 b(When)16 -b(called)-12 2313 y(without)j(parameters,)g(this)h(function)g(restores)f -Fl(stdout)f Fn(as)h(the)g(curren)o(t)g(output)h(\014le.)33 -b(This)19 b(function)-12 2369 y(returns)c(2)g(if)h(the)f(\014le)h(already)g -(exists,)f(1)g(if)g(it)h(creates)f(a)g(new)g(\014le,)h(and)f -Fk(nil)i Fn(on)e(failure.)-12 2489 y Fl(read)24 b(\([format]\))-12 -2575 y Fn(This)12 b(function)g(returns)e(a)h(v)m(alue)h(read)f(from)f(the)h -(curren)o(t)g(input.)20 b(An)11 b(optional)g(string)g(argumen)o(t)f(sp)q -(eci\014es)-12 2631 y(the)15 b(w)o(a)o(y)g(the)g(input)h(is)g(in)o -(terpreted.)59 2688 y(Without)j(a)g(format)e(argumen)o(t,)i -Fl(read)g Fn(\014rst)g(skips)h(blanks,)g(tabs)f(and)g(newlines.)34 -b(Then)20 b(it)f(c)o(hec)o(ks)-12 2744 y(whether)g(the)h(curren)o(t)e(c)o -(haracter)h(is)g Fl(")g Fn(or)g Fl(')p Fn(.)31 b(If)19 b(so,)g(it)h(reads)f -(a)f(string)h(up)h(to)e(the)h(ending)i(quotation)-12 2801 y(mark,)14 -b(and)h(returns)f(this)h(string,)g(without)f(the)h(quotation)f(marks.)19 -b(Otherwise)d(it)f(reads)f(up)h(to)g(a)f(blank,)-12 2857 y(tab)h(or)g -(newline.)899 2976 y(17)p eop -%%Page: 18 18 -bop 59 160 a Fn(The)15 b(format)f(string)h(can)h(ha)o(v)o(e)e(the)i(follo)o -(wing)g(format:)60 253 y Fl(?[n])-12 347 y Fn(where)g Fl(?)f -Fn(can)g(b)q(e:)-12 441 y Fk('s')h(or)h('S')22 b Fn(to)15 b(read)g(a)g -(string;)-12 535 y Fk('f)5 b(')17 b(or)g('F')k Fn(to)15 b(read)g(a)g(real)g -(n)o(um)o(b)q(er;)-12 629 y Fk('i')i(or)g('I')22 b Fn(to)14 -b(read)i(an)f(in)o(teger.)-12 723 y(The)g(optional)g Fl(n)f -Fn(is)h(a)g(n)o(um)o(b)q(er)f(whic)o(h)i(sp)q(eci\014es)g(ho)o(w)e(man)o(y)g -(c)o(haracters)g(m)o(ust)g(b)q(e)h(read)g(to)f(comp)q(ose)g(the)-12 -779 y(input)i(v)m(alue.)-12 899 y Fl(write)23 b(\(value,)g([format]\))-12 -985 y Fn(This)16 b(function)g(writes)f(the)h(v)m(alue)g(of)f(its)g(\014rst)g -(argumen)o(t)g(to)f(the)i(curren)o(t)f(output.)k(An)d(optional)g(second)-12 -1041 y(argumen)o(t)g(sp)q(eci\014es)j(the)e(format)e(to)i(b)q(e)g(used.)26 -b(This)17 b(format)e(is)j(giv)o(en)f(as)g(a)f(string,)h(comp)q(osed)g(of)g -(four)-12 1098 y(parts.)i(The)d(\014rst)f(part)f(is)i(the)f(only)h(not)f -(optional,)g(and)h(m)o(ust)e(b)q(e)i(one)f(of)g(the)g(follo)o(wing)h(c)o -(haracters:)-12 1192 y Fk('s')g(or)h('S')22 b Fn(to)15 b(write)g(strings;)-12 -1285 y Fk('f)5 b(')17 b(or)g('F')k Fn(to)15 b(write)g(\015oats;)-12 -1379 y Fk('i')i(or)g('I')22 b Fn(to)14 b(write)i(in)o(tegers.)-12 -1473 y(These)g(c)o(haracters)e(can)i(b)q(e)f(follo)o(w)o(ed)h(b)o(y)60 -1567 y Fl([?][m][.n])-12 1661 y Fn(where:)-12 1754 y Fl(?)23 -b Fn(indicates)16 b(justi\014cation)g(inside)h(the)f(\014eld.)130 -1848 y(')p Fl(<)p Fn(')22 b(righ)o(t)15 b(justi\014cation;)130 -1921 y(')p Fl(>)p Fn(')22 b(left)15 b(justi\014cation;)130 -1994 y(')p Fl(|)p Fn(')22 b(cen)o(ter)15 b(justi\014cation.)-12 -2088 y Fl(m)23 b Fn(Indicates)16 b(the)f(\014eld)i(size)f(in)g(c)o -(haracters.)-12 2182 y Fl(.n)23 b Fn(F)l(or)16 b(reals,)i(indicates)g(the)f -(n)o(um)o(b)q(er)h(of)e(digital)j(places.)26 b(F)l(or)16 b(in)o(tegers,)i(it) -f(is)h(the)f(minim)o(um)h(n)o(um)o(b)q(er)102 2238 y(of)d(digits.)20 -b(This)c(option)f(has)h(no)f(meaning)g(for)g(strings.)59 2332 -y(When)e(called)i(without)e(a)g(format)f(string,)h(this)h(function)g(writes)f -(n)o(um)o(b)q(ers)g(using)h(the)f Fl(\045g)g Fn(format)f(and)-12 -2389 y(strings)j(with)h Fl(\045s)p Fn(.)-12 2509 y Fl(debug)23 -b(\(\))-12 2595 y Fn(This)e(function,)g(when)g(called,)h(rep)q(eatedly)f -(presen)o(ts)f(a)g(prompt)f Fl(lua_debug>)42 b Fn(in)21 b(the)f(error)f -(output)-12 2651 y(stream)h(\()p Fl(stderr)p Fn(\),)f(reads)i(a)f(line)i -(from)d(the)i(standard)f(input,)i(and)e(executes)h(\(\\dostring"\))f(the)g -(line.)-12 2708 y(The)e(lo)q(op)g(ends)f(when)h(the)g(user)f(t)o(yp)q(es)g -Fl(cont)g Fn(to)g(the)g(prompt.)26 b(This)18 b(function)g(then)g(returns)f -(and)g(the)-12 2764 y(execution)f(of)f(the)h(program)e(con)o(tin)o(ues.)899 -2976 y(18)p eop -%%Page: 19 19 -bop -12 160 a Fo(7)69 b(Some)21 b(Examples)-12 261 y Fn(This)f(section)h(giv) -o(es)e(examples)i(sho)o(wing)e(some)h(features)f(of)g(Lua.)34 -b(It)19 b(do)q(es)h(not)g(in)o(tend)g(to)f(co)o(v)o(er)g(the)-12 -318 y(whole)d(language,)f(but)g(only)h(to)f(illustrate)h(some)f(in)o -(teresting)h(uses)f(of)g(the)g(system.)-12 437 y Fd(7.1)56 -b(The)18 b(F)-5 b(unctions)19 b Fa(next)e Fd(and)j Fa(nextvar)-12 -523 y Fn(This)c(example)g(sho)o(ws)f(ho)o(w)f(to)h(use)g(the)h(function)g -Fl(next)e Fn(to)h(iterate)g(o)o(v)o(er)f(the)i(\014elds)g(of)f(a)g(table.)-12 -605 y Fl(function)23 b(f)h(\(t\))357 b(--)24 b(t)g(is)f(a)h(table)36 -661 y(local)f(i,)h(v)f(=)h(next\(t,)f(nil\))47 b(--)24 b(i)g(is)f(an)h(index) -f(of)g(t,)h(v)g(=)g(t[i])36 718 y(while)f(i)h(do)84 774 y(...)524 -b(--)24 b(do)f(something)g(with)g(i)h(and)g(v)84 831 y(i,)f(v)h(=)g(next\(t,) -f(i\))190 b(--)24 b(get)f(next)h(index)36 887 y(end)-12 944 -y(end)59 1026 y Fn(The)13 b(next)g(example)h(prin)o(ts)f(the)g(names)g(of)f -(all)i(global)g(v)m(ariables)g(in)g(the)f(system)g(with)g(non)g(nil)i(v)m -(alues:)-12 1108 y Fl(function)23 b(printGlobalVariables)e(\(\))36 -1164 y(local)i(i,)h(v)f(=)h(nextvar\(nil\))36 1221 y(while)f(i)h(do)84 -1277 y(print\(i\))84 1334 y(i,)f(v)h(=)g(nextvar\(i\))36 1390 -y(end)-12 1447 y(end)-12 1566 y Fd(7.2)56 b(String)18 b(Manipulation)-12 -1652 y Fn(The)e(\014rst)e(example)i(is)g(a)f(function)h(to)f(trim)g(extra)f -(blanks)i(at)f(the)g(b)q(eginning)i(and)f(end)g(of)e(a)h(string.)-12 -1734 y Fl(function)23 b(trim\(s\))36 1791 y(local)g(l)h(=)g(1)36 -1847 y(while)f(strsub\(s,l,l\))f(==)i(')f(')h(do)84 1904 y(l)f(=)h(l+1)36 -1960 y(end)36 2017 y(local)f(r)h(=)g(strlen\(s\))36 2073 y(while)f -(strsub\(s,r,r\))f(==)i(')f(')h(do)84 2129 y(r)f(=)h(r-1)36 -2186 y(end)36 2242 y(return)f(strsub\(s,l,r\))-12 2299 y(end)59 -2381 y Fn(The)15 b(second)h(example)g(sho)o(ws)e(a)h(function)h(that)f -(eliminates)i(all)f(blanks)g(of)f(a)f(string.)-12 2463 y Fl(function)23 -b(remove_blanks)f(\(s\))36 2520 y(local)h(b)h(=)g(strfind\(s,)e(')i('\))36 -2576 y(while)f(b)h(do)84 2632 y(s)f(=)h(strsub\(s,)f(1,)g(b-1\))h(..)f -(strsub\(s,)g(b+1\))84 2689 y(b)g(=)h(strfind\(s,)f(')g('\))36 -2745 y(end)36 2802 y(return)g(s)-12 2858 y(end)899 2976 y Fn(19)p -eop -%%Page: 20 20 -bop -12 160 a Fd(7.3)56 b(P)n(ersistence)-12 245 y Fn(Because)19 -b(of)f(its)h(re\015exiv)o(e)g(facilities,)i(p)q(ersistence)e(in)g(Lua)g(can)g -(b)q(e)f(ac)o(hiev)o(ed)i(with)e(Lua.)30 b(This)19 b(section)-12 -302 y(sho)o(ws)c(some)h(w)o(a)o(ys)e(to)i(store)f(and)h(retriev)o(e)f(v)m -(alues)i(in)g(Lua,)f(using)g(a)g(text)f(\014le)i(written)f(in)g(the)g -(language)-12 358 y(itself)g(as)f(the)g(storage)f(media.)59 -415 y(T)l(o)h(store)f(a)h(single)i(v)m(alue)f(with)g(a)e(name,)h(the)h(follo) -o(wing)f(co)q(de)h(is)g(enough:)-12 509 y Fl(function)23 b(store)g(\(name,)g -(value\))36 565 y(write\('\\n')f(..)i(name)f(..)h('='\))36 -622 y(write_value\(value\))-12 678 y(end)-12 784 y(function)f(write_value)f -(\(value\))36 841 y(local)h(t)h(=)g(type\(value\))131 897 y(if)g(t)g(==)f -('nil')95 b(then)23 b(write\('nil'\))36 954 y(elseif)g(t)h(==)f('number')g -(then)g(write\(value\))36 1010 y(elseif)g(t)h(==)f('string')g(then)g -(write\('"')g(..)h(value)f(..)g('"'\))36 1067 y(end)-12 1123 -y(end)-12 1229 y Fn(In)16 b(order)f(to)g(restore)f(this)i(v)m(alue,)g(a)f -Fl(lua_dofile)e Fn(su\016ces.)59 1286 y(Storing)k(tables)g(is)g(a)g(little)h -(more)f(complex.)25 b(Assuming)18 b(that)e(the)h(table)h(is)f(a)g(tree,)f -(and)h(all)h(indices)-12 1342 y(are)e(iden)o(ti\014ers)i(\(that)d(is,)h(the)h -(tables)f(are)g(b)q(eing)i(used)e(as)g(records\),)g(its)g(v)m(alue)i(can)e(b) -q(e)h(written)f(directly)-12 1399 y(with)g(table)f(constructors.)k(First,)c -(the)g(function)h Fl(write_value)e Fn(is)i(c)o(hanged)f(to)-12 -1492 y Fl(function)23 b(write_value)f(\(value\))36 1549 y(local)h(t)h(=)g -(type\(value\))131 1605 y(if)g(t)g(==)f('nil')95 b(then)23 -b(write\('nil'\))36 1662 y(elseif)g(t)h(==)f('number')g(then)g -(write\(value\))36 1718 y(elseif)g(t)h(==)f('string')g(then)g(write\('"')g -(..)h(value)f(..)g('"'\))36 1775 y(elseif)g(t)h(==)f('table')47 -b(then)23 b(write_record\(value\))36 1831 y(end)-12 1888 y(end)-12 -1981 y Fn(The)16 b(function)g Fl(write_record)d Fn(is:)-12 -2075 y Fl(function)23 b(write_record\(t\))36 2132 y(local)g(i,)h(v)f(=)h -(next\(t,)f(nil\))36 2188 y(write\('{'\))46 b(--)24 b(starts)f(constructor)36 -2245 y(while)g(i)h(do)84 2301 y(store\(i,)e(v\))84 2358 y(write\(',)g('\))84 -2414 y(i,)h(v)h(=)g(next\(t,)f(i\))36 2470 y(end)36 2527 y(write\('}'\))46 -b(--)24 b(closes)f(constructor)-12 2583 y(end)-12 2705 y Fd(7.4)56 -b(Inheritance)-12 2791 y Fn(The)18 b(fallbac)o(k)h(for)f(absen)o(t)f(indices) -j(can)f(b)q(e)f(used)h(to)e(implemen)o(t)j(man)o(y)d(kinds)i(of)f -(inheritance)h(in)g(Lua.)-12 2847 y(As)c(an)g(example,)h(the)f(follo)o(wing)h -(co)q(de)g(implemen)o(ts)h(single)f(inheritance:)899 2976 y(20)p -eop -%%Page: 21 21 -bop -12 160 a Fl(function)23 b(Index)g(\(t,f\))36 216 y(if)h(f)f(==)h -('parent')f(then)47 b(--)23 b(to)h(avoid)f(loop)84 273 y(return)g -(OldIndex\(t,f\))36 329 y(end)36 385 y(local)g(p)h(=)g(t.parent)36 -442 y(if)g(type\(p\))e(==)i('table')f(then)84 498 y(return)g(p[f])36 -555 y(else)84 611 y(return)g(OldIndex\(t,f\))36 668 y(end)-12 -724 y(end)-12 837 y(OldIndex)g(=)h(setfallback\("index",)d(Index\))-12 -931 y Fn(Whenev)o(er)13 b(Lua)f(attempts)g(to)f(access)i(an)f(absen)o(t)g -(\014eld)i(in)f(a)f(table,)h(it)f(calls)i(the)e(fallbac)o(k)h(function)g -Fl(Index)p Fn(.)-12 987 y(If)h(the)g(table)g(has)g(a)f(\014eld)i -Fl(parent)e Fn(with)h(a)g(table)g(v)m(alue,)h(then)f(Lua)g(attempts)f(to)g -(access)h(the)g(desired)h(\014eld)-12 1044 y(in)g(this)g(paren)o(t)f(ob)s -(ject.)19 b(This)c(pro)q(cess)f(is)h(rep)q(eated)g(\\up)o(w)o(ards")e(un)o -(til)i(a)f(v)m(alue)i(for)e(the)g(\014eld)h(is)g(found)g(or)-12 -1100 y(the)i(ob)s(ject)g(has)g(no)g(paren)o(t.)24 b(In)18 b(the)f(latter)g -(case,)g(the)g(previous)h(fallbac)o(k)g(is)f(called)i(to)d(supply)i(a)f(v)m -(alue)-12 1157 y(for)e(the)g(\014eld.)59 1213 y(When)h(b)q(etter)h(p)q -(erformance)f(is)h(needed,)g(the)g(same)f(fallbac)o(k)h(ma)o(y)e(b)q(e)i -(implemen)o(ted)h(in)f(C,)f(as)g(ilus-)-12 1270 y(trated)f(in)h(Figure)f(1.) -20 b(This)15 b(co)q(de)h(m)o(ust)f(b)q(e)h(registered)f(with:)36 -1363 y Fl(lua_pushliteral\("parent"\))o(;)36 1420 y(lockedParentName)22 -b(=)h(lua_lock\(\);)36 1476 y(lua_pushobject\(lua_setfal)o(lback\("i)o -(ndex",)d(Index\)\);)36 1533 y(lockedOldIndex)i(=)i(lua_lock\(\);)-12 -1627 y Fn(Notice)16 b(that)e(the)i(string)f Fl("parent")f Fn(is)i(k)o(ept)f -(lo)q(c)o(k)o(ed)g(in)h(Lua)g(for)f(optimal)g(p)q(erformace.)-12 -1748 y Fd(7.5)56 b(A)19 b(CF)-5 b(unction)-12 1834 y Fn(A)12 -b(CF)l(unction)h(to)e(compute)i(the)f(maxim)o(um)g(of)f(a)h(v)m(ariable)h(n)o -(um)o(b)q(er)g(of)e(argumen)o(ts)h(is)g(sho)o(wn)g(in)h(Figure)f(2.)-12 -1891 y(After)j(registered)h(with)-12 1984 y Fl(lua_register)22 -b(\("max",)h(math_max\);)-12 2078 y Fn(this)16 b(function)g(is)g(a)o(v)m -(ailable)g(in)g(Lua,)g(as)e(follo)o(ws:)-12 2172 y Fl(i)24 -b(=)g(max\(4,)f(5,)g(10,)h(-34\))47 b(--)23 b(i)h(receives)f(10)-12 -2294 y Fd(7.6)56 b(Calling)18 b(Lua)h(F)-5 b(unctions)-12 2380 -y Fn(This)15 b(example)g(illustrates)g(ho)o(w)f(a)g(C)g(function)h(can)f -(call)i(the)e(Lua)g(function)h Fl(remove_blanks)e Fn(presen)o(ted)-12 -2436 y(in)j(Section)g(7.2.)-12 2530 y Fl(void)24 b(remove_blanks)e(\(char)h -(*s\))-12 2586 y({)36 2643 y(lua_pushstring\(s\);)45 b(/*)24 -b(prepare)f(parameter)f(*/)36 2699 y(lua_call\("remove_blanks"\))o(;)45 -b(/*)24 b(call)f(Lua)g(function)g(*/)36 2756 y(strcpy\(s,)g -(lua_getstring\(lua_getre)o(sult\(1\))o(\)\);)45 b(/*)23 b(copy)h(result)f -(back)g(to)h('s')f(*/)-12 2812 y(})899 2976 y Fn(21)p eop -%%Page: 22 22 -bop -12 417 1867 6 v -12 511 a Fl(int)24 b(lockedParentName;)45 -b(/*)24 b(stores)f(the)g(lock)g(index)h(for)f(the)h(string)f("parent")f(*/) --12 567 y(int)i(lockedOldIndex;)93 b(/*)24 b(previous)e(fallback)h(function)g -(*/)-12 680 y(void)h(callOldFallback)d(\(lua_Object)i(table,)g(lua_Object)f -(index\))-12 736 y({)36 793 y(lua_Object)g(oldIndex)h(=)h -(lua_getlocked\(lockedOldIn)o(dex\);)36 849 y(lua_pushobject\(table\);)36 -906 y(lua_pushobject\(index\);)36 962 y(lua_callfunction\(oldIndex)o(\);)-12 -1019 y(})-12 1132 y(void)g(Index)f(\(void\))-12 1188 y({)36 -1245 y(lua_Object)f(table)i(=)f(lua_getparam\(1\);)36 1301 -y(lua_Object)f(index)i(=)f(lua_getparam\(2\);)36 1357 y(lua_Object)f(parent;) -36 1414 y(if)i(\(lua_isstring\(index\))d(&&)i -(strcmp\(lua_getstring\(index\),)d("parent"\))j(==)g(0\))36 -1470 y({)84 1527 y(callOldFallback\(table,)d(index\);)84 1583 -y(return;)36 1640 y(})36 1696 y(lua_pushobject\(table\);)36 -1753 y(lua_pushlocked\(lockedPare)o(ntName\);)36 1809 y(parent)j(=)h -(lua_getsubscript\(\);)36 1866 y(if)g(\(lua_istable\(parent\)\))36 -1922 y({)84 1978 y(lua_pushobject\(parent\);)84 2035 y -(lua_pushobject\(index\);)84 2091 y(/*)f(return)g(result)g(from)h -(getsubscript)e(*/)84 2148 y(lua_pushobject\(lua_gets)o(ubscript)o(\(\)\);)36 -2204 y(})36 2261 y(else)84 2317 y(callOldFallback\(table,)e(index\);)-12 -2374 y(})653 2509 y Fn(Figure)c(1:)j(Inheritance)e(in)f(C.)p --12 2565 V 899 2976 a(22)p eop -%%Page: 23 23 -bop -12 727 1867 6 v -12 821 a Fl(void)24 b(math_max)e(\(void\))-12 -878 y({)12 934 y(int)i(i=1;)71 b(/*)23 b(number)g(of)h(arguments)e(*/)12 -991 y(double)h(d,)h(dmax;)12 1047 y(lua_Object)f(o;)12 1103 -y(/*)h(the)f(function)g(must)g(get)h(at)f(least)g(one)h(argument)f(*/)12 -1160 y(if)h(\(\(o)f(=)h(lua_getparam\(i++\)\))d(==)j(LUA_NOOBJECT\))60 -1216 y(lua_error)e(\("too)i(few)f(arguments)g(to)g(function)g(`max'"\);)12 -1273 y(/*)h(and)f(this)g(argument)g(must)g(be)h(a)g(number)f(*/)12 -1329 y(if)h(\(!lua_isnumber\(o\)\))60 1386 y(lua_error)e(\("incorrect)h -(argument)g(to)g(function)g(`max'"\);)12 1442 y(dmax)g(=)h(lua_getnumber)e -(\(o\);)12 1499 y(/*)i(loops)f(until)g(there)g(is)h(no)f(more)h(arguments)e -(*/)12 1555 y(while)h(\(\(o)h(=)f(lua_getparam\(i++\)\))f(!=)h -(LUA_NOOBJECT\))12 1612 y({)36 1668 y(if)h(\(!lua_isnumber\(o\)\))84 -1724 y(lua_error)e(\("incorrect)h(argument)f(to)i(function)f(`max'"\);)36 -1781 y(d)h(=)f(lua_getnumber)f(\(o\);)36 1837 y(if)i(\(d)f(>)h(dmax\))f(dmax) -g(=)h(d;)12 1894 y(})12 1950 y(/*)g(push)f(the)g(result)g(to)h(be)g(returned) -e(*/)12 2007 y(lua_pushnumber)g(\(dmax\);)-12 2063 y(})610 -2198 y Fn(Figure)16 b(2:)j(C)c(function)h Fl(math)p 1134 2198 -15 2 v 17 w(max)p Fn(.)p -12 2255 1867 6 v 899 2976 a(23)p -eop -%%Page: 24 24 -bop -12 160 a Fo(Ac)n(kno)n(wledgme)o(n)n(ts)-12 261 y Fn(The)17 -b(authors)f(w)o(ould)i(lik)o(e)g(to)e(thank)h(CENPES/PETR)o(OBR)1099 -250 y(\023)1093 261 y(AS)g(whic)o(h,)h(join)o(tly)f(with)h(T)l(eCGraf,)e -(used)-12 318 y(extensiv)o(ely)g(early)f(v)o(ersions)f(of)g(this)h(system)f -(and)h(ga)o(v)o(e)f(v)m(aluable)i(commen)o(ts.)j(The)c(authors)e(w)o(ould)i -(also)-12 374 y(lik)o(e)i(to)d(thank)h(Carlos)g(Henrique)h(Levy)l(,)g(who)f -(found)h(the)f(name)g(of)g(the)g(game)1371 358 y Fj(3)1390 -374 y Fn(.)-12 517 y Fo(A)69 b(Incompatibi)o(l)o(i)o(ti)o(es)20 -b(with)h(Previous)i(V)-6 b(ersions)-12 619 y Fn(Although)13 -b(great)f(care)g(has)h(b)q(een)g(tak)o(en)f(to)g(a)o(v)o(oid)h -(incompatibilities)j(with)d(the)f(previous)h(public)i(v)o(ersions)-12 -675 y(of)g(Lua,)g(some)g(di\013erences)h(had)g(to)e(b)q(e)i(in)o(tro)q -(duced.)21 b(Here)16 b(is)f(a)g(list)h(of)f(all)h(these)g(di\013erences.)-12 -797 y Fd(Incompatibilitie)o(s)g(in)i(the)h(Language)56 883 -y Fi(\017)k Fn(The)15 b(equalit)o(y)h(test)f(op)q(erator)f(no)o(w)h(is)h -(denoted)f(b)o(y)g Fl(==)p Fn(,)g(instead)h(of)f Fl(=)p Fn(.)56 -976 y Fi(\017)23 b Fn(The)14 b(syn)o(tax)f(for)g(table)h(construction)g(has)f -(b)q(een)i(greatly)f(simpli\014ed.)22 b(The)14 b(old)g Fl(@\(size\))f -Fn(has)g(b)q(een)102 1033 y(substituted)20 b(b)o(y)f Fl({})p -Fn(.)32 b(The)20 b(list)g(constructor)f(\(formerly)g Fl(@[...])p -Fn(\))f(and)h(the)h(record)f(constructor)102 1089 y(\(formerly)g -Fl(@{...})p Fn(\))g(no)o(w)h(are)g(b)q(oth)g(co)q(ded)h(lik)o(e)g -Fl({...})p Fn(.)34 b(When)20 b(the)h(construction)f(in)o(v)o(olv)o(es)h(a)102 -1146 y(function)15 b(call,)h(lik)o(e)g(in)f Fl(@func{...})p -Fn(,)e(the)i(new)g(syn)o(tax)f(do)q(es)h(not)g(use)g(the)f -Fl(@)p Fn(.)20 b(More)14 b(imp)q(ortan)o(t,)g Fm(a)102 1202 -y(c)n(onstruction)h(function)h(must)h(now)f(explicitly)g(r)n(eturn)g(the)h(c) -n(onstructe)n(d)e(table)p Fn(.)-12 1324 y Fd(Incompatibilitie)o(s)h(in)i(the) -h(API)56 1410 y Fi(\017)k Fn(The)15 b(function)h Fl(lua_call)e -Fn(no)h(longer)h(has)f(the)g(parameter)g Fl(nparam)p Fn(.)56 -1504 y Fi(\017)23 b Fn(The)16 b(function)i Fl(lua_pop)d Fn(is)i(no)f(longer)h -(a)o(v)m(ailable,)h(since)g(it)e(could)i(lead)f(to)f(strange)g(b)q(eha)o -(vior.)24 b(In)102 1560 y(particular,)13 b(to)e(access)i(results)f(returned)h -(from)e(a)h(Lua)h(function,)g(the)f(new)h(macro)e Fl(lua_getresult)102 -1617 y Fn(should)16 b(b)q(e)g(used.)56 1710 y Fi(\017)23 b -Fn(The)15 b(old)h(functions)g Fl(lua_storefield)d Fn(and)j -Fl(lua_storeindexed)d Fn(ha)o(v)o(e)h(b)q(een)j(replaced)f(b)o(y)102 -1823 y Fl(int)23 b(lua_storesubscript)f(\(void\);)102 1935 -y Fn(with)15 b(the)h(parameters)e(explicitly)k(pushed)e(on)f(the)h(stac)o(k.) -56 2029 y Fi(\017)23 b Fn(The)16 b(functionalit)o(y)h(of)f(the)g(function)g -Fl(lua_errorfunction)e Fn(has)i(b)q(een)h(replaced)g(b)o(y)f(the)g -Fm(fal)r(lb)n(ack)102 2086 y Fn(mec)o(hanism;)f(see)h(Section)g(4.8.)56 -2179 y Fi(\017)23 b Fn(When)14 b(calling)i(a)d(function)i(from)e(the)h(Lua)g -(library)l(,)g(parameters)f(passed)h(through)g(the)g(stac)o(k)f(m)o(ust)102 -2236 y(b)q(e)j(pushed)h(just)e(b)q(efore)h(the)f(corresp)q(onden)o(t)h(call,) -h(with)f(no)f(in)o(termediate)h(calls)h(to)e(Lua.)21 b(Sp)q(ecial)102 -2292 y(care)15 b(should)h(b)q(e)g(tak)o(en)f(with)g(macros)g(lik)o(e)h -Fl(lua_getindexed)d Fn(and)j Fl(lua_getfield)p Fn(.)p -12 2815 -747 2 v 40 2842 a Fh(3)57 2858 y Fg(BTW,)d(Lua)g(means)h Fe(mo)n(on)e -Fg(in)i(P)o(ortuguese.)899 2976 y Fn(24)p eop -%%Trailer -end -userdict /end-hook known{end-hook}if -%%EOF +%!PS-Adobe-2.0 +%%Creator: dvips 5.58 Copyright 1986, 1994 Radical Eye Software +%%Title: manual.dvi +%%CreationDate: Tue Nov 28 10:59:43 1995 +%%Pages: 27 +%%PageOrder: Ascend +%%BoundingBox: 0 0 612 792 +%%EndComments +%DVIPSCommandLine: /software/tex/bin/_dvips -o manual.ps manual.dvi +%DVIPSParameters: dpi=300, comments removed +%DVIPSSource: TeX output 1995.11.28:1056 +%%BeginProcSet: tex.pro +/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/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{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} +if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict +/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for +65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 +0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V +{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 +getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} +ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /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{ +4 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{ +p 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 +a}B /bos{/SS save N}B /eos{SS restore}B end +%%EndProcSet +TeXDict begin 40258431 52099146 1000 300 300 +(/home/lhf/w/doc/lua/html/save/manual.dvi) @start /Fa +7 121 df<07F8001FFE003FFF803E07C03E03C01C01E00001E0003FE003FFE00FFFE03F +C1E07C01E07801E0F001E0F001E0F001E07803E07C07E03FFFFE1FFEFE03F87E17157E94 +1A>97 D<01F80007FF000FFF801F07C03C03C07801E07801E0F000F0F000F0FFFFF0FFFF +F0FFFFF0F000007000007800007C00F03E00F01F03F00FFFE003FFC000FE0014157D941A +>101 D<7F0F8000FF7FE0007FFFF0000FF0F0000FC078000F8078000F0078000F007800 +0F0078000F0078000F0078000F0078000F0078000F0078000F0078000F0078000F007800 +0F0078007FE1FF00FFF3FF807FE1FF00191580941A>110 D<7FC1F8FFC7FC7FDFFE03FE +1E03F80C03F00003E00003E00003C00003C00003C00003C00003C00003C00003C00003C0 +0003C00003C0007FFF80FFFF807FFF8017157F941A>114 D<01C00003C00003C00003C0 +0003C00003C00003C0007FFFE0FFFFE0FFFFE003C00003C00003C00003C00003C00003C0 +0003C00003C00003C00003C00003C0F003C0F003C0F003C0F001E1E001FFE000FF80003F +00141C7F9B1A>116 D<7FC7FCFFC7FE7FC7FC0F01E00F01E00F01E00F83E00783C00783 +C00783C003C78003C78003C78001C70001EF0001EF0001EF0000FE0000FE0000FE00007C +0017157F941A>118 D<7FC7F87FCFFC7FC7F80787C007C78003EF8001FF0000FE0000FC +00007C00007C00007C0000FE0001EF0003EF0003C7800783C00F83E07FC7FCFFC7FE7FC7 +FC17157F941A>120 D E /Fb 1 122 df<1C0C2E1C4E1C8E389C381C381C383870387038 +70387018E00FE000E000C0E1C0E38047003C000E137F8C11>121 +D E /Fc 2 121 df<70F8F8F87005057C840D>58 D<07C3C00FE7E0187C603078F06079 +F06079F0C0F1E000F1C000F00000F00001E00001E00039E00079E030FBC060FBC060F3C0 +C0E7E3807CFF00383C0014147E931A>120 D E /Fd 47 121 df<0007F800007FFE0001 +FC0F0003F01F0007E03F800FC03F800FC03F800FC03F800FC01F000FC004000FC000000F +C000000FC00000FFFFFF80FFFFFF80FFFFFF800FC01F800FC01F800FC01F800FC01F800F +C01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F800F +C01F800FC01F800FC01F807FF8FFF07FF8FFF07FF8FFF01C237FA21F>12 +D<3C7EFFFFFFFF7E3C08087C8710>46 D<0000180000380000380000700000700000E000 +00E00000E00001C00001C0000380000380000380000700000700000700000E00000E0000 +1C00001C00001C0000380000380000700000700000700000E00000E00001C00001C00001 +C0000380000380000700000700000700000E00000E00000E00001C00001C000038000038 +0000380000700000700000E00000E00000C0000015317DA41C>I<00180000780003F800 +FFF800FFF800FDF80001F80001F80001F80001F80001F80001F80001F80001F80001F800 +01F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F800 +01F80001F8007FFFE07FFFE07FFFE013207C9F1C>49 D<03FC000FFF003FFFC0783FE07C +0FF0FE07F0FE03F8FE03F8FE03F87C03F83803F80003F80003F00007F00007E0000FC000 +1F80001F00003C0000780000F00001E03803C0380700380600380C00781FFFF03FFFF07F +FFF0FFFFF0FFFFF0FFFFF015207D9F1C>I<01FE0007FF800FFFE01E07F03F03F03F03F8 +3F83F83F03F81F03F80C03F80003F00007E00007C0001F8001FE0001FF000007E00003F0 +0001F80001FC0001FE0001FE7C01FE7C01FEFE01FEFE01FCFE01FC7C03F87C07F03FFFE0 +0FFFC003FE0017207E9F1C>I<0000E00001E00003E00007E0000FE0000FE0001FE0003F +E00077E000E7E000E7E001C7E00387E00707E00E07E00E07E01C07E03807E07007E0E007 +E0FFFFFFFFFFFFFFFFFF0007E00007E00007E00007E00007E00007E000FFFF00FFFF00FF +FF18207E9F1C>I<2000603C01E03FFFC03FFFC03FFF803FFE003FFC003FF00038000038 +000038000038000039FC003FFF003E0FC03807E03003F00003F00003F00003F80003F838 +03F87C03F8FC03F8FC03F8FC03F0F803F07007E03C0FC03FFF800FFF0003F80015207D9F +1C>I<001F8000FFE003FFF007F0F00FC1F81F81F83F01F83F01F87E00F07E00007E0000 +FE0800FE7FC0FEFFE0FF81F0FF00F8FF00FCFF00FCFE00FEFE00FEFE00FEFE00FE7E00FE +7E00FE7E00FE3E00FC3E00FC1F00F80F83F007FFE003FFC000FF0017207E9F1C>I<7000 +007C00007FFFFE7FFFFE7FFFFE7FFFFC7FFFF87FFFF0F00070E000E0E001C0E00380E007 +00000E00000E00001C00003C0000380000780000780000F80000F00001F00001F00001F0 +0001F00003F00003F00003F00003F00003F00003F00003F00001E00017227DA11C>I<00 +FE0003FFC007FFE00F83F01E01F01E00F83E00F83E00F83F00F83F80F83FE1F01FF9E01F +FFC00FFF8007FFC003FFE00FFFF01F7FF83E1FFC7C07FC7C01FEF800FEF8007EF8003EF8 +003EF8003E7C003C7E00783F01F81FFFF00FFFC001FF0017207E9F1C>I<000070000000 +00F800000000F800000000F800000001FC00000001FC00000003FE00000003FE00000003 +FE000000077F000000077F0000000F7F8000000E3F8000000E3F8000001C1FC000001C1F +C000003C1FE00000380FE00000380FE00000700FF000007007F00000F007F80000FFFFF8 +0000FFFFF80001FFFFFC0001C001FC0001C001FC00038000FE00038000FE00078000FF00 +0700007F00FFF007FFF8FFF007FFF8FFF007FFF825227EA12A>65 +D<0003FE0180001FFF838000FFFFE78001FF00FF8003F8003F8007F0001F800FE0000F80 +1FC0000F803F800007803F800007807F800003807F000003807F00000380FF00000000FF +00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF000000007F00 +0000007F000003807F800003803F800003803F800007801FC00007000FE0000F0007F000 +1E0003F8003C0001FF00F80000FFFFF000001FFFC0000003FE000021227DA128>67 +DIII72 +DI +76 DI<0007 +FC0000003FFF800000FE0FE00003F803F80007E000FC000FC0007E001FC0007F001F8000 +3F003F80003F803F80003F807F00001FC07F00001FC07F00001FC0FF00001FE0FF00001F +E0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0FF00001FE0 +7F00001FC07F80003FC07F80003FC03F80003F803FC0007F801FC0007F000FE000FE0007 +F001FC0003F803F80000FE0FE000003FFF80000007FC000023227DA12A>79 +DI< +01FE0607FF8E1FFFFE3F01FE7C007E78003E78001EF8001EF8000EF8000EFC0000FF0000 +FFE0007FFF007FFFC03FFFF01FFFF80FFFFC03FFFE003FFE0003FE00007F00003F00001F +E0001FE0001FE0001FF0001EF0003EFC003CFF00FCFFFFF8E7FFE0C0FF8018227DA11F> +83 D<7FFFFFFF807FFFFFFF807FFFFFFF807E03F81F807C03F807807803F807807003F8 +0380F003F803C0F003F803C0E003F801C0E003F801C0E003F801C0E003F801C00003F800 +000003F800000003F800000003F800000003F800000003F800000003F800000003F80000 +0003F800000003F800000003F800000003F800000003F800000003F800000003F8000000 +03F800000003F800000003F8000001FFFFF00001FFFFF00001FFFFF00022227EA127>I< +FFFF001FFEFFFF001FFEFFFF001FFE07F00001C007F80003C003F800038003FC00078001 +FC00070001FC00070000FE000E0000FE000E0000FF001E00007F001C00007F803C00003F +803800003F803800001FC07000001FC07000001FE0F000000FE0E000000FF0E0000007F1 +C0000007F1C0000007FBC0000003FB80000003FF80000001FF00000001FF00000000FE00 +000000FE00000000FE000000007C000000007C0000000038000027227FA12A>86 +D<0FFE003FFF807E07E07E03F07E01F07E01F83C01F80001F80001F800FFF807FFF81FE1 +F83F01F87E01F8FC01F8FC01F8FC01F8FC01F87E03F87E0EFF1FFCFF07F03F18167E951B +>97 DI<00FF8007FFE00F83F01F03F03E03F07E03F07C01E07C0000FC0000FC0000 +FC0000FC0000FC0000FC00007C00007E00007E00003E00381F00700FC0F007FFC000FF00 +15167E9519>I<0001FF000001FF000001FF0000003F0000003F0000003F0000003F0000 +003F0000003F0000003F0000003F0000003F0000003F0001FE3F0007FFBF000F81FF001F +007F003E003F007E003F007C003F00FC003F00FC003F00FC003F00FC003F00FC003F00FC +003F00FC003F00FC003F007C003F007C003F003E003F001F00FF000F83FFE007FFBFE001 +FC3FE01B237EA21F>I<00FE0007FF800F87C01E01E03E01F07C00F07C00F8FC00F8FC00 +F8FFFFF8FFFFF8FC0000FC0000FC00007C00007C00007E00003E00381F00700FC0F003FF +C000FF0015167E951A>I<01FE1F0007FFFF800F87E7801F03E7801E01E7003E01F0003E +01F0003E01F0003E01F0003E01F0001E01E0001F03E0000F87C0000FFF800019FE000018 +0000001C0000001C0000001FFFE0001FFFF8000FFFFE000FFFFF003FFFFF007C003F80F8 +001F80F8000F80F8000F80F8000F807C001F007E003F001F80FC000FFFF80001FFC00019 +217F951C>103 DI<1E003F007F807F807F807F803F001E00000000000000000000 +000000FF80FF80FF801F801F801F801F801F801F801F801F801F801F801F801F801F801F +801F801F80FFF0FFF0FFF00C247FA30F>I<003C007E00FF00FF00FF00FF007E003C0000 +0000000000000000000003FF03FF03FF003F003F003F003F003F003F003F003F003F003F +003F003F003F003F003F003F003F003F003F003F003F003F783FFC3FFC3EFC7E78FC7FF0 +1FC0102E83A311>IIIII<00 +FE0007FFC00F83E01E00F03E00F87C007C7C007C7C007CFC007EFC007EFC007EFC007EFC +007EFC007EFC007E7C007C7C007C3E00F81F01F00F83E007FFC000FE0017167E951C>I< +FF8FE000FFFFF800FFF07C001FC03E001F801F001F801F801F801F801F800FC01F800FC0 +1F800FC01F800FC01F800FC01F800FC01F800FC01F800FC01F801F801F801F801F803F00 +1FC03E001FE0FC001FFFF8001F8FC0001F8000001F8000001F8000001F8000001F800000 +1F8000001F800000FFF00000FFF00000FFF000001A207E951F>I114 +D<07F3001FFF00781F00700F00F00700F00700F80000FF0000FFF0007FFC003FFE001FFF +0007FF00003F80E00F80E00780F00780F00780F80700FC1E00FFFC00C7F00011167E9516 +>I<01C00001C00001C00001C00003C00003C00003C00007C00007C0000FC0003FFF00FF +FF00FFFF000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000F +C3800FC3800FC3800FC3800FC3800FC30007E70003FE0000FC0011207F9F16>IIIII E /Fe 4 112 df<03CC0E2E183C381C301C701CE038E038E038E038C073C073C0F3 +60F263361E1C10107C8F14>97 D<383E1F006CC331804F83C1C0CF03C1C0CE0381C0CE03 +81C01C0703801C0703801C0703801C070700380E0730380E0730380E0E30380E0E60701C +0640300C03801C107D8F1F>109 D<383E006CC3004F8380CF0380CE0380CE03801C0700 +1C07001C07001C0E00380E60380E60381C60381CC0700C8030070013107D8F16>I<01F0 +06180C0C180E300E700E600EE00EE00EE00CE01CE018E030606030C01F000F107C8F14> +I E /Ff 2 104 df<003C00E001C0038003800380038003800380038003800380038003 +800380038007001E00F8001E000700038003800380038003800380038003800380038003 +800380038001C000E0003C0E257E9B13>102 DI +E /Fg 35 122 df<00FC000383000603800E07801C07801C03001C00001C00001C00001C +0000FFFF80FFFF801C03801C03801C03801C03801C03801C03801C03801C03801C03801C +03801C03801C0380FF8FF0FF8FF0141A809915>12 D<70F8FCFC7404040808102040060C +7D990B>39 D<70F0F8F87808081010102040050C7D840B>44 D<70F8F8F87005057D840B +>46 D<07E01C38381C381C700E700E700EF00FF00FF00FF00FF00FF00FF00FF00FF00FF0 +0F700E700E700E381C381C1C3807E010187F9713>48 D<07E01FF8383C781C781E781E30 +1E001E001C0038007007E00038001C000E000F000F700FF80FF80EF01E703C3FF80FE010 +187F9713>51 D<70F8F8F87000000000000070F0F8F8780808101010204005177D8F0B> +59 D<000C0000001E0000001E0000001E0000003F0000003F0000003F00000067800000 +6780000067800000C3C00000C3C00000C3C0000181E0000181E0000181E0000300F00003 +FFF00007FFF80006007800060078000E007C000C003C001E003C00FF81FFC0FF81FFC01A +1A7F991D>65 DI76 +D80 D<07C21FF6383E701E600EE006E006E006F000F8007F +803FF01FF80FFC01FE001E000F0007C007C007C007E006F00EFC1CDFF887E0101A7E9915 +>83 D<7FFFFF007FFFFF00781E0F00601E0300601E0300E01E0380C01E0180C01E0180C0 +1E0180001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E000000 +1E0000001E0000001E0000001E0000001E0000001E0000001E000003FFF00003FFF00019 +1A7F991C>I87 +D91 D93 D<1FC000707000783800781C00301C00001C +0003FC001F1C003C1C00781C00F01C00F01D80F01D80F03D80785D801F8F0011107F8F13 +>97 DI<07F01C1C383C783C7018F000F000F000F000F000 +F0007000780C380C1C3807E00E107F8F11>I<003F00003F000007000007000007000007 +0000070000070000070000070003E7000C1F00180F00380700700700F00700F00700F007 +00F00700F00700F00700700700780700380F001C3FE007E7E0131A7F9915>I<07C01C70 +38387038701CF01CFFFCF000F000F000F0007000780C38081C3807E00E107F8F11>I<01 +F007180E3C0C3C1C181C001C001C001C001C00FFC0FFC01C001C001C001C001C001C001C +001C001C001C001C001C00FF80FF800E1A80990C>I<0FC700387B80703B80F03C00F03C +00F03C00F03C007038003870006FC0004000004000006000007FF0003FFC003FFE00600F +00C00300C00300C00300C00300600600381C0007E00011187F8F13>I<387C7C7C380000 +000000FCFC1C1C1C1C1C1C1C1C1C1C1C1CFFFF081A80990A>105 +D108 DII<07E01C38381C700E700EF00FF00FF00FF00FF00FF00F700E700E381C +1C3807E010107F8F13>II114 D<1F2060E04060C060C060F0007F003FC0 +1FE000F0C070C030E030E020F0408F800C107F8F0F>I<18001800180018001800180038 +007FC0FFC03800380038003800380038003800386038603860386038601CC007800B177F +960F>III121 D E /Fh 4 52 df<00C00000C00000C00000C00000C00000C0 +0000C00000C00000C000FFFF80FFFF8000C00000C00000C00000C00000C00000C00000C0 +0000C00000C00011147E8F17>43 D<0C007C009C001C001C001C001C001C001C001C001C +001C001C001C001C00FF8009107E8F0F>49 D<1F006180C0C0E0E0E0E000E000C001C001 +8003000400082010203FC07FC0FFC00B107F8F0F>I<1F00218071C071C021C001800300 +1F00018000C000E040E0E0E0E0C041803F000B107F8F0F>I E /Fi +5 107 df<03F0000FFC001FFE003FFF007FFF807FFF80FFFFC0FFFFC0FFFFC0FFFFC0FF +FFC0FFFFC07FFF807FFF803FFF001FFE000FFC0003F00012127E9317>15 +D<0000000600000000060000000006000000000300000000030000000003800000000180 +00000000C0000000006000000000700000000018FFFFFFFFFFFFFFFFFFFF000000001800 +00000070000000006000000000C000000001800000000380000000030000000003000000 +0006000000000600000000060028187E962D>33 D<001F007F00F801E003C003C003C003 +C003C003C003C003C003C003C003C003C003C003C003C007800F00FE00F800FE000F0007 +8003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C001E000F800 +7F001F102D7DA117>102 D +I106 D E /Fj 3 52 df<06001E00FE00EE000E00 +0E000E000E000E000E000E000E000E000E000E000E000E00FFE0FFE00B137D9211>49 +D<1F003FC041E0C0F0E070E07000F000E000E001C00380030004000810101020307FE0FF +E0FFE00C137E9211>I<1FC03FE07070707820380078007000E00FC000700038003C003C +403CE03CE03840707FE01FC00E137F9211>I E /Fk 46 121 df<3C03C07E07E0FF0FF0 +FF8FF8FF8FF8FF8FF87F87F83D83D80180180380380300300300300600600E00E01C01C0 +38038030030015117E9F1B>34 D<3C007E00FF00FF80FF80FF807F803D80018003800300 +030006000E001C003800300009117D9F0F>39 D<3C7EFFFFFFFF7E3C08087D870F>46 +D<00380000F80007F800FFF800FFF800F9F80001F80001F80001F80001F80001F80001F8 +0001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8 +0001F80001F8007FFFE07FFFE07FFFE0131D7D9C1A>49 D<03FC001FFF803FFFC07C1FE0 +FE07F0FE03F0FE03F8FE01F87C01F83801F80003F80003F00007E00007E0000FC0001F00 +003E00007C0000F00001E0380380380700380E00781FFFF83FFFF07FFFF0FFFFF0FFFFF0 +FFFFF0151D7E9C1A>I<03FC000FFF801FFFC03C0FE07E07F07E03F07E03F07E03F03C07 +F00007E0000FC0001F8003FE0003FC00000F800007E00003F00003F00003F83803F87C03 +F8FE03F8FE03F8FE03F0FC07F07C0FE03FFFC01FFF0003FC00151D7E9C1A>I<0001E000 +03E00003E00007E0000FE0001FE0003BE00073E000F3E001E3E001C3E00383E00703E00E +03E01C03E03803E07803E0F003E0FFFFFEFFFFFEFFFFFE0007E00007E00007E00007E000 +07E000FFFE00FFFE00FFFE171D7F9C1A>I<3800E03FFFE03FFFC03FFF803FFF003FFC00 +3FC00038000038000038000038000039FC003FFF803E07C03803E01003F00003F00003F8 +0003F87803F8FC03F8FC03F8FC03F8FC03F07807E07C0FE03FFFC00FFF0003F800151D7E +9C1A>I<003F0001FFC007FFE00FC1E01F03F01E03F03E03F07E03F07C01E07C0000FC10 +00FCFF00FDFFC0FF03E0FE01F0FE01F0FC01F8FC01F8FC01F8FC01F87C01F87C01F87C01 +F83C01F03E01F01F03E00FFFC007FF8001FC00151D7E9C1A>I<7000007FFFF87FFFF87F +FFF87FFFF07FFFE0FFFFC0F00380E00700E00E00E00E00001C0000380000780000700000 +F00000F00001F00001E00003E00003E00003E00007E00007E00007E00007E00007E00007 +E00003C000018000151E7D9D1A>I<01FE0007FF801FFFC03E07E03C03F07C01F07C01F0 +7E01F07F81F07FE3E03FF3C03FFF801FFF000FFF8007FFC01FFFE03E7FF07C1FF87807F8 +F803F8F801F8F800F8F800F8F800F07C01F07F03E03FFFC00FFF8003FC00151D7E9C1A> +I<0000E000000001F000000001F000000003F800000003F800000003F800000007FC0000 +0007FC0000000FFE0000000EFE0000000EFE0000001C7F0000001C7F0000003C7F800000 +383F800000383F800000701FC00000701FC00000F01FE00000E00FE00000FFFFE00001FF +FFF00001FFFFF00003C007F800038003F800038003F800070001FC00070001FC00FFF01F +FFE0FFF01FFFE0FFF01FFFE0231F7E9E28>65 DI<0007F806007FFF0E01FFFFDE03FE03FE07F000FE0FC0007E1F80003E3F +80001E3F00001E7F00000E7E00000E7E00000EFE000000FE000000FE000000FE000000FE +000000FE000000FE0000007E0000007E00000E7F00000E3F00000E3F80001C1F80001C0F +C0003807F0007803FE03F001FFFFC0007FFF800007FC001F1F7D9E26>IIII73 D76 D<001FF80000FFFF0001F81F8007E007E00FC003F01F8001F81F0000F83F0000FC7F +0000FE7E00007E7E00007EFE00007FFE00007FFE00007FFE00007FFE00007FFE00007FFE +00007FFE00007FFE00007F7E00007E7F0000FE7F0000FE3F0000FC3F8001FC1F8001F80F +C003F007E007E001F81F8000FFFF00001FF800201F7D9E27>79 DI82 +D<03FC180FFF381FFFF83E03F87C00F8780078F80078F80038F80038FC0000FF0000FFF8 +007FFF007FFFC03FFFE01FFFF00FFFF803FFF8001FFC0001FC0000FC00007CE0007CE000 +7CE0007CF00078F800F8FE01F0FFFFE0EFFFC0C1FF00161F7D9E1D>I<7FFFFFFC7FFFFF +FC7FFFFFFC7E0FE0FC780FE03C700FE01CF00FE01EF00FE01EE00FE00EE00FE00EE00FE0 +0EE00FE00E000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE0 +00000FE000000FE000000FE000000FE000000FE000000FE000000FE00007FFFFC007FFFF +C007FFFFC01F1E7E9D24>I<0600600E00E01C01C0380380300300600600600600E00E00 +C00C00DE0DE0FF0FF0FF8FF8FF8FF8FF8FF87F87F83F03F01E01E015117D9F1B>92 +D<07FC001FFF803F0FC03F07E03F03F03F03F00C03F00003F001FFF00FFFF01F83F07E03 +F07C03F0F803F0F803F0F803F0FC07F07E0DFE3FF8FE07E07E17147F9319>97 +DI<01FE0007FF801F0F +C03E0FC03E0FC07C0FC07C0300FC0000FC0000FC0000FC0000FC0000FC00007C00007E00 +003E00E03F01C01F83C007FF8001FC0013147E9317>I<0007FC000007FC000007FC0000 +00FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC0001 +FCFC000FFFFC001F83FC003E00FC007E00FC007C00FC007C00FC00FC00FC00FC00FC00FC +00FC00FC00FC00FC00FC00FC00FC007C00FC007C00FC007E00FC003E01FC001F07FF800F +FFFF8003F8FF8019207E9F1D>I<01FE0007FF800F83C01E01E03E00F07C00F07C00F8FC +00F8FFFFF8FFFFF8FC0000FC0000FC00007C00007C00003E00381E00380F80F007FFE000 +FF8015147F9318>I<003F8000FFC003F3E007E7E007C7E00FC7E00FC3C00FC0000FC000 +0FC0000FC0000FC000FFFC00FFFC00FFFC000FC0000FC0000FC0000FC0000FC0000FC000 +0FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0007FFC007FFC007FFC0013207F +9F10>I<03FC7C0FFFFE1E07DE3C03DE7C03EC7C03E07C03E07C03E07C03E03C03C01E07 +801FFF0033FC003000007000007800007FFF803FFFF03FFFF81FFFFC3FFFFC7C00FEF800 +3EF8003EF8003EF8003E7C007C3F01F80FFFE003FF80171E7F931A>II<1E003F007F807F807F807F803F001E00 +00000000000000000000FF80FF80FF801F801F801F801F801F801F801F801F801F801F80 +1F801F801F801F80FFF0FFF0FFF00C217EA00F>I107 DIII<01FF0007FFC01F83F03E00F83E00F87C007C7C007CFC007EFC +007EFC007EFC007EFC007EFC007E7C007C7C007C3E00F83E00F81F83F007FFC001FF0017 +147F931A>II114 D<0FE63FFE783E700EF00EF00EFE00FFE07FF8 +3FFC1FFE0FFF007FE01FE00FF00FF00EFC1EFFFCC7F010147E9315>I<03800380038003 +800780078007800F801F803FFCFFFCFFFC1F801F801F801F801F801F801F801F801F801F +8E1F8E1F8E1F8E1F8E0F9C07F803F00F1D7F9C14>I +I +119 DI E /Fl 84 127 df<70F8F8F8F8F8F8F8F8F8 +F8F8F8F8F8F8F870000000000070F8F8F870051C779B18>33 D<2008701CF83EF83EF83E +F83EF83EF83E701C701C701C701C701C30180F0E7C9C18>I<030600078F00078F00078F +00078F00078F00078F007FFFC0FFFFE0FFFFE07FFFC00F1E000F1E000F1E000F1E000F1E +000F1E007FFFC0FFFFE0FFFFE07FFFC01E3C001E3C001E3C001E3C001E3C001E3C000C18 +00131C7E9B18>I<00C00001C00001C00001C00003F0000FFC003FFE007DDF0071CF00E1 +C780E1CF80E1CF80E1CF80F1C70079C0007FC0003FF0001FFC0007FE0001FF0001CF0021 +C78071C380F9C380F9C380F1C380F1C70079C7007DDE003FFC001FF80007E00001C00001 +C00001C00000C00011247D9F18>I<3803007C07807C0780EE0F80EE0F00EE0F00EE1F00 +EE1E00EE1E00EE3E007C3C007C3C00387C0000780000780000F80000F00001F00001E000 +01E00003E00003C00003C00007C0000783800787C00F87C00F0EE00F0EE01F0EE01E0EE0 +1E0EE03E0EE03C07C03C07C018038013247E9F18>I<01C00007E0000FF0000E70001C38 +001C38001C38001C38001C73F81CF3F81CE3F80FC1C00FC3800F83800F03801F07003F87 +007B8E0071CE00F1FC00F0FC00F07C00F07870F0787078FE707FFFE03FC7E00F03C0151C +7F9B18>I<387C7C7E3E0E0E0E1C1C38F8F0C0070E789B18>I<007000F001E003C007800F +001E001E003C003C007800780078007000F000F000F000F000F000F000F000F000700078 +00780078003C003C001E001E000F00078003C001F000F000700C24799F18>I<6000F000 +78003C001E000F000780078003C003C001E001E001E000E000F000F000F000F000F000F0 +00F000F000E001E001E001E003C003C0078007800F001E003C007800F00060000C247C9F +18>I<01C00001C00001C00001C00061C300F9CF80FDDF807FFF003FFE000FF8000FF800 +3FFE007FFF00FDDF80F9CF8061C30001C00001C00001C00001C00011147D9718>I<0060 +0000F00000F00000F00000F00000F00000F00000F0007FFFC0FFFFE0FFFFE07FFFC000F0 +0000F00000F00000F00000F00000F00000F00000600013147E9718>I<1C3E7E7F3F1F07 +0E1E7CF860080C788518>I<7FFFC0FFFFE0FFFFE07FFFC013047E8F18>I<3078FCFC7830 +0606778518>I<000300000780000780000F80000F00001F00001E00001E00003E00003C +00007C0000780000780000F80000F00001F00001E00003E00003C00003C00007C0000780 +000F80000F00000F00001F00001E00003E00003C00003C00007C0000780000F80000F000 +00F0000060000011247D9F18>I<01F00007FC000FFE001F1F001E0F003C07807803C078 +03C07803C0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F803E078 +03C07803C07C07C03C07801E0F001F1F000FFE0007FC0001F000131C7E9B18>I<01C001 +C003C007C007C01FC0FFC0FBC063C003C003C003C003C003C003C003C003C003C003C003 +C003C003C003C003C003C07FFEFFFF7FFE101C7C9B18>I<03F0001FFE003FFF007C0F80 +7807C0F003C0F801E0F801E07001E00001E00001E00003C00003C0000780000780000F00 +001E00003C0000F80001F00003E00007C0000F80001E01E03C01E07FFFE0FFFFE07FFFE0 +131C7E9B18>I<03F8001FFE003FFF003C0F807C07C07C03C07C03C01003C00003800007 +80000F0003FE0003FE0003FF00000F800007C00003C00001E00001E00001E07001E0F801 +E0F803C0F007C07C0F807FFF001FFE0007F000131C7E9B18>I<001F00003F00007F0000 +770000F70001E70001C70003C7000787000707000E07001E07003C0700380700780700F0 +0700FFFFF8FFFFF8FFFFF8000700000700000700000700000700000700007FF0007FF000 +7FF0151C7F9B18>I<3FFF807FFF807FFF80780000780000780000780000780000780000 +7800007800007BF8007FFE007FFF007C0F803003C00003C00001E00001E07001E0F801E0 +F801E0F803C07807C07C0F803FFF001FFC0003F000131C7E9B18>I55 D<3078FCFC783000000000000000003078FCFC783006 +14779318>58 D<183C7E7E3C180000000000000000183C7E7E3E1E0E1C3C78F060071A78 +9318>I<0000C00003E00007E0001FC0003F8000FE0001FC0007F0000FE0003F80007F00 +00FC0000FC00007F00003F80000FE00007F00001FC0000FE00003F80001FC00007E00003 +E00000C013187E9918>I<7FFFC0FFFFE0FFFFE07FFFC00000000000000000000000007F +FFC0FFFFE0FFFFE07FFFC0130C7E9318>I<600000F80000FC00007F00003F80000FE000 +07F00001FC0000FE00003F80001FC00007E00007E0001FC0003F8000FE0001FC0007F000 +0FE0003F80007F0000FC0000F8000060000013187E9918>I<0FF0003FFC007FFF00781F +00F80780F80780F80780201F00007E0000FC0001F00001E00003C00003C00003C00003C0 +0003C00003800000000000000000000000000000000003800007C00007C00007C0000380 +00111C7D9B18>I<007C0001FE0007FF000F87801E03C03C1DC0387FC070FFE071E3E071 +C1E0E1C1E0E380E0E380E0E380E0E380E0E380E0E380E0E1C1C071C1C071E3C070FF8038 +7F003C1C001E01E00F83E007FFC001FF80007E00131C7E9B18>I<00F80000F80000F800 +01FC0001DC0001DC0001DC0003DE0003DE0003DE0003DE00038E00078F00078F00078F00 +078F00078F000F07800FFF800FFF800FFF800F07801E03C01E03C01E03C07F8FF0FF8FF8 +7F8FF0151C7F9B18>I<7FFE00FFFF007FFF801E07C01E03C01E01E01E01E01E01E01E01 +E01E01E01E03C01E07C01FFF801FFF001FFFC01E03E01E01E01E00F01E00F01E00F01E00 +F01E00F01E00F01E01E01E03E07FFFC0FFFF807FFE00141C7F9B18>I<00F8E003FFE007 +FFE00F07E01E03E03C03E03C01E07801E07801E0700000F00000F00000F00000F00000F0 +0000F00000F00000F000007000007801E07801E03C01E03C01E01E03C00F07C007FF8003 +FE0000F800131C7E9B18>I<7FFC00FFFF007FFF801E07C01E03E01E01E01E01F01E00F0 +1E00F01E00F81E00781E00781E00781E00781E00781E00781E00781E00781E00781E00F0 +1E00F01E01F01E01E01E03E01E07C07FFF80FFFF007FFC00151C809B18>III<01F1C0 +07FFC00FFFC01F0FC01E07C03C03C03803C07803C07803C0700000F00000F00000F00000 +F00000F00000F01FF0F03FF0F01FF07003C07803C07803C03807C03C07C01E0FC01F0FC0 +0FFFC007FFC001F3C0141C7E9B18>I<7FFF80FFFFC07FFF8001E00001E00001E00001E0 +0001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E0 +0001E00001E00001E00001E00001E00001E0007FFF80FFFFC07FFF80121C7D9B18>73 +D<01FFE001FFE001FFE0000F00000F00000F00000F00000F00000F00000F00000F00000F +00000F00000F00000F00000F00000F00000F00000F00000F00000F00700F00F80F00F80F +00F83E007FFC003FF8000FE000131C7E9B18>I76 DI<7E07F0FF0FF87F07F01F81C01D +81C01D81C01DC1C01CC1C01CC1C01CE1C01CE1C01CE1C01C61C01C71C01C71C01C31C01C +39C01C39C01C39C01C19C01C19C01C1DC01C0DC01C0DC01C0FC07F07C0FF87C07F03C015 +1C7F9B18>I<0FFE003FFF807FFFC07C07C07803C0F803E0F001E0F001E0F001E0F001E0 +F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E0 +F803E07803C07C07C07FFFC03FFF800FFE00131C7E9B18>II<7FF800FFFE007FFF001E1F801E07801E07C01E03C01E03C01E03C01E +07C01E07801E1F801FFF001FFE001FFE001E0F001E0F001E07801E07801E07801E07801E +07801E07BC1E07BC1E07BC7F83F8FFC1F87F80F0161C7F9B18>82 +D<7FFFF8FFFFF8FFFFF8F07878F07878F07878F078780078000078000078000078000078 +000078000078000078000078000078000078000078000078000078000078000078000078 +0000780007FF8007FF8007FF80151C7F9B18>84 DIII91 D<600000F00000F00000F800007800007C00003C00003C +00003E00001E00001F00000F00000F00000F800007800007C00003C00003C00003E00001 +E00001F00000F00000F800007800007800007C00003C00003E00001E00001E00001F0000 +0F00000F8000078000078000030011247D9F18>II<03800FE03FF8FFFE +FC7EF01E40040F077C9B18>I<7FFFC0FFFFE0FFFFE07FFFC013047E7F18>I<061E3E3870 +70E0E0E0F8FC7C7C38070E789E18>I<0FF0003FFC007FFE007C1F007C0F003807800007 +8000FF8007FF801FFF807F87807C0780F00780F00780F00780F807807C1F803FFFF81FFB +F807E1F815147E9318>I<7F0000FF00007F00000F00000F00000F00000F00000F00000F +3E000FFF800FFFE00FC1F00F80F00F00780F00780F003C0F003C0F003C0F003C0F003C0F +003C0F00780F80780F80F00FC1F00FFFE00FFF80073E00161C809B18>I<01FC0007FF00 +1FFF803E0F803C0F80780700780000F00000F00000F00000F00000F00000F00000780000 +7803C03C03C03E07C01FFF8007FF0001FC0012147D9318>I<001FC0003FC0001FC00003 +C00003C00003C00003C00003C001F3C007FFC01FFFC03E0FC03C07C07803C07803C0F003 +C0F003C0F003C0F003C0F003C0F003C07803C07807C03C07C03E1FC01FFFF807FBFC01F3 +F8161C7F9B18>I<01F80007FE000FFF001F0F803C03C07803C07801C0F001E0F001E0FF +FFE0FFFFE0FFFFE0F000007800007801E03C01E01F03E00FFFC007FF8000FE0013147E93 +18>I<001F80007FC000FFE000F3E001E3E001E08001E00001E0007FFFC0FFFFC0FFFFC0 +01E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E000 +01E00001E0007FFF807FFF807FFF80131C7F9B18>I<03F1E00FFFF01FFFF83E1F783C0F +307807807807807807807807807807803C0F003E1F003FFE003FFC003BF0003800003800 +001FFE001FFFC03FFFE07801F0700070E00038E00038E00038E000387800F07E03F01FFF +C00FFF8001FC00151F7F9318>I<7F0000FF00007F00000F00000F00000F00000F00000F +00000F1F000F7F800FFFC00FE1C00FC1E00F81E00F01E00F01E00F01E00F01E00F01E00F +01E00F01E00F01E00F01E00F01E00F01E07FE3FCFFF3FE7FE3FC171C809B18>I<01C000 +03E00003E00003E00001C0000000000000000000000000007FE000FFE0007FE00001E000 +01E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E000 +01E000FFFF80FFFF80FFFF80111D7D9C18>I<001C003E003E003E001C00000000000000 +000FFE0FFE0FFE001E001E001E001E001E001E001E001E001E001E001E001E001E001E00 +1E001E001E001E001E001E001E701CF83CF878FFF87FF01FC00F277E9C18>I<7E0000FE +00007E00000E00000E00000E00000E00000E00000E3FF00E3FF00E3FF00E07800E0F000E +1E000E3C000E78000EF0000FF8000FFC000F9C000F0E000E0F000E07000E03800E03C07F +C7F8FFC7F87FC7F8151C7F9B18>III<7F1F00FF7F807F +FFC00FE1C00FC1E00F81E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F +01E00F01E00F01E07FE3FCFFF3FE7FE3FC1714809318>I<01F0000FFE001FFF003E0F80 +3C07807803C07803C0F001E0F001E0F001E0F001E0F001E0F001E07803C07803C03C0780 +3F1F801FFF000FFE0001F00013147E9318>I<7F3E00FFFF807FFFE00FC1F00F80F00F00 +780F00780F003C0F003C0F003C0F003C0F003C0F003C0F00780F80780F80F00FC1F00FFF +E00FFF800F3E000F00000F00000F00000F00000F00000F00000F00007FE000FFF0007FE0 +00161E809318>I<01F9E007FDE00FFFE01F0FE03C07E07803E07801E0F001E0F001E0F0 +01E0F001E0F001E0F001E07801E07803E03C07E03E0FE01FFFE007FDE001F1E00001E000 +01E00001E00001E00001E00001E00001E0000FFC001FFE000FFC171E7F9318>II<07FF003FFF007FFF +00700F00E00F00E00F00F000007E00007FF0001FFC0007FF00003F00700780F00380F003 +80F80380FC0F00FFFF00FFFC00E7F00011147D9318>I<03800007800007800007800007 +80007FFFC0FFFFC0FFFFC007800007800007800007800007800007800007800007800007 +80000780C00781E00781E00781E003C3C003FFC001FF00007E0013197F9818>I<7F0FE0 +FF1FE07F0FE00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E00F01E0 +0F01E00F01E00F03E00F07E007FFFC03FFFE01F9FC1714809318>I<7F8FF0FF8FF87F8F +F01C01C00E03800E03800E0380070700070700070700078F00038E00038E0003DE0001DC +0001DC0001DC0000F80000F80000700015147F9318>II<7F8FF07F9FF07F8FF00F0700078E00039E00 +01DC0001F80000F80000700000F00000F80001DC00039E00038E000707000E07807F8FF0 +FF8FF87F8FF015147F9318>I<7F8FF0FF8FF87F8FF00E01C00E03800E03800703800707 +00070700038700038700038E0001CE0001CE0001CC0000DC0000FC000078000078000078 +0000700000700000700000F0007CE0007DE00073C0007F80003F00001E0000151E7F9318 +>I<3FFFF07FFFF07FFFF07803E07807C0780F80001F00003E00007C0000F80001F00003 +E00007C0000F80F01F00F03E00F07C00F0FFFFF0FFFFF0FFFFF014147F9318>I<0007E0 +001FE0007FE0007C0000F00000F00000F00000F00000F00000F00000F00000F00000F000 +00F00000F00001F0007FE000FFC000FFC0007FE00001F00000F00000F00000F00000F000 +00F00000F00000F00000F00000F00000F00000F000007C00007FE0001FE00007E013247E +9F18>I<60F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +F0F0F0600424769F18>I<7E0000FF8000FFE00003E00000F00000F00000F00000F00000 +F00000F00000F00000F00000F00000F00000F00000F800007FC0003FE0003FE0007FC000 +F80000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00003 +E000FFE000FF80007E000013247E9F18>I<0E0C1F1E3FBEFBF8F1F060E00F067C9B18>I +E /Fm 34 122 df<00001FE000007FF00001C03800018078000380780007003000070000 +0007000000070000000E0000000E0000000E000000FFFFE000FFFFE0001C01C0001C01C0 +001C01C0001C01C0001C0380003803800038038000380380003807000038070000780700 +0070071800700E3000700E3000700E3000600E6000E007E000E003C000E0000000E00000 +01C0000001C00000318000007B800000F30000007E0000003C0000001D29829F1A>12 +D<00003FC0FF800000FFE3FFC00001C1E700E0000381EE01E0000380DC01E00007001C00 +C0000700180000000700380000000700380000000E00380000000E00380000000E007000 +0000FFFFFFFF8000FFFFFFFF80000E00700700001C00700700001C00700700001C00E007 +00001C00E00E00001C00E00E00003800E00E00003800E00E00003801C01C00003801C01C +00003801C01C00007001C01C60007001C038C00070038038C00070038038C00070038039 +8000E003801F8000E003000F0000E00700000000E00700000001C00700000001C00E0000 +0031860E000000798F1C000000F31E380000007E0FF00000003C07C00000002B29829F28 +>14 D<1C3E7E7E3E060C0C18183060C080070E769F0E>39 D<000200060006000E003C00 +FC03DC031C0038003800380038007000700070007000E000E000E000E001C001C001C001 +C00380038003800380FFF8FFF80F1E7B9D17>49 D<070F1F1F0E00000000000000000000 +70F8F8F0E008147B930E>58 D<0000FE020007FF06001F818C003E00DC0078007C00F000 +7C01E0003803C00038078000380F8000381F0000301F0000303E0000303E0000007C0000 +007C0000007C0000007C000000F8000000F8000000F8000000F80000C0F8000180780001 +8078000300780003003C0006003C000C001E0018000F00300007C0E00003FF800000FE00 +001F217A9F21>67 D<01FFFFFC01FFFFF8001E0078001E0038001E0038003C0018003C00 +18003C0018003C003000780C3000780C3000780C0000781C0000F0380000FFF80000FFF8 +0000F0380001E0300001E0300001E0300001E0300003C0000003C0000003C0000003C000 +0007800000078000000780000007800000FFFC0000FFF800001E1F7D9E1E>70 +D<00FF007FE001FF00FFC0001F001E00001F800C00001F800C0000378018000033C01800 +0033C018000033C018000063C030000061E030000061E030000061E0300000C0F0600000 +C0F0600000C0F0600000C0786000018078C000018078C00001803CC00001803CC0000300 +3D800003001F800003001F800003001F800006000F000006000F000006000F00000E000F +0000FFC0060000FFC0060000231F7D9E22>78 D<01FFFF8001FFFFE0001E01F0001E0078 +001E0078003C007C003C007C003C007C003C007C007800F8007800F8007800F0007801E0 +00F003C000F00F8000FFFF0000FFF80001E0000001E0000001E0000001E0000003C00000 +03C0000003C0000003C0000007800000078000000780000007800000FFF80000FFF00000 +1E1F7D9E1F>80 D<0007E040001FF8C0003C1D8000700F8000E0078001C0078001800300 +038003000380030003800300038000000380000003C0000003F8000001FF800001FFE000 +007FF000001FF0000001F800000078000000380000003800000038003000380030003800 +3000300070007000700060007800E0007801C000EE078000C7FE000081F800001A217D9F +1A>83 D<00F18003FDC0078F800E07801C07803C07803C0700780700780700780700F00E +00F00E00F00E00F00E30F01C60F03C60707C6078FCC03FCFC00F070014147C9317>97 +D<07803F803F000700070007000E000E000E000E001C001C001CF01FFC3F1E3E0E3C0F38 +0F700F700F700F700FE01EE01EE01EE03CE03CE038607071E03FC01F0010207B9F15>I< +007E0001FF000383800F07801E07801C07003C0200780000780000780000F00000F00000 +F00000F00000F00000700200700700381E001FF80007E00011147C9315>I<0000780003 +F80003F00000700000700000700000E00000E00000E00000E00001C00001C000F1C003FD +C0078F800E07801C07803C07803C0700780700780700780700F00E00F00E00F00E00F00E +30F01C60F03C60707C6078FCC03FCFC00F070015207C9F17>I<007C0001FF000783000F +01801E01803C01803C0300780E007FFC007FE000F00000F00000F00000F0000070000070 +02007807003C1E001FF80007E00011147C9315>I<0000F80001FC0003BC00033C000718 +000700000700000E00000E00000E00000E00000E0000FFE001FFE0001C00001C00001C00 +00380000380000380000380000380000700000700000700000700000700000E00000E000 +00E00000E00000E00001C00001C00001C0000180003380007B8000F300007E00003C0000 +1629829F0E>I<003C6000FF7001E3E00381E00701E00F01E00F01C01E01C01E01C01E01 +C03C03803C03803C03803C03803C07003C0F001C1F001E3F000FFE0003CE00000E00000E +00001C00001C00301C00783800F0F0007FE0003F8000141D7E9315>I<01E0000FE0000F +C00001C00001C00001C000038000038000038000038000070000070000073E00077F000E +C3800F81C00F01C00E01C01E03801C03801C03801C0380380700380700380700380E1870 +0E30700E30701C60700C60E00FC060078015207D9F17>I<006000F000F000E000000000 +000000000000000000000F001F80318031C063806380C3800700070007000E000E000E00 +1C301C601C6038C018C01F800F000C1F7D9E0E>I<0001800003C00003C0000380000000 +000000000000000000000000000000000000003C00007E0000C700018700030700030700 +060E00000E00000E00000E00001C00001C00001C00001C00003800003800003800003800 +00700000700000700000700000E00000E00030E00079C000F380007F00003C0000122882 +9E0E>I<01E0000FE0000FC00001C00001C00001C0000380000380000380000380000700 +000700000703C00707E00E0C600E18E00E31E00E61E01CC1C01F80001F00001FC00039E0 +003870003870003838607070C07070C07070C0703980E03F00601E0013207D9F15>I<03 +C01FC01F8003800380038007000700070007000E000E000E000E001C001C001C001C0038 +003800380038007000700070007180E300E300E300E6007E003C000A207C9F0C>I<1E07 +C0F8003F1FE1FC0033B8730E0063E076070063C03C07006380380700C780780E00070070 +0E000700700E000700700E000E00E01C000E00E01C000E00E01C000E00E038601C01C038 +C01C01C038C01C01C071801C01C031803803803F001801801E0023147D9325>I<1E07C0 +3F1FE033B87063E07063C038638038C780700700700700700700700E00E00E00E00E00E0 +0E01C31C01C61C01C61C038C1C018C3801F81800F018147D931A>I<007C0001FF000383 +800F01C01E01C01C01E03C01E07801E07801E07801E0F003C0F003C0F003C0F00780F007 +00700F00701E003838001FF00007C00013147C9317>I<01C1E007E7F8067E3C0C7C1C0C +781E0C701E18E01E00E01E00E01E00E01E01C03C01C03C01C03C01C07803C07803C07003 +C0E003E3C0077F80071E000700000700000E00000E00000E00000E00001C0000FFC000FF +8000171D809317>I<0E0F003F3F8033F1C063C1C063C3C06383C0C78380070000070000 +0700000E00000E00000E00000E00001C00001C00001C00001C000038000018000012147D +9313>114 D<00FC03FE07070E0F0E0F0E0E1E000F800FF007F803FC003E001E701EF01C +F01CE03860703FE01F8010147D9313>I<018001C0038003800380038007000700FFF0FF +F00E000E000E000E001C001C001C001C0038003800380038307060706070C071803F001E +000C1C7C9B0F>I<0F00601F80703180E031C0E06380E06380E0C381C00701C00701C007 +01C00E03800E03800E03800E038C0E07180E07180E0F180E1F3007F3F003E1C016147D93 +18>I<0F01C01F83C03183E031C1E06380E06380E0C380C00700C00700C00700C00E0180 +0E01800E01800E03000E03000E06000E06000F0C0007F80001E00013147D9315>I<0F00 +60E01F8071E03180E1F031C0E0F06380E0706380E070C381C0600701C0600701C0600701 +C0600E0380C00E0380C00E0380C00E0381800E0381800E0781800E078300070F860007F9 +FC0001F0F8001C147D931E>I<0787800FCFC018F8E03070E06071E06071E0C0E1C000E0 +0000E00000E00001C00001C00001C00071C060F380C0F380C0E38180C7C3007CFE00387C +0013147D9315>I<0F00601F80703180E031C0E06380E06380E0C381C00701C00701C007 +01C00E03800E03800E03800E03800E07000E07000E0F000E1F0007FE0003EE00000E0000 +0E00001C00781C0078380070700060E0003FC0001F0000141D7D9316>I +E /Fn 74 123 df<001FC1F0007FF7F801F07E7C03C0FC7C0780FC7C0F00F8380F007800 +0F0078000F0078000F0078000F0078000F007800FFFFFF80FFFFFF800F0078000F007800 +0F0078000F0078000F0078000F0078000F0078000F0078000F0078000F0078000F007800 +0F0078000F0078000F0078000F0078000F0078007FE3FF807FE3FF801E20809F1B>11 +D<001F8000FFC001E0E003C0F00781F00F01F00F00E00F00000F00000F00000F00000F00 +00FFFFF0FFFFF00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00 +F00F00F00F00F00F00F00F00F00F00F00F00F07FC3FE7FC3FE1720809F19>I<001FB000 +FFF001E1F003C1F00781F00F00F00F00F00F00F00F00F00F00F00F00F00F00F0FFFFF0FF +FFF00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F +00F00F00F00F00F00F00F00F00F07FE7FE7FE7FE1720809F19>I<001FC0FC00007FE7FE +0001F07F070003C0FE07800780FC0F800F00F80F800F007807000F007800000F00780000 +0F007800000F007800000F00780000FFFFFFFF80FFFFFFFF800F007807800F007807800F +007807800F007807800F007807800F007807800F007807800F007807800F007807800F00 +7807800F007807800F007807800F007807800F007807800F007807800F007807807FE3FF +3FF07FE3FF3FF02420809F26>I<070F1F1E3C78F0E0400809779F17>19 +D<7038F87CFC7EFC7E7C3E0C060C060C06180C180C381C3018603040200F0E7F9F17>34 +D<70F8FCFC7C0C0C0C181838306040060E7C9F0D>39 D<006000C001800380070006000E +001C001C003C003800380078007000700070007000F000F000F000F000F000F000F000F0 +00F000F000F000F00070007000700070007800380038003C001C001C000E000600070003 +80018000C000600B2E7CA112>II<70F8F8F878181818183030606040050E7C840D>44 DI<70F8F8F87005057C840D>I<0000400000C0000180000180000180000300000300 +000300000600000600000C00000C00000C00001800001800001800003000003000006000 +00600000600000C00000C00000C000018000018000018000030000030000060000060000 +0600000C00000C00000C0000180000180000300000300000300000600000600000600000 +C00000C00000122D7EA117>I<03F0000FFC001E1E001C0E003807007807807003807003 +80700380F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003C0F003 +C0F003C0F003C07003807003807003807807803807001C0E001E1E000FFC0003F000121F +7E9D17>I<00C001C00FC0FFC0F3C003C003C003C003C003C003C003C003C003C003C003 +C003C003C003C003C003C003C003C003C003C003C003C003C07FFF7FFF101E7D9D17>I< +07F0000FFC00383E00700F00600F80F80780FC07C0FC07C0FC03C07803C03003C00007C0 +000780000780000F00001E00001C0000380000700000E00001C0000380000300C00600C0 +0C00C01801C03FFF807FFF80FFFF80FFFF80121E7E9D17>I<03F0000FFC001C1E00300F +00780F807C0F807C07807C0F803C0F80000F00000F00001E00007C0007F00007F000003C +00000E00000F000007800007800007C03007C07807C0FC07C0FC07C0FC0780780F80700F +003C1E001FFC0007F000121F7E9D17>I<000700000700000F00001F00001F00003F0000 +7F0000EF0000CF0001CF00038F00030F00070F000E0F000C0F00180F00380F00300F0060 +0F00E00F00FFFFF0FFFFF0000F00000F00000F00000F00000F00000F0000FFF000FFF014 +1E7F9D17>I<3003003FFF003FFE003FF8003FE000300000300000300000300000300000 +30000031F00037FC003E1E00380F00380F003007800007800007C00007C00007C07807C0 +F807C0F807C0F80780F00780600F00700E00383C001FF80007E000121F7E9D17>I<007C +0001FE000783000E07800C0F801C0F80380700380000780000700000700000F1F800F3FE +00F40E00F80700F80380F80380F003C0F003C0F003C0F003C0F003C07003C07003C07003 +803803803807001C07000E1E0007FC0001F000121F7E9D17>I<6000007FFFE07FFFE07F +FFC07FFFC0E00180C00300C00300C00600000C0000180000180000300000700000600000 +E00000E00001E00001C00001C00003C00003C00003C00003C00007C00007C00007C00007 +C00007C00007C000038000131F7E9D17>I<03F0000FFC001C1E00380700300700700380 +7003807003807803807C07007F07003F8E001FFC000FF80007FC0007FE001EFF00387F80 +701F80700FC0E003C0E003C0E001C0E001C0E001C0F001807003803807001E0E000FFC00 +03F000121F7E9D17>I<03F00007F8001E1C00380E00380700700700700380F00380F003 +80F003C0F003C0F003C0F003C0F003C07007C07007C03807C01C0BC01FF3C007E3C00003 +800003800007800007003807007C0E007C0E00781C003078001FF0000FC000121F7E9D17 +>I<70F8F8F8700000000000000000000070F8F8F87005147C930D>I<70F8F8F870000000 +0000000000000070F8F8F878181818183030606040051D7C930D>I61 D<0003800000038000000380000007C0000007C0000007C000 +000FE000000FE000000FE0000019F0000019F0000019F0000030F8000030F8000030F800 +00607C0000607C0000607C0000C03E0000C03E0000C03E0001FFFF0001FFFF0001801F00 +03000F8003000F8003000F80060007C0060007C01F0007E0FFC03FFEFFC03FFE1F207F9F +22>65 DI<000FE010007FF83000 +F80E7003E00370078001F00F0000F01F0000F01E0000703C0000703C0000707C00003078 +000030F8000030F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8 +000000780000307C0000303C0000303C0000301E0000601F0000600F0000C00780018003 +E0030000F80E00007FFC00000FE0001C217E9F21>I69 DI<000FE0 +10007FF83000F80E7003E00370078001F00F0000F01F0000F01E0000703C0000703C0000 +707C00003078000030F8000030F8000000F8000000F8000000F8000000F8000000F80000 +00F8007FFEF8007FFE780001F07C0001F03C0001F03C0001F01E0001F01F0001F00F0001 +F007C001F003E003F000FC0E70007FFC10000FF0001F217E9F24>III76 DII<001FE000007FF80001F03E0003C00F00078007800F0003C01E00 +01E03E0001F03C0000F07C0000F87C0000F878000078F800007CF800007CF800007CF800 +007CF800007CF800007CF800007CF800007CF800007C7C0000F87C0000F87C0000F83C00 +00F03E0001F01E0001E00F0003C00780078003C00F0001F03E00007FF800001FE0001E21 +7E9F23>II82 D<03F0400FFCC01E0FC03807C07803C070 +01C0F001C0F000C0F000C0F000C0F80000FC00007F00007FF0003FFE001FFF000FFF8003 +FFC0007FE00007E00003F00001F00000F0C000F0C000F0C000F0E000E0E000E0F001E0F8 +01C0FE0780C7FF0081FC0014217E9F19>I<7FFFFFE07FFFFFE07C0F81E0700F80E0600F +8060600F8060E00F8070C00F8030C00F8030C00F8030C00F8030000F8000000F8000000F +8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F +8000000F8000000F8000000F8000000F8000000F8000000F800003FFFE0003FFFE001C1F +7E9E21>IIII91 D<0804180C3018703860306030C0 +60C060C060F87CFC7EFC7E7C3E381C0F0E7A9F17>II<0FE0003FF8007C3C007C1E007C0F00380F00000F00000F0001FF000FCF003E0F0078 +0F00780F00F00F30F00F30F00F30F01F30783FF03FC7E00F83C014147E9317>97 +D<1E0000FE0000FE00001E00001E00001E00001E00001E00001E00001E00001E00001E00 +001E3F001EFFC01FC1E01F00F01E00701E00781E00381E003C1E003C1E003C1E003C1E00 +3C1E003C1E00381E00781E00701F00F01D83E01CFF80183E0016207F9F19>I<01F80007 +FE001E1F003C1F00381F00780E00700000F00000F00000F00000F00000F00000F0000078 +00007800003C01803C03801F070007FE0001F80011147F9314>I<0001E0000FE0000FE0 +0001E00001E00001E00001E00001E00001E00001E00001E00001E003F1E007FDE01F07E0 +3C03E03801E07801E07001E0F001E0F001E0F001E0F001E0F001E0F001E07001E07801E0 +3801E03C03E01E0FE00FFDFC03F1FC16207F9F19>I<03F0000FFC001E1E003C0F003807 +00780700700380F00380FFFF80FFFF80F00000F00000F000007000007800003801803C03 +801F070007FE0001F80011147F9314>I<003E0000FF0003CF80078F80078F800F07000F +00000F00000F00000F00000F00000F0000FFF000FFF0000F00000F00000F00000F00000F +00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00007F +F0007FF0001120809F0E>I<0000E003E3F00FFE701C1C70380E60780F00780F00780F00 +780F00780F00380E001C1C001FF80033E0002000003000003000003FFE003FFF801FFFC0 +1FFFE07001E06000F0E00070E00070E000707000E07801E03E07C00FFF0003FC00141F7F +9417>I<1E0000FE0000FE00001E00001E00001E00001E00001E00001E00001E00001E00 +001E00001E1F001E7F801EC3C01F81E01F01E01E01E01E01E01E01E01E01E01E01E01E01 +E01E01E01E01E01E01E01E01E01E01E01E01E01E01E0FFC7FCFFC7FC16207F9F19>I<1C +003E003E003E001C000000000000000000000000001E00FE00FE001E001E001E001E001E +001E001E001E001E001E001E001E001E001E001E00FFC0FFC00A1F7F9E0D>I<007000F8 +00F800F80070000000000000000000000000007807F807F800F800780078007800780078 +007800780078007800780078007800780078007800780078007800787078F878F8F0F9E0 +7FC03F000D28839E0E>I<1E0000FE0000FE00001E00001E00001E00001E00001E00001E +00001E00001E00001E00001E1FF01E1FF01E0F801E0E001E0C001E18001E30001E70001E +F0001FF8001F78001E3C001E3E001E1E001E1F001E0F801E07801E07C0FFCFF8FFCFF815 +207F9F18>I<1E00FE00FE001E001E001E001E001E001E001E001E001E001E001E001E00 +1E001E001E001E001E001E001E001E001E001E001E001E001E001E001E00FFC0FFC00A20 +7F9F0D>I<1E1F80FC00FE7FC3FE00FEC1E60F001F80FC07801F00F807801E00F007801E +00F007801E00F007801E00F007801E00F007801E00F007801E00F007801E00F007801E00 +F007801E00F007801E00F007801E00F007801E00F00780FFC7FE3FF0FFC7FE3FF024147F +9327>I<1E1F00FE7F80FEC3C01F81E01F01E01E01E01E01E01E01E01E01E01E01E01E01 +E01E01E01E01E01E01E01E01E01E01E01E01E01E01E0FFC7FCFFC7FC16147F9319>I<01 +F80007FE001E07803C03C03801C07000E07000E0F000F0F000F0F000F0F000F0F000F0F0 +00F07000E07801E03801C03C03C01E078007FE0001F80014147F9317>I<1E3F00FEFFC0 +FFC3E01F00F01E00701E00781E00781E003C1E003C1E003C1E003C1E003C1E003C1E0078 +1E00781E00F01F00F01F83E01EFF801E3E001E00001E00001E00001E00001E00001E0000 +1E0000FFC000FFC000161D7F9319>I<01F06007FCE01F0EE03C03E03C03E07801E07801 +E0F001E0F001E0F001E0F001E0F001E0F001E07801E07801E03803E03C03E01F0FE00FFD +E003F1E00001E00001E00001E00001E00001E00001E00001E0000FFC000FFC161D7F9318 +>I<1E78FEFCFF9E1F1E1F0C1F001E001E001E001E001E001E001E001E001E001E001E00 +1E00FFE0FFE00F147F9312>I<0FC83FF870386018E018E018F000FF807FE03FF81FFC01 +FC003EC00EC00EE00EE00CF83CDFF887E00F147F9312>I<06000600060006000E000E00 +1E003E00FFF8FFF81E001E001E001E001E001E001E001E001E001E001E0C1E0C1E0C1E0C +1E0C0F1807F003E00E1C7F9B12>I<1E01E0FE0FE0FE0FE01E01E01E01E01E01E01E01E0 +1E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E01E03E01E03E00E0DE007F9FC +03F1FC16147F9319>III<7FE7FC7FE7FC0F83E007838003C30003 +E70001EE0000FC00007800007800003C00007E0000FE0001CF000187800387800703C00F +03E0FF87FEFF87FE1714809318>I +I<7FFF7FFF781E703E603C607860F861F001E003E007C007830F831F031E073C067C0678 +1EFFFEFFFE10147F9314>I E /Fo 41 122 df<0001FF0000001FFFC000007F81E00000 +FC01E00001F807F00003F807F00007F007F00007F007F00007F007F00007F007F00007F0 +01C00007F000000007F000000007F000000007F03FF800FFFFFFF800FFFFFFF800FFFFFF +F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F8 +0007F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F800 +07F003F80007F003F80007F003F80007F003F80007F003F80007F003F80007F003F8007F +FF3FFF807FFF3FFF807FFF3FFF80212A7FA925>12 D<000E00001E00007E0007FE00FFFE +00FFFE00F8FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE +0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE +0000FE0000FE0000FE0000FE0000FE0000FE0000FE00FFFFFEFFFFFEFFFFFE17277BA622 +>49 D<00FF800007FFF0001FFFFC003E07FE007E01FF807F007F80FF807FC0FF803FC0FF +803FE0FF801FE0FF801FE07F001FE03E003FE000003FE000003FC000003FC000007F8000 +007F000000FE000000FC000001F8000003F0000007C000000F8000001F0000003C000000 +7800E0007000E000E000E001C001C0030001C0060001C00FFFFFC01FFFFFC03FFFFFC07F +FFFFC0FFFFFF80FFFFFF80FFFFFF801B277DA622>I<007F800003FFF00007FFFC000F81 +FE001F00FF001F80FF003FC07F803FC07F803FC07F803FC07F801FC07F800F80FF000000 +FF000000FE000001FC000003F8000007F00000FF800000FFC0000001F8000000FE000000 +7F0000007F8000003FC000003FC000003FE01C003FE07F003FE07F003FE0FF803FE0FF80 +3FE0FF803FC0FF803FC07F007F807E00FF003F01FE001FFFFC0007FFF00000FF80001B27 +7DA622>I<00000F0000000F0000001F0000003F0000007F000000FF000001FF000001FF +000003BF0000073F00000E3F00001C3F00003C3F0000383F0000703F0000E03F0001C03F +0003803F0007803F0007003F000E003F001C003F0038003F0070003F00F0003F00FFFFFF +F8FFFFFFF8FFFFFFF800007F0000007F0000007F0000007F0000007F0000007F0000007F +0000007F00001FFFF8001FFFF8001FFFF81D277EA622>I<180003001F801F001FFFFE00 +1FFFFC001FFFF8001FFFF0001FFFE0001FFF80001FFE00001C0000001C0000001C000000 +1C0000001C0000001C0000001C7FC0001DFFF8001F80FC001E003F0008003F0000001F80 +00001FC000001FC000001FE000001FE03C001FE07E001FE0FF001FE0FF001FE0FF001FE0 +FF001FC0FE001FC07C003F8078003F803C007F001F01FE000FFFFC0003FFF00000FF8000 +1B277DA622>I<0007F800003FFE0000FFFF0001FC0F8003F00F8007E01FC00FC03FC01F +803FC01F803FC03F803FC03F001F807F000F007F0000007F000000FF020000FF1FF000FF +3FFC00FF603E00FFC03F00FF801F80FF801FC0FF801FC0FF001FC0FF001FE0FF001FE0FF +001FE07F001FE07F001FE07F001FE07F001FE03F001FE03F001FC01F801FC01F801F800F +C03F0007E07E0003FFFC0001FFF800003FC0001B277DA622>I<380000003E0000003FFF +FFF03FFFFFF03FFFFFF07FFFFFE07FFFFFC07FFFFF807FFFFF0070000E0070000E007000 +1C00E0003800E0007000E000E0000001C0000001C0000003800000078000000F8000000F +0000001F0000001F0000003F0000003F0000007E0000007E0000007E000000FE000000FE +000000FE000000FE000001FE000001FE000001FE000001FE000001FE000001FE000001FE +000000FC0000007800001C297CA822>I<00000780000000000780000000000FC0000000 +000FC0000000000FC0000000001FE0000000001FE0000000003FF0000000003FF0000000 +003FF00000000077F80000000077F800000000F7FC00000000E3FC00000000E3FC000000 +01C1FE00000001C1FE00000003C1FF0000000380FF0000000380FF00000007007F800000 +07007F8000000F007FC000000E003FC000000E003FC000001C001FE000001C001FE00000 +3FFFFFF000003FFFFFF000003FFFFFF00000700007F80000700007F80000F00007FC0000 +E00003FC0001E00003FE0001C00001FE0001C00001FE0003C00001FF00FFFE003FFFFCFF +FE003FFFFCFFFE003FFFFC2E297EA833>65 D69 DI73 +D76 +DI80 D<00FF806003FFF0E00FFFF9E01F80FFE03F001FE03E0007E07C0003 +E07C0003E0FC0001E0FC0001E0FC0000E0FE0000E0FE0000E0FF000000FFC000007FFC00 +007FFFE0003FFFF8001FFFFE001FFFFF0007FFFF8003FFFFC000FFFFC0000FFFE000007F +E000001FF000000FF0000007F0E00003F0E00003F0E00003F0E00003F0F00003E0F00003 +E0F80007E0FC0007C0FF000F80FFE03F80F3FFFE00E1FFFC00C01FF0001C297CA825>83 +D<7FFFFFFFFF807FFFFFFFFF807FFFFFFFFF807F807F807F807C007F800F8078007F8007 +8078007F80078070007F800380F0007F8003C0F0007F8003C0E0007F8001C0E0007F8001 +C0E0007F8001C0E0007F8001C0E0007F8001C000007F80000000007F80000000007F8000 +0000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000 +0000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000 +0000007F80000000007F80000000007F80000000007F80000000007F80000000007F8000 +0000007F80000000FFFFFFC00000FFFFFFC00000FFFFFFC0002A287EA72F>I86 +D<01FF80000FFFF0001F81FC003FC0FE003FC07F003FC03F003FC03F801F803F800F003F +8000003F8000003F800000FF80007FFF8003FFFF800FF03F801FC03F803F803F807F003F +80FE003F80FE003F80FE003F80FE003F80FE007F807F00DF803F839FFC1FFF0FFC03FC03 +FC1E1B7E9A21>97 DI<003FE00001FFFC0003F07E000FC0FF001FC0FF003F80FF003F80FF007F007E00 +7F003C007F000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 +7F0000007F0000007F8000003F8003803F8003801FC007000FE00E0003F83C0001FFF800 +003FC000191B7E9A1E>I<00007FF000007FF000007FF0000007F0000007F0000007F000 +0007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000 +3F87F001FFF7F007F03FF00FC00FF01F8007F03F8007F03F8007F07F0007F07F0007F07F +0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F0FF0007F07F +0007F07F0007F03F0007F03F8007F01F800FF00FC01FF007F07FFF01FFE7FF007F87FF20 +2A7EA925>I<003FC00001FFF00003F0FC000FC03E001F803F001F801F003F801F807F00 +1F807F001FC07F000FC0FF000FC0FF000FC0FFFFFFC0FFFFFFC0FF000000FF000000FF00 +00007F0000007F0000007F0000003F8001C01F8001C00FC0038007C0070003F01E0000FF +FC00003FE0001A1B7E9A1F>I<0003F800001FFE00007E3F0001FC3F8001F87F8003F87F +8007F07F8007F03F0007F03F0007F0000007F0000007F0000007F0000007F0000007F000 +00FFFFC000FFFFC000FFFFC00007F0000007F0000007F0000007F0000007F0000007F000 +0007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F000 +0007F0000007F0000007F0000007F0000007F0000007F000007FFF80007FFF80007FFF80 +00192A7EA915>I<00FF81F003FFE7F80FC1FE1C1F80FC7C3F007E7C3F007E387F007F00 +7F007F007F007F007F007F007F007F007F007F003F007E003F007E001F80FC000FC1F800 +1FFFE00018FF800038000000380000003C0000003E0000003FFFF8003FFFFF001FFFFFC0 +0FFFFFE007FFFFF01FFFFFF03E0007F07C0001F8F80000F8F80000F8F80000F8F80000F8 +7C0001F07C0001F03F0007E00FC01F8007FFFF00007FF0001E287E9A22>II<07000F801FC03FE03FE0 +3FE01FC00F8007000000000000000000000000000000FFE0FFE0FFE00FE00FE00FE00FE0 +0FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0FFFE +FFFEFFFE0F2B7EAA12>I107 DIII<003FE00001FFFC0003F07E000FC01F801F800FC03F80 +0FE03F0007E07F0007F07F0007F07F0007F0FF0007F8FF0007F8FF0007F8FF0007F8FF00 +07F8FF0007F8FF0007F8FF0007F87F0007F07F0007F03F800FE03F800FE01F800FC00FC0 +1F8007F07F0001FFFC00003FE0001D1B7E9A22>II114 D<03FE300FFFF03E03F07800F07000 +F0F00070F00070F80070FE0000FFE0007FFF007FFFC03FFFE01FFFF007FFF800FFF80007 +FC0000FCE0007CE0003CF0003CF00038F80038FC0070FF01E0F7FFC0C1FF00161B7E9A1B +>I<00E00000E00000E00000E00001E00001E00001E00003E00003E00007E0000FE0001F +FFE0FFFFE0FFFFE00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000F +E0000FE0000FE0000FE0000FE0700FE0700FE0700FE0700FE0700FE0700FE07007F0E003 +F0C001FF80007F0014267FA51A>IIIIII E /Fp 39 127 df<007E0001C1800301800703C00E03C00E01800E00 +000E00000E00000E00000E0000FFFFC0FFFFC00E01C00E01C00E01C00E01C00E01C00E01 +C00E01C00E01C00E01C00E01C00E01C00E01C00E01C00E01C07F87F87F87F8151D809C17 +>12 D16 D<070F0F1C3870E0400808789C15>19 D<1C001E000780038003 +800380FF00800009087B7E12>24 D<70F8F8F87005057D840C>46 +D<07C01FF0387C603C601EF01FF81FF80FF80F700F001F001E001E003C0038007000E000 +C00180030006000C031803100320067FFEFFFEFFFE101C7E9B15>50 +D<00060000000F0000000F0000000F0000001F8000001F8000001F8000003FC0000033C0 +000033C0000073E0000061E0000061E00000E1F00000C0F00000C0F00001C0F800018078 +0001FFF80003FFFC0003003C0003003C0007003E0006001E0006001E000E001F001E000F +00FF807FF0FF807FF01C1D7F9C1F>65 D<001F808000FFE18001F03B8007C00F800F0007 +801F0007801E0003803C0003807C0001807C00018078000180F8000000F8000000F80000 +00F8000000F8000000F8000000F8000000F8000000780001807C0001807C0001803C0001 +801E0003001F0003000F00060007C00C0001F0380000FFF000001FC000191E7E9C1E>67 +D69 D73 D76 +D<003F800000E0E0000380380007001C000E000E001E000F003C0007803C0007807C0007 +C0780003C0780003C0F80003E0F80003E0F80003E0F80003E0F80003E0F80003E0F80003 +E0F80003E0780003C07C0007C07C0007C03C0007803E000F801E000F000F001E0007001C +000380380000E0E000003F80001B1E7E9C20>79 DI<7FFFFFC07FFFFFC0780F03C0700F01C0600F00C0E00F00E0C00F0060C00F0060 +C00F0060C00F0060000F0000000F0000000F0000000F0000000F0000000F0000000F0000 +000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000 +03FFFC0003FFFC001B1C7F9B1E>84 D<0FE0001838003C1C003C0E00180E00000E00000E +0001FE000F8E003C0E00780E00700E00F00E60F00E60F00E60701E603827C00FC3801312 +7F9115>97 DI<03F80E0C1C1E381E +780C7000F000F000F000F000F000F0007000780638061C0C0E1803E00F127F9112>I<00 +1F80001F8000038000038000038000038000038000038000038000038000038003F3800E +0F801C0780380380780380700380F00380F00380F00380F00380F00380F0038070038078 +03803803801C07800E1BF003F3F0141D7F9C17>I<07E00C301818381C701E700EF00EFF +FEF000F000F000F000700070063806180C0E1803E00F127F9112>I<00F8018C071E061E +0E0C0E000E000E000E000E000E00FFE0FFE00E000E000E000E000E000E000E000E000E00 +0E000E000E000E000E007FE07FE00F1D809C0D>I<00038007E4C00C39C0381DC0381C00 +781E00781E00781E00781E00381C00381C001C300037E0002000003000003000003FF800 +1FFF001FFF803003806001C0C000C0C000C0C000C06001803003001C0E0007F800121C7F +9215>II<38007C007C007C003800 +000000000000000000000000FC00FC001C001C001C001C001C001C001C001C001C001C00 +1C001C001C001C00FF80FF80091D7F9C0C>I<01C003E003E003E001C000000000000000 +000000000007E007E000E000E000E000E000E000E000E000E000E000E000E000E000E000 +E000E000E000E000E000E060E0F0C0F1C061803E000B25839C0D>I108 DI +I<03F0000E1C00180600380700700380700380F003C0F003C0F003C0F003C0F003C0F003 +C07003807003803807001C0E000E1C0003F00012127F9115>II<03F1800E19801C0780380780780380780380F00380F00380F00380F00380F00380 +F003807003807803803807801C07800E1B8003E380000380000380000380000380000380 +000380001FF0001FF0141A7F9116>II<1F9020F04070C030C030E030F8 +007F803FE00FF000F8C038C018C018E018E010D0608FC00D127F9110>I<0C000C000C00 +0C000C000C001C001C003FE0FFE01C001C001C001C001C001C001C001C001C301C301C30 +1C301C300C200E6003C00C1A7F9910>IIII<7F8FF07F8FF00F0780070600038E0001DC0001D80000F00000700000780000F80001 +DC00038E00030E000607000F0380FF0FF8FF0FF81512809116>II<1C043F0843F080E00E047D9B15>126 D E /Fq 13 118 +df<0F001F003F803F007E00F800F000C0000908769C18>19 D<00038000000380000007 +C0000007C0000007C000000FE000000FE000001FF000001BF000003BF8000031F8000031 +F8000060FC000060FC0000E0FE0000C07E0000C07E0001803F0001FFFF0003FFFF800300 +1F8007001FC006000FC006000FC00C0007E00C0007E0FF803FFEFF803FFE1F1C7E9B24> +65 D<07F8601FFEE03C07E07801E07000E0F000E0F00060F00060F80000FE0000FFE000 +7FFE003FFF003FFF800FFFC007FFE0007FE00003F00001F00000F0C000F0C000F0C000E0 +E000E0F001C0FC03C0EFFF00C3FC00141C7D9B1B>83 D<07F8001FFE003F1F803F07803F +07C01E07C00C07C003FFC01FFFC03F87C07E07C0FC07C0FC07C0FC07C0FC0FC07E1FC03F +FBF80FE1F815127F9117>97 DI<03 +F8000FFE001F3F003E3F007C3F007C1E00FC0C00FC0000FC0000FC0000FC0000FC00007C +00007E01803E03801F07000FFE0003F80011127E9115>I<1C003E007F007F007F003E00 +1C00000000000000000000007F007F001F001F001F001F001F001F001F001F001F001F00 +1F001F001F001F00FFC0FFC00A1E7F9D0E>105 D109 D<01FC000FFF801F07C03E03E07C01F07C01F0FC01F8FC01F8 +FC01F8FC01F8FC01F8FC01F87C01F07C01F03E03E01F07C00FFF8001FC0015127F9118> +111 D114 +D<1FD83FF87038E018E018F000FF807FE07FF01FF807FC007CC01CC01CE01CF038FFF0CF +C00E127E9113>I<030003000300070007000F000F003F00FFFCFFFC1F001F001F001F00 +1F001F001F001F001F001F0C1F0C1F0C1F0C0F9807F003E00E1A7F9913>II E /Fr 19 118 df<387CFCFE7E3E0E1C +3CF8F040070C788516>44 DI<3078FCFC78300606 +788516>I<00F80003FC0007FE000F07001C3B8038FF8079FF8073C7C07383C0E701C0E7 +01C0E701C0E701C0E701C0E701C0E701C073838073C78079FF0038FE001C38000F03C007 +FFC003FF0000FC0012197E9816>64 D<1FE0003FF0007FF800783C00300E00000E00003E +0007FE001FFE007FCE00780E00E00E00E00E00E00E00783E007FFFE03FF7E00FC3E01312 +7E9116>97 DI<03F80FFC1FFE3C1E780C7000E000E000E000E000 +E000F000700778073E0E1FFC0FF803F010127D9116>I<003F00003F00003F0000070000 +070000070000070003E7000FF7001FFF003C1F00780F00700700E00700E00700E00700E0 +0700E00700E00700700F00780F003C1F001FFFE00FF7E007C7E013197F9816>I<03F000 +0FFC001FFE003C0F00780700700380E00380FFFF80FFFF80FFFF80E00000E00000700380 +7803803E07801FFF0007FE0001F80011127E9116>I<001E00007F0001FF8001C7800383 +000380000380007FFF00FFFF00FFFF000380000380000380000380000380000380000380 +000380000380000380000380000380007FFC00FFFE007FFC0011197F9816>I104 D<07000F800F800F800700000000000000FF80FF80FF80038003800380 +038003800380038003800380038003800380FFFCFFFEFFFC0F1A7C9916>I<7FC000FFC0 +007FC00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00001C0 +0001C00001C00001C00001C00001C00001C00001C00001C0007FFF00FFFF807FFF001119 +7E9816>108 D<03E0000FF8001FFC003C1E00780F00700700E00380E00380E00380E003 +80E00380F00780700700780F003C1E001FFC000FF80003E00011127E9116>111 +DI<7F0F80FF3FC07F7FE007F1E007C0C007800007 +80000700000700000700000700000700000700000700000700007FFC00FFFC007FFC0013 +127F9116>114 D<0FEC3FFC7FFCF03CE01CE01C70007F801FF007F8003C600EE00EF00E +F81EFFFCFFF8C7E00F127D9116>I<0300000700000700000700000700007FFF00FFFF00 +FFFF00070000070000070000070000070000070000070000070100070380070380070380 +07870003FE0001FC0000F80011177F9616>II E /Fs 40 125 df<038007800F800F001E003C0038007000E0004000 +090A77A218>19 D<70F8FCFC7404040404080810102040060F7C840E>44 +DI<00C001C007C0FFC0FBC003C003C003C003C003C003C0 +03C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C0 +03C003C0FFFFFFFF10217CA018>49 D<3000803C07003FFF003FFE003FF80037E0003000 +0030000030000030000030000030000031F800360C003807003007003007800003C00003 +C00003E00003E00003E07003E0F803E0F803E0F803E0F803C0C003C0600780600780300F +001C1E000FFC0003F00013227EA018>53 D<01F00007FC000E0E001C0700380380780380 +700380F001C0F001C0F001C0F001E0F001E0F001E0F001E0F001E07001E07003E03803E0 +1805E00C05E00619E003E1E00001C00001C00003C00003803803807C03807C0700780E00 +301C003838001FF00007C00013227EA018>57 D<000FE010003FF83000F80E7001E00770 +03C001F0078001F00F0000F01E0000F03E0000703C0000707C0000707C00003078000030 +78000030F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000 +78000000780000307C0000307C0000303C0000303E0000601E0000600F0000C0078000C0 +03C0018001E0030000FC0E00003FFC00000FE0001C247DA223>67 +DI< +FFFFFFE0FFFFFFE007C007E007C001E007C000E007C0006007C0007007C0007007C00030 +07C0003007C0183007C0183007C0180007C0180007C0380007C0780007FFF80007FFF800 +07C0780007C0380007C0180007C0180007C0180007C0180007C0000007C0000007C00000 +07C0000007C0000007C0000007C0000007C00000FFFF0000FFFF00001C227FA120>70 +D72 +DI76 D +78 D80 D82 D85 D87 D<1FF000383C007C0E007C0F007C078038078000078000078000 +FF8007C7801E07803C0780780780700780F00798F00798F00798F00F987817983C23F00F +C1E015157E9418>97 D<0F0000FF0000FF00001F00000F00000F00000F00000F00000F00 +000F00000F00000F00000F00000F00000F3F000F61C00F80600F00300F00380F003C0F00 +1C0F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001C0F003C0F00380F00700F80 +600E61C00C3F0017237FA21B>I<01FE000707000C0F801C0F80380F80780700700000F0 +0000F00000F00000F00000F00000F00000F000007000007800C03800C01C01800C030007 +060001F80012157E9416>I<0001E0001FE0001FE00003E00001E00001E00001E00001E0 +0001E00001E00001E00001E00001E00001E001F9E00707E00C03E01C01E03801E07801E0 +7001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E07001E07801E03801E01801E0 +0C03F0070DFE01F1FE17237EA21B>I<01FC000707000C03801C01C03801C07801E07000 +E0F000E0FFFFE0F00000F00000F00000F00000F000007000007800603800601C00C00E01 +8007070000FC0013157F9416>I<003E0000E18003C3C00387C00787C00F03800F00000F +00000F00000F00000F00000F00000F00000F0000FFF800FFF8000F00000F00000F00000F +00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F +00000F0000FFF000FFF000122380A20F>I<0000F003F1180E1E381C0E38380730380700 +7807807807807807807807803807003807001C0E001E1C0033F000200000200000300000 +3800003FFE001FFFC00FFFE03801F0700070E00038E00038E00038E00038600030700070 +3800E00E038003FE0015217F9518>I<0F0000FF0000FF00001F00000F00000F00000F00 +000F00000F00000F00000F00000F00000F00000F00000F0F800F31C00F40E00F80F00F80 +F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00 +F00F00F00F00F0FFF3FFFFF3FF18237FA21B>I<0E001F001F001F000E00000000000000 +000000000000000000000F007F007F001F000F000F000F000F000F000F000F000F000F00 +0F000F000F000F000F000F00FFE0FFE00B2280A10D>I<0F00FF00FF001F000F000F000F +000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F +000F000F000F000F000F000F000F000F00FFF0FFF00C2380A20D>108 +D<0F0FC07E00FF30E18700FF407203801F807C03C00F807C03C00F007803C00F007803C0 +0F007803C00F007803C00F007803C00F007803C00F007803C00F007803C00F007803C00F +007803C00F007803C00F007803C00F007803C00F007803C0FFF3FF9FFCFFF3FF9FFC2615 +7F9429>I<0F0F80FF31C0FF40E01F80F00F80F00F00F00F00F00F00F00F00F00F00F00F +00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F0FFF3FFFFF3FF18157F94 +1B>I<01FC000707000C01801800C03800E0700070700070F00078F00078F00078F00078 +F00078F00078F000787000707800F03800E01C01C00E038007070001FC0015157F9418> +I<0F3F00FF61C0FF80600F00700F00380F003C0F003C0F001E0F001E0F001E0F001E0F00 +1E0F001E0F001E0F003C0F003C0F00380F00700F80E00F61C00F3F000F00000F00000F00 +000F00000F00000F00000F00000F0000FFF000FFF000171F7F941B>I<01F860070CE00E +02E01C03E03801E07801E07801E0F001E0F001E0F001E0F001E0F001E0F001E0F001E078 +01E07801E03801E01C03E00C03E0070DE001F1E00001E00001E00001E00001E00001E000 +01E00001E00001E0001FFE001FFE171F7E941A>I<0F1E00FF2300FF47801F87800F8300 +0F80000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F0000 +0F00000F0000FFF800FFF8001115809413>I<0FC8307860386018E018E018F000FC007F +C03FE01FF007F8007CC03CC01CC01CE01CE018F038D8708FC00E157E9413>I<06000600 +06000600060006000E000E000E001E003FFCFFFC1E001E001E001E001E001E001E001E00 +1E001E001E0C1E0C1E0C1E0C1E0C1E0C0F18071001E00E1F7F9E13>I<0F00F0FF0FF0FF +0FF01F01F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F00F +00F00F00F00F01F00F01F00702F80386FF00F8FF18157F941B>II121 D<3FFFC03C0780380F80300F00701E00603E +00603C0060780000F80000F00001E00003C00007C0C00780C00F00C01F01C01E01803C01 +807C0380780780FFFF8012157F9416>I124 +D E /Ft 20 118 df<78FCFCFCFC7806067A8512>46 D<007F800001FFE0000781F8000E +007C0018003E0030001F0030000F8060000FC0600007C0F80007C0FC0007E0FE0007E0FE +0003E0FE0003E0FE0003E07C0007E0000007E0000007C0000007C000000FC000000F8000 +000F8000001F0000003E0000003C00000078000000F8000000F0000001E0000003C00000 +070000000E0000001C000000180000003000000060000000C00060018000600380006007 +0000C00E0000C00C0000C0180001C03FFFFFC07FFFFF80FFFFFF80FFFFFF801B2F7DAE21 +>50 D76 DI80 +D82 D<03FE00000FFFC0001E03E0003F00F0 +003F0078003F003C001E001C000C001E0000001E0000001E0000001E0000001E000001FE +00003FFE0001FF1E0007F01E000F801E001F001E003E001E007C001E007C001E00F8001E +0CF8001E0CF8001E0CF8003E0CF8003E0C7C007E0C3E00DF1C1F038FB80FFF07F003F803 +C01E1F7D9E21>97 D<001FF00000FFFC0001F01E0007C03F000F003F000F003F001E001E +003C000C003C0000007C00000078000000F8000000F8000000F8000000F8000000F80000 +00F8000000F8000000F8000000F80000007C0000007C0000003C0000003E0001801E0001 +800F0003000F80070007C00E0001F81C0000FFF000001FC000191F7E9E1D>99 +D<003F800000FFE00003E0F80007803C000F001E001E001E001E000F003C000F007C000F +007C000F8078000780F8000780FFFFFF80FFFFFF80F8000000F8000000F8000000F80000 +00F8000000F8000000780000007C0000003C0000003C0001801E0001800F0003000F8006 +0007C00E0001F0380000FFF000001FC000191F7E9E1D>101 D<0003F0000FF8003C3C00 +787E00F07E01E07E01E03C01C01803C00003C00003C00003C00003C00003C00003C00003 +C00003C00003C00003C000FFFFC0FFFFC003C00003C00003C00003C00003C00003C00003 +C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003 +C00003C00003C00003C00003C00003C00003C00003C00007E0007FFF007FFF0017327FB1 +14>I<000000F0007F03F801FFCF1C03C1FC3C0780F83C0F0078181F007C001E003C003E +003E003E003E003E003E003E003E003E003E003E003E003E003E001E003C001F007C000F +0078000780F0000FC1E0000DFFC0001C7F000018000000180000001C0000001C0000001E +0000000FFFF8000FFFFF0007FFFF800FFFFFC01E0007E0380001F07000007070000078E0 +000038E0000038E0000038E0000038E000003870000070780000F03C0001E01E0003C007 +C01F0001FFFC00003FE0001E2F7E9F21>I<0780000000FF80000000FF800000000F8000 +000007800000000780000000078000000007800000000780000000078000000007800000 +000780000000078000000007800000000780000000078000000007800000000780000000 +07800000000781FE00000787FF8000078E07C000079803E00007B001E00007E000F00007 +C000F00007C000F00007C000F000078000F000078000F000078000F000078000F0000780 +00F000078000F000078000F000078000F000078000F000078000F000078000F000078000 +F000078000F000078000F000078000F000078000F000078000F000078000F000078000F0 +000FC001F800FFFC1FFF80FFFC1FFF8021327EB125>I<0F001F801F801F801F800F0000 +00000000000000000000000000000000000000000007807F807F800F8007800780078007 +800780078007800780078007800780078007800780078007800780078007800780078007 +80078007800FC0FFF8FFF80D307EAF12>I<0780FF80FF800F8007800780078007800780 +078007800780078007800780078007800780078007800780078007800780078007800780 +078007800780078007800780078007800780078007800780078007800780078007800780 +078007800FC0FFFCFFFC0E327EB112>108 D<0781FE003FC000FF87FF80FFF000FF8E07 +C1C0F8000F9803E3007C0007B001E6003C0007E000FC001E0007C000F8001E0007C000F8 +001E0007C000F8001E00078000F0001E00078000F0001E00078000F0001E00078000F000 +1E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E +00078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E00 +078000F0001E00078000F0001E00078000F0001E00078000F0001E00078000F0001E000F +C001F8003F00FFFC1FFF83FFF0FFFC1FFF83FFF0341F7E9E38>I<0781FE0000FF87FF80 +00FF8E07C0000F9803E00007B001E00007E000F00007C000F00007C000F00007C000F000 +078000F000078000F000078000F000078000F000078000F000078000F000078000F00007 +8000F000078000F000078000F000078000F000078000F000078000F000078000F0000780 +00F000078000F000078000F000078000F000078000F0000FC001F800FFFC1FFF80FFFC1F +FF80211F7E9E25>I<001FC00000FFF80001E03C0007800F000F0007801E0003C01E0003 +C03C0001E03C0001E0780000F0780000F0780000F0F80000F8F80000F8F80000F8F80000 +F8F80000F8F80000F8F80000F8F80000F8780000F07C0001F03C0001E03C0001E01E0003 +C01E0003C00F00078007C01F0001F07C0000FFF800001FC0001D1F7E9E21>I<0783E0FF +8FF8FF9C7C0FB87C07F07C07E03807E00007C00007C00007C00007800007800007800007 +800007800007800007800007800007800007800007800007800007800007800007800007 +80000780000780000FC000FFFE00FFFE00161F7E9E19>114 D<00C00000C00000C00000 +C00000C00001C00001C00001C00003C00003C00007C0000FC0001FC000FFFFE0FFFFE003 +C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003C00003 +C00003C00003C00003C00003C03003C03003C03003C03003C03003C03003C03003C03001 +E06001E06000F0C0007F80001F00142C7FAB19>116 D<078000F000FF801FF000FF801F +F0000F8001F000078000F000078000F000078000F000078000F000078000F000078000F0 +00078000F000078000F000078000F000078000F000078000F000078000F000078000F000 +078000F000078000F000078000F000078000F000078000F000078000F000078001F00007 +8001F000078003F000038007F00003C00EF00001F03CF80000FFF0FF80003FC0FF80211F +7E9E25>I E end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 300dpi +TeXDict begin + +%%EndSetup +%%Page: 1 1 +1 0 bop 108 381 a Ft(Reference)22 b(Man)n(ual)f(of)g(the)h(Programming) +f(Language)g(Lua)g(2.2)99 508 y Fs(Rob)q(erto)c(Ierusalimsc)o(h)o(y)49 +b(Luiz)17 b(Henrique)e(de)h(Figueiredo)50 b(W)l(aldemar)17 +b(Celes)g(Filho)563 587 y Fr(roberto,lhf,celes)o(@icad)o(.puc-)o(rio.b) +o(r)479 694 y Fs(Departamen)o(to)g(de)f(Inform\023)-24 +b(atica)17 b(|)f(PUC-Rio)763 795 y(No)o(v)o(em)o(b)q(er,)e(1995)842 +963 y Fq(Abstract)72 1039 y Fp(Lua)f(is)h(an)f(extension)i(programmi)o +(ng)c(language)h(designed)j(to)e(b)q(e)i(used)f(as)g(a)f +(con\014guration)g(language)g(for)72 1089 y(an)o(y)18 +b(program)f(that)h(needs)i(one.)31 b(This)19 b(do)q(cumen)o(t)e +(describ)q(es)k(v)o(ersion)d(2.2)g(of)f(the)i(Lua)f(programming)72 +1138 y(language)d(and)g(the)h(API)g(that)g(allo)o(ws)e(in)o(teraction)i +(b)q(et)o(w)o(een)h(Lua)e(programs)f(and)i(its)f(host)h(C)g(program.)72 +1188 y(It)e(also)f(presen)o(ts)j(some)d(examples)g(of)g(using)h(the)h +(main)c(features)k(of)f(the)g(system.)881 1404 y Fq(Sum\023)-24 +b(ario)72 1471 y Fp(Lua)15 b(\023)-20 b(e)18 b(uma)d(linguagem)f(de)j +(extens~)-21 b(ao)18 b(pro)r(jetada)f(para)f(ser)i(usada)f(como)e +(linguagem)g(de)i(con\014gura\030)-18 b(c~)d(ao)72 1521 +y(em)12 b(qualquer)g(programa)e(que)j(precise)h(de)f(uma.)j(Este)e(do)q +(cumen)o(to)d(descrev)o(e)k(a)d(v)o(ers~)-21 b(ao)13 +b(2.2)e(da)h(linguagem)72 1571 y(de)18 b(programa\030)-18 +b(c~)d(ao)16 b(Lua)i(e)g(a)g(In)o(terface)h(de)f(Programa\030)-18 +b(c~)d(ao)16 b(que)i(p)q(ermite)g(a)f(in)o(tera\030)-18 +b(c~)d(ao)18 b(en)o(tre)h(programas)72 1621 y(Lua)c(e)g(o)g(programa)e +(C)h(hosp)q(edeiro.)22 b(O)15 b(do)q(cumen)o(to)g(tam)o(b)o(\023)-20 +b(em)12 b(apresen)o(ta)k(alguns)e(exemplos)g(de)i(uso)f(das)72 +1671 y(principais)f(caracter)-5 b(\023)-16 b(\020sticas)15 +b(do)f(sistema.)-42 1814 y Fo(1)67 b(In)n(tro)r(duction)-42 +1915 y Fn(Lua)18 b(is)f(an)g(extension)g(programmi)o(ng)d(language)j +(designed)g(to)g(supp)q(ort)g(general)g(pro)q(cedural)g(programming)-42 +1972 y(features)k(with)f(data)g(description)g(facilities.)34 +b(It)21 b(is)f(supp)q(osed)i(to)e(b)q(e)h(used)h(as)e(a)g +(con\014guration)g(language)-42 2028 y(for)d(an)o(y)f(program)f(that)i +(needs)g(one.)26 b(Its)17 b(main)e(extensions)i(are)f(related)h(to)f +(ob)s(ject-orien)o(ted)g(facilities,)f(and)-42 2085 y(fallbac)o(ks,)g +(but)h(it)f(has)h(some)f(other)h(minor)e(con)o(tributions.)21 +b(Lua)16 b(has)g(b)q(een)h(designed)g(and)f(implemen)o(ted)e(b)o(y)-42 +2141 y(W.)h(Celes)g(F.,)f(L.)h(H.)g(de)h(Figueiredo)e(and)h(R.)h +(Ierusalimsc)o(h)o(y)l(.)29 2197 y(Lua)c(is)f(implemen)o(ted)f(as)h(a)g +(library)l(,)g(written)g(in)h(C.)f(Being)g(an)h(extension)g(language,)f +(Lua)h(has)f(no)h(notion)f(of)-42 2254 y(a)h(\\main")d(program:)16 +b(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 +(clien)o(t,)g(called)g(the)g Fm(emb)n(e)n(dding)f Fn(program.)17 +b(This)11 b(host)-42 2310 y(program)i(can)j(in)o(v)o(ok)o(e)e +(functions)h(to)f(execute)i(a)f(piece)g(of)g(co)q(de)g(in)g(Lua,)g(can) +h(write)e(and)h(read)g(Lua)h(v)m(ariables,)-42 2367 y(and)f(can)e +(register)g(C)h(functions)f(to)h(b)q(e)g(called)g(b)o(y)f(Lua)h(co)q +(de.)20 b(Through)14 b(the)g(use)g(of)g(C)f(functions,)h(Lua)g(can)g(b) +q(e)-42 2423 y(augmen)o(ted)d(to)h(cop)q(e)g(with)f(rather)h +(di\013eren)o(t)f(domains,)f(th)o(us)i(creating)f(customized)g +(programmi)o(ng)e(languages)-42 2480 y(sharing)15 b(a)g(syn)o(tactical) +e(framew)o(ork.)29 2536 y(Lua)f(is)e(free)i(distribution)e(soft)o(w)o +(are,)g(and)h(pro)o(vided)g(as)g(usual)g(with)g(no)g(guaran)o(tees.)18 +b(The)11 b(implemen)o(tatio)o(n)-42 2593 y(describ)q(ed)17 +b(in)e(this)f(man)o(ual)g(is)g(a)o(v)m(ailable)g(b)o(y)h(anon)o(ymous)f +(ftp)h(from)922 2748 y(1)p eop +%%Page: 2 2 +2 1 bop 30 199 a Fl(ftp.icad.puc-rio.br:/pub/lu)o(a/lua-2)o(.2.tar.)o +(gz)-42 293 y Fn(or)15 b(b)o(y)g(WWW)g(\(W)l(orld)f(Wide)h(W)l(eb\))g +(from)30 387 y Fl(http://www.inf.puc-rio.br/~)o(roberto)o(/lua.ht)o(ml) +-42 530 y Fo(2)67 b(En)n(vironmen)n(t)25 b(and)e(Mo)r(dules)-42 +632 y Fn(All)10 b(statemen)o(ts)e(in)i(Lua)h(are)f(executed)h(in)g(a)f +Fm(glob)n(al)h(envir)n(onment)p Fn(.)17 b(This)9 b(en)o(vironmen)o(t,)h +(whic)o(h)g(k)o(eeps)h(all)e(global)-42 688 y(v)m(ariables)14 +b(and)g(functions,)f(is)g(initialized)g(at)g(the)h(b)q(eginning)g(of)f +(the)h(em)o(b)q(edding)f(program)f(and)i(p)q(ersists)f(un)o(til)-42 +744 y(its)i(end.)29 801 y(The)g(global)d(en)o(vironmen)o(t)h(can)h(b)q +(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 +(edding)f(program,)e(whic)o(h)-42 857 y(can)k(read)f(and)g(write)g +(global)e(v)m(ariables)i(using)g(functions)g(in)g(the)g(library)f(that) +h(implemen)o(ts)d(Lua.)29 914 y(Global)g(v)m(ariables)h(do)h(not)f +(need)h(declaration.)k(An)o(y)c(v)m(ariable)f(is)g(assumed)g(to)g(b)q +(e)h(global)e(unless)i(explicitly)-42 970 y(declared)20 +b(lo)q(cal)e(\(see)h(lo)q(cal)f(declarations,)h(Section)g(4.4.5\).)30 +b(Before)19 b(the)g(\014rst)g(assignmen)o(t,)e(the)j(v)m(alue)f(of)g(a) +-42 1027 y(global)14 b(v)m(ariable)h(is)g Fk(nil)p Fn(.)29 +1083 y(The)g(unit)g(of)g(execution)h(of)e(Lua)i(is)f(called)f(a)h +Fm(chunk)p Fn(.)20 b(The)15 b(syn)o(tax)g(for)f(c)o(h)o(unks)i(is:)1480 +1067 y Fj(1)42 1155 y Fm(chunk)50 b Fi(!)g(f)p Fm(statement)32 +b 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 +(con)o(tain)h(statemen)o(ts)f(and)i(function)g(de\014nitions,)g(and)g +(ma)o(y)e(b)q(e)j(in)f(a)g(\014le)g(or)f(in)h(a)g(string)f(inside)-42 +1284 y(the)k(host)f(program.)22 b(When)17 b(a)g(c)o(h)o(unk)g(is)f +(executed,)h(\014rst)g(all)e(its)h(functions)g(and)h(statemen)o(ts)e +(are)h(compiled,)-42 1340 y(then)d(the)e(statemen)o(ts)f(are)i +(executed)g(in)g(sequen)o(tial)f(order.)18 b(All)11 b(mo)q +(di\014cations)f(a)i(c)o(h)o(unk)g(e\013ects)f(on)h(the)g(global)-42 +1397 y(en)o(vironmen)o(t)k(p)q(ersist)h(after)f(its)g(end.)27 +b(Those)17 b(include)g(mo)q(di\014cations)f(to)g(global)g(v)m(ariables) +g(and)i(de\014nitions)-42 1453 y(of)d(new)h(functions)285 +1437 y Fj(2)303 1453 y Fn(.)-42 1596 y Fo(3)67 b(T)n(yp)r(es)-42 +1698 y Fn(Lua)14 b(is)g(a)f(dynamically)f(t)o(yp)q(ed)i(language.)k(V)l +(ariables)13 b(do)h(not)f(ha)o(v)o(e)g(t)o(yp)q(es;)h(only)f(v)m(alues) +h(do.)19 b(All)13 b(v)m(alues)h(carry)-42 1754 y(their)h(o)o(wn)g(t)o +(yp)q(e.)20 b(Therefore,)15 b(there)g(are)g(no)g(t)o(yp)q(e)g +(de\014nitions)g(in)g(the)g(language.)29 1811 y(There)20 +b(are)f(sev)o(en)h(basic)f(t)o(yp)q(es)h(in)g(Lua:)29 +b Fm(nil)p Fn(,)19 b Fm(numb)n(er)p Fn(,)h Fm(string)p +Fn(,)g Fm(function)p Fn(,)g Fm(CF)m(unction)p Fn(,)e +Fm(user)n(data)p Fn(,)j(and)-42 1867 y Fm(table)p Fn(.)f +Fm(Nil)14 b Fn(is)g(the)g(t)o(yp)q(e)h(of)f(the)h(v)m(alue)g +Fk(nil)p Fn(,)e(whose)h(main)f(prop)q(ert)o(y)h(is)h(to)e(b)q(e)j +(di\013eren)o(t)d(from)g(an)o(y)h(other)h(v)m(alue.)-42 +1924 y Fm(Numb)n(er)h Fn(represen)o(ts)f(real)f(\(\015oating)g(p)q(oin) +o(t\))g(n)o(um)o(b)q(ers,)h(while)f Fm(string)h Fn(has)g(the)g(usual)g +(meaning.)29 1980 y(F)l(unctions)20 b(are)f(considered)i(\014rst-class) +e(v)m(alues)h(in)g(Lua.)34 b(This)19 b(means)g(that)h(functions)f(can)h +(b)q(e)h(stored)-42 2037 y(in)c(v)m(ariables,)g(passed)g(as)g(argumen)o +(ts)f(to)g(other)h(functions)g(and)g(returned)h(as)e(results.)26 +b(When)17 b(a)g(function)g(is)-42 2093 y(de\014ned)g(in)d(Lua,)h(its)f +(b)q(o)q(dy)i(is)e(compiled)f(and)i(stored)g(in)f(a)h(giv)o(en)f(v)m +(ariable.)19 b(Lua)c(can)g(call)f(\(and)h(manipulate\))-42 +2150 y(functions)g(written)g(in)g(Lua)g(and)h(functions)f(written)f(in) +h(C;)f(the)i(latter)e(ha)o(v)o(e)g(t)o(yp)q(e)i Fm(CF)m(unction)s +Fn(.)29 2206 y(The)i(t)o(yp)q(e)f Fm(user)n(data)h Fn(is)g(pro)o(vided) +f(to)g(allo)o(w)f(arbitrary)f(C)j(p)q(oin)o(ters)f(to)g(b)q(e)h(stored) +f(in)g(Lua)h(v)m(ariables.)26 b(It)-42 2262 y(corresp)q(onds)18 +b(to)f Fl(void*)f Fn(and)i(has)f(no)g(pre-de\014ned)j(op)q(erations)c +(in)h(Lua,)h(b)q(esides)g(assignmen)o(t)d(and)j(equalit)o(y)-42 +2319 y(test.)24 b(Ho)o(w)o(ev)o(er,)16 b(b)o(y)g(using)h(fallbac)o(ks,) +e(the)i(programmer)c(ma)o(y)i(de\014ne)j(op)q(erations)e(for)g +Fm(user)n(data)h Fn(v)m(alues;)g(see)-42 2375 y(Section)f(4.7.)29 +2432 y(The)c(t)o(yp)q(e)g Fm(table)g Fn(implemen)o(ts)d(asso)q(ciativ)o +(e)i(arra)o(ys,)g(that)g(is,)h(arra)o(ys)e(whic)o(h)i(can)g(b)q(e)h +(indexed)g(not)f(only)f(with)-42 2488 y(n)o(um)o(b)q(ers,)k(but)g(with) +g(an)o(y)g(v)m(alue)h(\(except)f Fk(nil)p Fn(\).)20 b(Therefore,)15 +b(this)f(t)o(yp)q(e)i(ma)o(y)e(b)q(e)i(used)g(not)f(only)g(to)f +(represen)o(t)p -42 2530 780 2 v 10 2557 a Fh(1)28 2573 +y Fg(As)e(usual,)i Ff(f)p Fe(a)s Ff(g)f Fg(means)h(0)f(or)g(more)g +Fe(a)s Fg('s,)f([)p Fe(a)s Fg(])f(means)j(an)f(optional)j +Fe(a)c Fg(and)i Ff(f)p Fe(a)s Ff(g)1179 2557 y Fh(+)1217 +2573 y Fg(means)f(one)h(or)f(more)g Fe(a)s Fg('s.)10 +2603 y Fh(2)28 2619 y Fg(Actually)m(,)h(a)f(function)h(de\014nition)i +(is)d(an)h(assignmen)o(t)h(to)d(a)h(global)j(v)n(ariable;)e(see)f +(Section)i(3.)922 2748 y Fn(2)p eop +%%Page: 3 3 +3 2 bop -42 199 a Fn(ordinary)15 b(arra)o(ys,)e(but)i(also)f(sym)o(b)q +(ol)g(tables,)g(sets,)g(records,)h(etc.)20 b(T)l(o)15 +b(represen)o(t)g(records,)f(Lua)i(uses)f(the)g(\014eld)-42 +256 y(name)k(as)f(an)h(index.)32 b(The)19 b(language)g(supp)q(orts)g +(this)f(represen)o(tation)g(b)o(y)i(pro)o(viding)e Fl(a.name)g +Fn(as)g(syn)o(tactic)-42 312 y(sugar)i(for)f Fl(a["name"])p +Fn(.)33 b(T)l(ables)20 b(ma)o(y)e(also)h(carry)g(metho)q(ds.)34 +b(Because)20 b(functions)g(are)g(\014rst)f(class)h(v)m(alues,)-42 +369 y(table)d(\014elds)g(ma)o(y)e(con)o(tain)g(functions.)25 +b(The)16 b(form)f Fl(t:f\(x\))h Fn(is)g(syn)o(tactic)g(sugar)g(for)g +Fl(t.f\(t,x\))p Fn(,)g(whic)o(h)g(calls)-42 425 y(the)g(metho)q(d)e +Fl(f)h Fn(from)f(the)h(table)g Fl(t)g Fn(passing)f(itself)g(as)h(the)g +(\014rst)g(parameter.)29 482 y(It)d(is)f(imp)q(ortan)o(t)e(to)i(notice) +g(that)g(tables)g(are)g(ob)s(jects,)g(and)h(not)f(v)m(alues.)19 +b(V)l(ariables)10 b(cannot)i(con)o(tain)e(tables,)-42 +538 y(only)15 b(references)g(to)f(them.)19 b(Assignmen)o(t,)12 +b(parameter)h(passing)i(and)f(returns)h(alw)o(a)o(ys)e(manipulate)g +(references)-42 594 y(to)k(tables,)f(and)i(do)f(not)f(imply)g(an)o(y)h +(kind)g(of)f(cop)o(y)l(.)26 b(Moreo)o(v)o(er,)16 b(tables)g(m)o(ust)f +(b)q(e)j(explicitly)e(created)h(b)q(efore)-42 651 y(used;)f(see)f +(Section)g(4.5.7.)-42 794 y Fo(4)67 b(The)23 b(Language)-42 +895 y Fn(This)15 b(section)g(describ)q(es)h(the)f(lexis,)f(syn)o(tax)h +(and)g(seman)o(tics)e(of)i(Lua.)-42 1017 y Fd(4.1)56 +b(Lexical)19 b(Con)n(v)n(en)n(tions)-42 1103 y Fn(Lua)g(is)e(a)g(case)h +(sensitiv)o(e)f(language.)27 b(Iden)o(ti\014ers)18 b(can)g(b)q(e)g(an)o +(y)f(string)g(of)g(letters,)h(digits,)e(and)i(underscores,)-42 +1159 y(not)d(b)q(eginning)h(with)e(a)h(digit.)k(The)c(follo)o(wing)e(w) +o(ords)i(are)f(reserv)o(ed,)h(and)h(cannot)f(b)q(e)h(used)f(as)g(iden)o +(ti\014ers:)173 1253 y Fl(and)143 b(do)191 b(else)142 +b(elseif)95 b(end)173 1309 y(function)23 b(if)191 b(local)118 +b(nil)167 b(not)173 1366 y(or)g(repeat)95 b(return)f(until)119 +b(then)95 b(while)29 1459 y Fn(The)15 b(follo)o(wing)e(strings)i +(denote)g(other)g(tok)o(ens:)173 1552 y Fl(~=)48 b(<=)f(>=)h(<)71 +b(>)h(==)47 b(=)71 b(..)48 b(+)71 b(-)h(*)f(/)173 1609 +y(\045)h(\()f(\))h({)f(})h([)f(])g(;)h(,)f(.)29 1702 +y Fn(Literal)17 b(strings)f(can)i(b)q(e)g(delimited)e(b)o(y)i(matc)o +(hing)d(single)i(or)g(double)h(quotes,)g(and)f(can)h(con)o(tain)f(the)h +(C-)-42 1758 y(lik)o(e)i(escap)q(e)i(sequences)g Fl('\\n')p +Fn(,)f Fl('\\t')f Fn(and)h Fl('\\r')p Fn(.)36 b(Literal)20 +b(strings)g(can)g(also)g(b)q(e)i(delimited)d(b)o(y)h(matc)o(hing)-42 +1815 y Fl([[)k(...)g(]])p Fn(.)18 b(Literals)12 b(in)h(this)f(last)g +(form)f(ma)o(y)h(run)h(for)f(sev)o(eral)g(lines,)h(ma)o(y)e(con)o(tain) +h(nested)i Fl([[)23 b(...)h(]])p Fn(,)12 b(and)-42 1871 +y(do)k(not)e(in)o(terpret)h(escap)q(e)h(sequences.)29 +1928 y(Commen)o(ts)c(start)h(an)o(ywhere)i(outside)g(a)f(string)g(with) +g(a)g(double)h(h)o(yphen)h(\()p Fl(--)p Fn(\))e(and)h(run)g(un)o(til)f +(the)g(end)i(of)-42 1984 y(the)g(line.)29 2041 y(Numerical)h(constan)o +(ts)g(ma)o(y)f(b)q(e)j(written)e(with)h(an)g(optional)e(decimal)h +(part,)h(and)g(an)g(optional)f(decimal)-42 2097 y(exp)q(onen)o(t.)k +(Examples)14 b(of)g(v)m(alid)h(n)o(umerical)f(constan)o(ts)g(are:)126 +2190 y Fl(4)119 b(4.)g(.4)g(4.57e-3)f(.3e12)-42 2312 +y Fd(4.2)56 b(Co)r(ercion)-42 2398 y Fn(Lua)19 b(pro)o(vides)f(some)f +(automatic)f(con)o(v)o(ersions.)29 b(An)o(y)19 b(arithmetic)d(op)q +(eration)i(applied)g(to)g(a)g(string)f(tries)h(to)-42 +2454 y(con)o(v)o(ert)d(that)f(string)g(to)h(a)f(n)o(um)o(b)q(er,)g +(follo)o(wing)f(the)i(usual)g(rules.)20 b(Con)o(v)o(ersely)l(,)14 +b(whenev)o(er)h(a)g(n)o(um)o(b)q(er)f(is)h(used)-42 2511 +y(when)h(a)f(string)f(is)h(exp)q(ected,)h(that)e(n)o(um)o(b)q(er)h(is)g +(con)o(v)o(erted)g(to)f(a)h(string,)f(according)h(to)f(the)h(follo)o +(wing)e(rule:)20 b(if)-42 2567 y(the)13 b(n)o(um)o(b)q(er)g(is)f(an)h +(in)o(teger,)f(it)g(is)g(written)g(without)g(exp)q(onen)o(t)h(or)f +(decimal)f(p)q(oin)o(t;)i(otherwise,)f(it)g(is)h(formatted)-42 +2623 y(follo)o(wing)g(the)j(\\)p Fl(\045g)p Fn(")e(con)o(v)o(ersion)g +(sp)q(eci\014cation)h(of)g(the)h(standard)e Fl(printf)h +Fn(C)g(function.)922 2748 y(3)p eop +%%Page: 4 4 +4 3 bop -42 199 a Fd(4.3)56 b(Adjustmen)n(t)-42 285 y +Fn(F)l(unctions)14 b(in)g(Lua)h(can)f(return)g(man)o(y)f(v)m(alues.)19 +b(Because)c(there)f(are)g(no)g(t)o(yp)q(e)h(declarations,)d(the)i +(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 +(alues)i(a)g(function)f(will)g(return,)g(or)h(ho)o(w)f(man)o(y)f +(parameters)g(it)h(needs.)28 b(Therefore,)-42 398 y(sometimes,)10 +b(a)i(list)g(of)g(v)m(alues)h(m)o(ust)e(b)q(e)i Fm(adjuste)n(d)5 +b Fn(,)13 b(at)f(run)g(time,)f(to)h(a)h(giv)o(en)f(length.)18 +b(If)13 b(there)g(are)f(more)f(v)m(alues)-42 454 y(than)17 +b(are)f(needed,)i(the)f(last)f(v)m(alues)h(are)f(thro)o(wn)g(a)o(w)o(a) +o(y)l(.)23 b(If)17 b(there)g(are)f(more)g(needs)h(than)g(v)m(alues,)g +(the)f(list)g(is)-42 511 y(extended)j(with)e(as)h(man)o(y)e +Fk(nil)p Fn('s)h(as)g(needed.)29 b(Adjustmen)o(t)17 b(o)q(ccurs)h(in)f +(m)o(ultiple)f(assignmen)o(t)g(and)i(function)-42 567 +y(calls.)-42 689 y Fd(4.4)56 b(Statemen)n(ts)-42 775 +y Fn(Lua)19 b(supp)q(orts)f(an)f(almost)f(con)o(v)o(en)o(tional)g(set)i +(of)f(statemen)o(ts.)26 b(The)18 b(con)o(v)o(en)o(tional)e(commands)f +(include)k(as-)-42 831 y(signmen)o(t,)d(con)o(trol)f(structures)i(and)g +(pro)q(cedure)h(calls.)24 b(Non-con)o(v)o(en)o(tional)16 +b(commands)e(include)k(table)e(con-)-42 888 y(structors,)e(explained)i +(in)f(Section)g(4.5.7,)e(and)i(lo)q(cal)g(v)m(ariable)f(declarations.) +-42 1008 y Fk(4.4.1)52 b(Blo)q(c)o(ks)-42 1094 y Fn(A)15 +b(blo)q(c)o(k)f(is)f(a)h(list)f(of)h(statemen)o(ts,)e(executed)j +(sequen)o(tially)l(.)k(An)o(y)14 b(statemen)o(t)e(can)j(b)q(e)g +(optionally)d(follo)o(w)o(ed)h(b)o(y)-42 1150 y(a)i(semicolon.)42 +1209 y Fm(blo)n(ck)49 b Fi(!)h(f)p Fm(stat)16 b(sc)s +Fi(g)g Fn([)p Fm(r)n(et)f(sc)s Fn(])98 1266 y Fm(sc)49 +b Fi(!)h Fn([';'])-42 1334 y(F)l(or)13 b(syn)o(tactic)f(reasons,)g(a)h +(return)g(statemen)o(t)e(can)i(only)g(b)q(e)g(written)f(as)h(the)g +(last)f(statemen)o(t)f(of)h(a)h(blo)q(c)o(k.)19 b(This)-42 +1391 y(restriction)14 b(also)g(a)o(v)o(oids)g(some)g(\\statemen)o(t)f +(not)i(reac)o(hed")g(errors.)-42 1511 y Fk(4.4.2)52 b(Assignmen)o(t)-42 +1597 y Fn(The)18 b(language)e(allo)o(ws)f(m)o(ultiple)g(assignmen)o(t.) +23 b(Therefore,)17 b(the)g(syn)o(tax)g(de\014nes)h(a)f(list)e(of)i(v)m +(ariables)f(on)h(the)-42 1653 y(left)h(side,)g(and)h(a)e(list)g(of)h +(expressions)g(on)g(the)g(righ)o(t)f(side.)29 b(Both)18 +b(lists)f(ha)o(v)o(e)g(their)h(elemen)o(ts)f(separated)h(b)o(y)-42 +1709 y(commas.)116 1769 y Fm(stat)50 b Fi(!)g Fm(varlist1)16 +b Fn('=')g Fm(explist1)42 1825 y(varlist1)50 b Fi(!)g +Fm(var)17 b Fi(f)p Fn(',')d Fm(var)5 b Fi(g)-42 1894 +y Fn(This)15 b(statemen)o(t)d(\014rst)i(ev)m(aluates)g(all)g(v)m(alues) +g(on)h(the)f(righ)o(t)g(side)g(and)h(ev)o(en)o(tual)f(indices)g(on)h +(the)f(left)g(side,)g(and)-42 1950 y(then)i(mak)o(es)e(the)h(assignmen) +o(ts.)j(Therefore,)c(it)h(can)g(b)q(e)h(used)g(to)e(exc)o(hange)i(t)o +(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 +2138 y Fn(Before)f(the)g(assignmen)o(t,)f(the)g(list)f(of)i(v)m(alues)f +(is)g Fm(adjuste)n(d)h Fn(to)f(the)h(length)f(of)g(the)h(list)e(of)h(v) +m(ariables;)j(see)-42 2194 y(Section)16 b(4.3.)42 2266 +y Fm(var)50 b Fi(!)g Fm(name)-42 2338 y Fn(A)16 b(single)e(name)g(can)i +(denote)f(a)g(global)f(or)h(a)g(lo)q(cal)f(v)m(ariable,)g(or)h(a)g +(formal)d(parameter.)42 2410 y Fm(var)50 b Fi(!)g Fm(var)17 +b Fn('[')e Fm(exp1)i Fn(']')-42 2483 y(Square)j(brac)o(k)o(ets)f(are)h +(used)g(to)f(index)h(a)f(table.)33 b(If)20 b Fl(var)f +Fn(results)g(in)g(a)h(table)f(v)m(alue,)h(the)g(\014eld)g(indexed)h(b)o +(y)-42 2539 y(the)c(expression)f(v)m(alue)h(gets)f(the)h(assigned)f(v)m +(alue.)24 b(Otherwise,)16 b(the)h(fallbac)o(k)e Fm(settable)h +Fn(is)g(called,)g(with)f(three)922 2748 y(4)p eop +%%Page: 5 5 +5 4 bop -42 199 a Fn(parameters:)31 b(the)22 b(v)m(alue)f(of)g +Fl(var)p Fn(,)h(the)g(v)m(alue)g(of)f(expression,)h(and)g(the)f(v)m +(alue)h(b)q(eing)g(assigned)f(to)g(it;)i(see)-42 256 +y(Section)16 b(4.7.)42 328 y Fm(var)50 b Fi(!)g Fm(var)17 +b Fn('.')j Fm(name)-42 400 y Fn(The)c(syn)o(tax)e Fl(var.NAME)g +Fn(is)h(just)g(syn)o(tactic)f(sugar)h(for)f Fl(var["NAME"])p +Fn(.)-42 520 y Fk(4.4.3)52 b(Con)o(trol)17 b(Structures)-42 +606 y Fn(The)k(condition)e(expression)h(of)f(a)h(con)o(trol)e +(structure)i(can)g(return)g(an)o(y)g(v)m(alue.)34 b(All)19 +b(v)m(alues)h(di\013eren)o(t)f(from)-42 662 y Fk(nil)f +Fn(are)g(considered)g(true,)h(while)f Fk(nil)f Fn(is)h(considered)h +(false.)28 b Fl(if)p Fn('s,)18 b Fl(while)p Fn('s)f(and)h +Fl(repeat)p Fn('s)f(ha)o(v)o(e)h(the)h(usual)-42 719 +y(meaning.)70 787 y Fm(stat)50 b Fi(!)g Fk(while)15 b +Fm(exp1)i Fk(do)f Fm(blo)n(ck)g Fk(end)245 843 y Fi(j)32 +b Fk(rep)q(eat)17 b Fm(blo)n(ck)f Fk(un)o(til)f Fm(exp1)245 +900 y Fi(j)32 b Fk(if)16 b Fm(exp1)h Fk(then)g Fm(blo)n(ck)e +Fi(f)p Fm(elseif)8 b Fi(g)16 b Fn([)p Fk(else)f Fm(blo)n(ck)5 +b Fn(])15 b Fk(end)42 956 y Fm(elseif)49 b Fi(!)h Fk(elseif)15 +b Fm(exp1)i Fk(then)f Fm(blo)n(ck)29 1049 y Fn(A)g Fl(return)g +Fn(is)g(used)g(to)g(return)g(v)m(alues)h(from)d(a)i(function.)23 +b(Because)17 b(a)f(function)g(ma)o(y)f(return)h(more)f(than)-42 +1106 y(one)h(v)m(alue,)f(the)g(syn)o(tax)g(for)f(a)h(return)g(statemen) +o(t)e(is:)42 1178 y Fm(r)n(et)50 b Fi(!)g Fk(return)16 +b Fm(explist)-42 1370 y Fk(4.4.4)52 b(Expressions)16 +b(as)h(Statemen)o(ts)-42 1456 y Fn(All)h(expressions)h(with)f(p)q +(ossible)g(side-e\013ects)h(can)f(b)q(e)i(executed)f(as)g(statemen)o +(ts.)28 b(These)19 b(include)g(function)-42 1512 y(calls)c(and)g(table) +g(constructors:)42 1572 y Fm(stat)50 b Fi(!)g Fm(functionc)n(al)r(l)42 +1628 y(stat)g Fi(!)g Fm(table)n(c)n(onstructor)-42 1697 +y Fn(Ev)o(en)o(tual)14 b(returned)h(v)m(alues)g(are)g(thro)o(wn)f(a)o +(w)o(a)o(y)l(.)k(F)l(unction)c(calls)g(are)h(explained)f(in)h(Section)f +(4.5.8;)f(construc-)-42 1753 y(tors)i(are)g(the)g(sub)s(ject)g(of)g +(Section)g(4.5.7.)-42 1873 y Fk(4.4.5)52 b(Lo)q(cal)19 +b(Declarations)-42 1959 y Fn(Lo)q(cal)e(v)m(ariables)e(can)h(b)q(e)h +(declared)f(an)o(ywhere)g(inside)g(a)g(blo)q(c)o(k.)22 +b(Their)16 b(scop)q(e)h(b)q(egins)f(after)f(the)i(declaration)-42 +2015 y(and)f(lasts)e(un)o(til)g(the)i(end)f(of)g(the)g(blo)q(c)o(k.)20 +b(The)15 b(declaration)f(ma)o(y)g(include)i(an)f(initial)e(assignmen)o +(t:)92 2083 y Fm(stat)50 b Fi(!)g Fk(lo)q(cal)17 b Fm(de)n(clist)e +Fn([)p Fm(init)t Fn(])42 2140 y Fm(de)n(clist)49 b Fi(!)h +Fm(name)16 b Fi(f)p Fn(',')f Fm(name)s Fi(g)96 2196 y +Fm(init)49 b Fi(!)h Fn('=')16 b Fm(explist1)-42 2265 +y Fn(If)f(there)f(is)f(an)h(initial)e(assignmen)o(t,)g(it)h(has)h(the)g +(same)f(seman)o(tics)f(of)h(a)h(m)o(ultiple)e(assignmen)o(t.)17 +b(Otherwise,)d(all)-42 2321 y(v)m(ariables)h(are)g(initialized)e(with)i +Fk(nil)p Fn(.)-42 2443 y Fd(4.5)56 b(Expressions)-42 +2529 y Fk(4.5.1)c(Simple)15 b(Expressions)-42 2614 y +Fn(Simple)f(expressions)h(are:)922 2748 y(5)p eop +%%Page: 6 6 +6 5 bop 42 193 a Fm(exp)50 b Fi(!)g Fn('\(')16 b Fm(exp)g +Fn('\)')42 250 y Fm(exp)50 b Fi(!)g Fk(nil)42 306 y Fm(exp)g +Fi(!)g Fn('n)o(um)o(b)q(er')42 362 y Fm(exp)g Fi(!)g +Fn('literal')42 419 y Fm(exp)g Fi(!)g Fm(var)-42 490 +y Fn(Num)o(b)q(ers)22 b(\(n)o(umerical)f(constan)o(ts\))g(and)i(string) +f(literals)f(are)h(explained)h(in)f(Section)h(4.1.)41 +b(V)l(ariables)22 b(are)-42 546 y(explained)16 b(in)f(Section)g(4.4.2.) +-42 665 y Fk(4.5.2)52 b(Arithmetic)15 b(Op)q(erators)-42 +751 y Fn(Lua)21 b(supp)q(orts)g(the)g(usual)f(arithmetic)e(op)q +(erators.)35 b(These)21 b(op)q(erators)f(are)g(the)g(binary)h +Fl(+)p Fn(,)g Fl(-)p Fn(,)g Fl(*)p Fn(,)h Fl(/)e Fn(and)h +Fl(^)-42 808 y Fn(\(exp)q(onen)o(tiation\),)15 b(and)h(the)g(unary)g +Fl(-)p Fn(.)22 b(If)16 b(the)g(op)q(erands)g(are)g(n)o(um)o(b)q(ers,)f +(or)g(strings)g(that)g(can)h(b)q(e)h(con)o(v)o(erted)-42 +864 y(to)d(n)o(um)o(b)q(ers,)g(according)g(to)g(the)g(rules)g(giv)o(en) +g(in)h(Section)f(4.2,)f(all)h(op)q(erations)f(but)i(exp)q(onen)o +(tiation)e(ha)o(v)o(e)h(the)-42 920 y(usual)f(meaning.)18 +b(Otherwise,)13 b(the)g(fallbac)o(k)f(\\arith")g(is)g(called;)h(see)g +(Section)g(4.7.)19 b(An)13 b(exp)q(onen)o(tiation)f(alw)o(a)o(ys)-42 +977 y(calls)k(this)f(fallbac)o(k.)22 b(The)16 b(standard)g +(mathematical)c(library)j(rede\014nes)j(this)d(fallbac)o(k,)g(giving)g +(the)h(exp)q(ected)-42 1033 y(meaning)e(to)h(exp)q(onen)o(tiation;)f +(see)h(Section)g(6.3.)-42 1152 y Fk(4.5.3)52 b(Relational)18 +b(Op)q(erators)-42 1238 y Fn(Lua)e(o\013ers)e(the)i(follo)o(wing)d +(relational)g(op)q(erators:)126 1327 y Fl(<)71 b(>)g(<=)48 +b(>=)f(~=)h(==)-42 1415 y Fn(All)15 b(return)g Fk(nil)f +Fn(as)h(false)g(and)g(1)g(as)g(true.)29 1472 y(Equalit)o(y)g(\014rst)h +(compares)f(the)i(t)o(yp)q(es)f(of)h(its)e(op)q(erands.)24 +b(If)17 b(they)g(are)f(di\013eren)o(t,)g(the)g(result)g(is)g +Fk(nil)p Fn(.)23 b(Oth-)-42 1528 y(erwise,)18 b(their)f(v)m(alues)h +(are)g(compared.)26 b(Num)o(b)q(ers)17 b(and)h(strings)f(are)h +(compared)e(in)i(the)g(usual)f(w)o(a)o(y)l(.)27 b(T)l(ables,)-42 +1585 y(CF)l(unctions,)14 b(and)g(functions)g(are)g(compared)f(b)o(y)h +(reference,)h(that)e(is,)h(t)o(w)o(o)e(tables)i(are)g(considered)g +(equal)g(only)-42 1641 y(if)h(they)g(are)g(the)h(same)d(table.)20 +b(The)15 b(op)q(erator)g Fl(~=)f Fn(is)h(exactly)g(the)g(negation)f(of) +h(equalit)o(y)f(\()p Fl(=)p Fn(\).)29 1698 y(The)19 b(other)g(op)q +(erators)f(w)o(ork)g(as)g(follo)o(ws.)29 b(If)19 b(b)q(oth)g(argumen)o +(ts)e(are)i(n)o(um)o(b)q(ers,)f(they)h(are)g(compared)f(as)-42 +1754 y(suc)o(h.)27 b(Otherwise,)17 b(if)g(b)q(oth)g(argumen)o(ts)f(can) +h(b)q(e)h(con)o(v)o(erted)f(to)g(strings,)f(their)h(v)m(alues)g(are)g +(compared)g(using)-42 1811 y(lexicographical)d(order.)20 +b(Otherwise,)14 b(the)i(fallbac)o(k)d(\\order")i(is)g(called;)f(see)h +(Section)h(4.7.)-42 1930 y Fk(4.5.4)52 b(Logical)18 b(Op)q(erators)-42 +2016 y Fn(All)f(logical)f(op)q(erators,)g(lik)o(e)h(con)o(trol)f +(structures,)h(consider)g Fk(nil)g Fn(as)g(false)g(and)g(an)o(ything)g +(else)g(as)g(true.)26 b(The)-42 2072 y(logical)14 b(op)q(erators)g +(are:)269 2161 y Fl(and)71 b(or)g(not)-42 2249 y Fn(The)17 +b(op)q(erators)f Fl(and)g Fn(and)h Fl(or)f Fn(use)h(short-cut)f(ev)m +(aluation,)g(that)g(is,)g(the)h(second)g(op)q(erand)g(is)f(ev)m +(aluated)h(only)-42 2306 y(if)e(necessary)l(.)-42 2425 +y Fk(4.5.5)52 b(Concatenation)-42 2511 y Fn(Lua)18 b(o\013ers)d(a)i +(string)f(concatenation)g(op)q(erator,)f(denoted)j(b)o(y)e(\\)p +Fl(..)p Fn(".)24 b(If)17 b(op)q(erands)g(are)g(strings)e(or)i(n)o(um)o +(b)q(ers,)-42 2567 y(they)c(are)g(con)o(v)o(erted)f(to)g(strings)g +(according)g(to)g(the)h(rules)f(in)h(Section)f(4.2.)18 +b(Otherwise,)13 b(the)g(fallbac)o(k)e(\\concat")-42 2623 +y(is)k(called;)g(see)g(Section)g(4.7.)922 2748 y(6)p +eop +%%Page: 7 7 +7 6 bop -42 199 a Fk(4.5.6)52 b(Precedence)-42 285 y +Fn(Op)q(erator)15 b(precedence)i(follo)o(ws)d(the)h(table)g(b)q(elo)o +(w,)f(from)f(the)j(lo)o(w)o(er)d(to)i(the)g(higher)g(priorit)o(y:)269 +379 y Fl(and)71 b(or)269 435 y(<)g(>)h(<=)47 b(>=)h(~=)f(=)269 +492 y(..)269 548 y(+)71 b(-)269 605 y(*)g(/)269 661 y(not)47 +b(-)24 b(\(unary\))269 718 y(^)-42 811 y Fn(All)15 b(binary)g(op)q +(erators)f(are)h(left)f(asso)q(ciativ)o(e,)g(except)h(for)g +Fl(^)p Fn(,)g(whic)o(h)g(is)f(righ)o(t)g(asso)q(ciativ)o(e.)-42 +931 y Fk(4.5.7)52 b(T)l(able)18 b(Constructors)-42 1017 +y Fn(T)l(able)d(constructors)f(are)h(expressions)g(that)f(create)h +(tables;)f(ev)o(ery)h(time)e(a)i(constructor)f(is)h(ev)m(aluated,)g(a)f +(new)-42 1074 y(table)f(is)g(created.)19 b(Constructors)12 +b(can)h(b)q(e)h(used)g(to)e(create)h(empt)o(y)f(tables,)g(or)h(to)g +(create)g(a)f(table)h(and)g(initialize)-42 1130 y(some)h(\014elds.)29 +1187 y(The)h(general)g(syn)o(tax)g(for)f(constructors)h(is:)42 +1255 y Fm(table)n(c)n(onstructor)49 b Fi(!)i Fn(')p Fi(f)p +Fn(')15 b Fm(\014eld)r(list)g Fn(')p Fi(g)p Fn(')212 +1311 y Fm(\014eld)r(list)48 b Fi(!)j Fm(l\014eld)r(list)31 +b Fi(j)16 b Fm(\016eld)r(list)31 b Fi(j)16 b Fm(l\014eld)r(list)f +Fn(';')g Fm(\016eld)r(list)200 1368 y(l\014eld)r(list)48 +b Fi(!)j Fn([)p Fm(l\014eld)r(list1)6 b Fn(])197 1424 +y Fm(\016eld)r(list)49 b Fi(!)i Fn([)p Fm(\016eld)r(list1)6 +b Fn(])29 1517 y(The)15 b(form)f Fm(l\014eld)r(list1)g +Fn(is)h(used)g(to)g(initialize)e(lists.)42 1589 y Fm(l\014eld)r(list1) +49 b Fi(!)h Fm(exp)16 b Fi(f)p Fn(',')f Fm(exp)s Fi(g)h +Fn([','])-42 1662 y(The)i(expressions)f(in)g(the)g(list)f(are)h +(assigned)g(to)g(consecutiv)o(e)g(n)o(umerical)f(indexes,)h(starting)f +(with)h(1.)25 b(As)18 b(an)-42 1718 y(example:)30 1812 +y Fl(a)24 b(=)g({"v1",)f("v2",)g(34})-42 1906 y Fn(is)15 +b(equiv)m(alen)o(t)g(to:)30 2000 y Fl(temp)23 b(=)h({})30 +2056 y(temp[1])f(=)h("v1")30 2112 y(temp[2])f(=)h("v2")30 +2169 y(temp[3])f(=)h(34)30 2225 y(a)g(=)g(temp)29 2319 +y Fn(The)15 b(next)h(form)d(initializes)g(named)i(\014elds)g(in)g(a)g +(table.)42 2378 y Fm(\016eld)r(list1)50 b Fi(!)g Fm(\016eld)16 +b Fi(f)p Fn(',')f Fm(\016eld)5 b Fi(g)15 b Fn([','])127 +2435 y Fm(\016eld)50 b Fi(!)g Fm(name)16 b Fn('=')g Fm(exp)-42 +2503 y Fn(As)g(an)f(example:)30 2597 y Fl(a)24 b(=)g({x)f(=)h(1,)f(y)h +(=)g(3})922 2748 y Fn(7)p eop +%%Page: 8 8 +8 7 bop -42 199 a Fn(is)15 b(equiv)m(alen)o(t)g(to:)30 +293 y Fl(temp)23 b(=)h({})30 350 y(temp.x)f(=)h(1)30 +406 y(temp.y)f(=)h(3)30 462 y(a)g(=)g(temp)-42 582 y +Fk(4.5.8)52 b(F)l(unction)18 b(Calls)-42 668 y Fn(A)e(function)f(call)f +(has)h(the)g(follo)o(wing)e(syn)o(tax:)42 740 y Fm(functionc)n(al)r(l) +49 b Fi(!)h Fm(var)17 b(r)n(e)n(alPar)n(ams)-42 813 y +Fn(Here,)i Fl(var)e Fn(can)h(b)q(e)h(an)o(y)e(v)m(ariable)h(\(global,)e +(lo)q(cal,)i(indexed,)g(etc\).)28 b(If)18 b(its)f(t)o(yp)q(e)h(is)g +Fm(function)j Fn(or)c Fm(CF)m(unction)s Fn(,)-42 869 +y(this)g(function)g(is)f(called.)25 b(Otherwise,)17 b(the)g(fallbac)o +(k)f(\\function")g(is)h(called,)g(ha)o(ving)f(as)g(\014rst)h(parameter) +e(the)-42 925 y(v)m(alue)h(of)f Fl(var)p Fn(,)f(and)h(then)h(the)f +(original)f(call)g(parameters.)29 982 y(The)h(form:)42 +1054 y Fm(functionc)n(al)r(l)49 b Fi(!)h Fm(var)17 b +Fn(':')j Fm(name)c(r)n(e)n(alPar)n(ams)-42 1126 y Fn(can)g(b)q(e)g +(used)f(to)g(call)f(\\metho)q(ds".)19 b(A)c(call)f Fl(var:name\(...\))g +Fn(is)g(syn)o(tactic)h(sugar)f(for)6 1220 y Fl(var.name\(var,)22 +b(...\))-42 1314 y Fn(except)16 b(that)f Fl(var)f Fn(is)h(ev)m(aluated) +g(only)g(once.)42 1382 y Fm(r)n(e)n(alPar)n(ams)49 b +Fi(!)h Fn('\(')16 b([)p Fm(explist1)6 b Fn(])15 b('\)')42 +1438 y Fm(r)n(e)n(alPar)n(ams)49 b Fi(!)h Fm(table)n(c)n(onstructor)115 +1495 y(explist1)f Fi(!)h Fm(exp1)17 b Fi(f)p Fn(',')e +Fm(exp1)6 b Fi(g)-42 1563 y Fn(All)18 b(argumen)o(t)e(expressions)i +(are)g(ev)m(aluated)g(b)q(efore)g(the)h(call;)f(then)g(the)g(list)f(of) +h(argumen)o(ts)e(is)i(adjusted)g(to)-42 1620 y(the)j(length)f(of)f(the) +h(list)f(of)h(parameters)e(\(see)j(Section)f(4.3\);)h(\014nally)l(,)f +(this)g(list)f(is)g(assigned)h(to)g(the)g(formal)-42 +1676 y(parameters.)g(A)15 b(call)g(of)g(the)h(form)e +Fl(f{...})h Fn(is)g(syn)o(tactic)f(sugar)h(for)g Fl(f\({...}\))p +Fn(,)f(that)h(is,)g(the)h(parameter)e(list)-42 1732 y(is)h(a)g(single)g +(new)g(table.)29 1789 y(Because)h(a)f(function)h(can)g(return)f(an)o(y) +g(n)o(um)o(b)q(er)g(of)g(results)g(\(see)h(Section)f(4.4.3\),)e(the)j +(n)o(um)o(b)q(er)f(of)g(results)-42 1845 y(m)o(ust)c(b)q(e)i(adjusted)f +(b)q(efore)h(used.)19 b(If)13 b(the)f(function)g(is)g(called)f(as)h(an) +g(statemen)o(t)e(\(see)j(Section)f(4.4.4\),)e(its)h(return)-42 +1902 y(list)18 b(is)h(adjusted)g(to)g(0.)31 b(If)20 b(the)f(function)g +(is)g(called)g(in)g(a)g(place)g(that)f(needs)i(a)f(single)f(v)m(alue)i +(\(syn)o(tactically)-42 1958 y(denoted)f(b)o(y)f(the)g(non-terminal)e +Fl(exp1)p Fn(\),)h(its)g(return)h(list)f(is)g(adjusted)h(to)g(1.)27 +b(If)18 b(the)g(function)g(is)g(called)f(in)h(a)-42 2015 +y(place)f(that)g(can)g(hold)g(man)o(y)e(v)m(alues)i(\(syn)o(tactically) +e(denoted)j(b)o(y)f(the)g(non-terminal)e Fl(exp)p Fn(\),)h(no)h +(adjustmen)o(t)-42 2071 y(is)e(done.)-42 2193 y Fd(4.6)56 +b(F)-5 b(unction)20 b(De\014nitions)-42 2279 y Fn(F)l(unctions)15 +b(in)f(Lua)g(can)h(b)q(e)g(de\014ned)h(an)o(ywhere)e(in)g(the)g(global) +f(lev)o(el)h(of)g(a)g(mo)q(dule.)19 b(The)14 b(syn)o(tax)g(for)g +(function)-42 2335 y(de\014nition)i(is:)42 2407 y Fm(function)50 +b Fi(!)g Fk(function)16 b Fm(var)h Fn('\(')e([)p Fm(p)n(arlist1)6 +b Fn(])16 b('\)')f Fm(blo)n(ck)g Fk(end)29 2536 y Fn(When)f(Lua)g +(pre-compiles)f(a)g(c)o(h)o(unk,)h(all)f(its)f(function)i(b)q(o)q(dies) +g(are)f(pre-compiled,)g(to)q(o.)19 b(Then,)14 b(when)g(Lua)-42 +2592 y(\\executes")i(the)f(function)g(de\014nition,)g(its)f(b)q(o)q(dy) +i(is)f(stored,)f(with)h(t)o(yp)q(e)g Fm(function)p Fn(,)f(in)o(to)g +(the)i(v)m(ariable)e Fl(var)p Fn(.)922 2748 y(8)p eop +%%Page: 9 9 +9 8 bop 29 199 a Fn(P)o(arameters)13 b(act)i(as)f(lo)q(cal)h(v)m +(ariables,)f(initialized)f(with)i(the)g(argumen)o(t)f(v)m(alues.)42 +271 y Fm(p)n(arlist1)50 b Fi(!)g Fm('name')16 b Fi(f)p +Fn(',')f Fm(name)s Fi(g)29 400 y Fn(Results)g(are)f(returned)h(using)f +(the)h Fl(return)f Fn(statemen)o(t)e(\(see)j(Section)f(4.4.3\).)k(If)d +(con)o(trol)e(reac)o(hes)i(the)g(end)-42 456 y(of)g(a)g(function)g +(without)f(a)h(return)g(instruction,)f(the)h(function)g(returns)h(with) +e(no)h(results.)29 513 y(There)22 b(is)f(a)g(sp)q(ecial)g(syn)o(tax)g +(for)g(de\014nition)h(of)f(metho)q(ds,)h(that)e(is,)j(functions)e(whic) +o(h)g(ha)o(v)o(e)h(an)f(extra)-42 569 y(parameter)14 +b Fm(self)p Fn(.)42 641 y Fm(function)50 b Fi(!)g Fk(function)16 +b Fm(var)h Fn(':')j Fm(name)c Fn('\(')f([)p Fm(p)n(arlist1)6 +b Fn(])16 b('\)')f Fm(blo)n(ck)g Fk(end)-42 714 y Fn(A)h(declaration)e +(lik)o(e)-42 807 y Fl(function)23 b(v:f)h(\(...\))6 864 +y(...)-42 920 y(end)-42 1014 y Fn(is)15 b(equiv)m(alen)o(t)g(to)-42 +1108 y Fl(function)23 b(v.f)h(\(self,)f(...\))6 1164 +y(...)-42 1221 y(end)-42 1315 y Fn(that)16 b(is,)g(the)g(function)g +(gets)g(an)g(extra)f(formal)f(parameter)h(called)h Fl(self)p +Fn(.)22 b(Notice)16 b(that)f(the)h(v)m(ariable)g Fl(v)g +Fn(m)o(ust)-42 1371 y(b)q(e)g(previously)f(initialized)f(with)g(a)h +(table)g(v)m(alue.)-42 1493 y Fd(4.7)56 b(F)-5 b(allbac)n(ks)-42 +1579 y Fn(Lua)17 b(pro)o(vides)f(a)g(p)q(o)o(w)o(erful)g(mec)o(hanism)e +(to)h(extend)i(its)f(seman)o(tics,)e(called)i Fm(fal)r(lb)n(acks)p +Fn(.)23 b(Basically)l(,)15 b(a)h(fallbac)o(k)-42 1635 +y(is)f(a)g(programmer)d(de\014ned)17 b(function)e(whic)o(h)g(is)f +(called)h(whenev)o(er)h(Lua)f(do)q(es)h(not)f(kno)o(w)f(ho)o(w)h(to)g +(pro)q(ceed.)29 1691 y(Lua)h(supp)q(orts)f(the)g(follo)o(wing)e +(fallbac)o(ks,)h(iden)o(ti\014ed)h(b)o(y)g(the)g(giv)o(en)g(strings:) +-42 1785 y Fk(\\arith")24 b Fn(called)17 b(when)g(an)h(arithmetic)c(op) +q(eration)j(is)g(applied)g(to)f(non)i(n)o(umerical)d(op)q(erands,)j(or) +f(when)g(the)72 1842 y(binary)f Fl(^)g Fn(op)q(eration)g(is)f(called.) +23 b(It)17 b(receiv)o(es)f(three)g(argumen)o(ts:)k(the)d(t)o(w)o(o)e +(op)q(erands)h(\(the)g(second)h(one)72 1898 y(is)j(nil)g(when)h(the)g +(op)q(eration)e(is)h(unary)h(min)o(us\))e(and)h(one)h(of)f(the)g(follo) +o(wing)f(strings)g(describing)h(the)72 1955 y(o\013ended)c(op)q +(erator:)120 2067 y Fl(add)47 b(sub)g(mul)h(div)f(pow)g(unm)72 +2180 y Fn(Its)15 b(return)f(v)m(alue)h(is)f(the)h(\014nal)f(result)g +(of)g(the)h(arithmetic)d(op)q(eration.)19 b(The)c(default)f(function)g +(issues)h(an)72 2236 y(error.)-42 2330 y Fk(\\order")23 +b Fn(called)15 b(when)h(an)g(order)f(comparison)e(is)i(applied)h(to)f +(non)g(n)o(umerical)f(or)h(non)h(string)e(op)q(erands.)21 +b(It)72 2386 y(receiv)o(es)d(three)g(argumen)o(ts:)23 +b(the)18 b(t)o(w)o(o)f(op)q(erands)h(and)g(one)g(of)f(the)h(follo)o +(wing)e(strings)h(describing)g(the)72 2443 y(o\013ended)f(op)q(erator:) +120 2555 y Fl(lt)23 b(gt)h(le)g(ge)922 2748 y Fn(9)p +eop +%%Page: 10 10 +10 9 bop 72 199 a Fn(Its)17 b(return)h(v)m(alue)f(is)g(the)g(\014nal)g +(result)g(of)g(the)g(comparison)f(op)q(eration.)25 b(The)18 +b(default)e(function)i(issues)72 256 y(an)d(error.)-42 +350 y Fk(\\concat")25 b Fn(called)d(when)g(a)f(concatenation)f(is)h +(applied)h(to)f(non)h(string)e(op)q(erands.)39 b(It)22 +b(receiv)o(es)f(the)h(t)o(w)o(o)72 406 y(op)q(erands)d(as)f(argumen)o +(ts.)29 b(Its)18 b(return)h(v)m(alue)g(is)f(the)g(\014nal)h(result)f +(of)g(the)h(concatenation)f(op)q(eration.)72 462 y(The)e(default)e +(function)h(issues)g(an)h(error.)-42 556 y Fk(\\index")23 +b Fn(called)14 b(when)i(Lua)f(tries)f(to)g(retriev)o(e)g(the)h(v)m +(alue)g(of)f(an)h(index)g(not)f(presen)o(t)h(in)f(a)h(table.)k(It)c +(receiv)o(es)72 613 y(as)20 b(argumen)o(ts)e(the)i(table)g(and)g(the)g +(index.)35 b(Its)20 b(return)g(v)m(alue)g(is)f(the)h(\014nal)g(result)g +(of)f(the)i(indexing)72 669 y(op)q(eration.)e(The)d(default)e(function) +h(returns)h(nil.)-42 763 y Fk(\\gettable")25 b Fn(called)17 +b(when)i(Lua)g(tries)e(to)g(index)i(a)f(non)g(table)g(v)m(alue.)29 +b(It)18 b(receiv)o(es)g(as)g(argumen)o(ts)e(the)i(non)72 +819 y(table)d(v)m(alue)h(and)g(the)g(index.)22 b(Its)15 +b(return)h(v)m(alue)g(is)f(the)h(\014nal)g(result)f(of)g(the)h +(indexing)g(op)q(eration.)k(The)72 876 y(default)15 b(function)g +(issues)g(an)g(error.)-42 970 y Fk(\\settable")24 b Fn(called)18 +b(when)g(Lua)g(tries)f(to)h(assign)f(indexed)h(a)g(non)g(table)f(v)m +(alue.)28 b(It)18 b(receiv)o(es)g(as)f(argumen)o(ts)72 +1026 y(the)e(non)h(table)e(v)m(alue,)h(the)h(index,)f(and)g(the)h +(assigned)e(v)m(alue.)20 b(The)c(default)f(function)g(issues)g(an)g +(error.)-42 1120 y Fk(\\function")24 b Fn(called)16 b(when)h(Lua)g +(tries)f(to)g(call)f(a)h(non)h(function)f(v)m(alue.)24 +b(It)17 b(receiv)o(es)f(as)g(argumen)o(ts)f(the)h(non)72 +1176 y(function)i(v)m(alue)h(and)g(the)f(argumen)o(ts)f(giv)o(en)h(in)g +(the)h(original)d(call.)29 b(Its)19 b(return)f(v)m(alues)h(are)f(the)h +(\014nal)72 1233 y(results)c(of)f(the)i(call)e(op)q(eration.)19 +b(The)d(default)e(function)h(issues)g(an)h(error.)-42 +1327 y Fk(\\gc")24 b Fn(called)12 b(during)g(garbage)e(collection.)18 +b(It)12 b(receiv)o(es)g(as)f(argumen)o(t)f(the)i(table)f(b)q(eing)h +(collected.)19 b(After)11 b(eac)o(h)72 1383 y(run)16 +b(of)f(the)g(collector)f(this)h(function)g(is)g(called)g(with)g +(argumen)o(t)f(nil.)20 b(Because)c(this)e(function)i(op)q(erates)72 +1440 y(during)i(garbage)g(collection,)f(it)h(m)o(ust)f(b)q(e)i(used)g +(with)f(great)f(care,)i(and)f(programmers)d(should)k(a)o(v)o(oid)72 +1496 y(the)g(creation)g(of)g(new)g(ob)s(jects)g(\(tables)f(or)h +(strings\))e(in)i(this)g(function.)32 b(The)19 b(default)g(function)g +(do)q(es)72 1553 y(nothing.)-42 1646 y Fk(\\error")k +Fn(called)16 b(when)i(an)f(error)f(o)q(ccurs.)26 b(It)17 +b(receiv)o(es)g(as)g(argumen)o(t)e(a)i(string)f(describing)h(the)g +(error.)25 b(The)72 1703 y(default)15 b(function)g(prin)o(ts)f(the)i +(message)d(on)j(the)f(standard)g(error)f(output.)29 1797 +y(The)19 b(function)f Fl(setfallback)f Fn(is)g(used)i(to)f(c)o(hange)g +(a)g(fallbac)o(k)f(action.)29 b(Its)18 b(\014rst)g(argumen)o(t)f(is)g +(a)h(string)-42 1853 y(describing)f(the)g(fallbac)o(k,)e(and)i(the)f +(second)i(the)e(new)h(function)g(to)f(b)q(e)h(called.)24 +b(It)16 b(returns)h(the)f(old)h(function)-42 1910 y(for)e(the)g(giv)o +(en)g(fallbac)o(k.)29 1966 y(Section)g(7.4)f(sho)o(ws)h(an)g(example)f +(of)h(the)g(use)h(of)e(fallbac)o(ks.)-42 2088 y Fd(4.8)56 +b(Error)18 b(Handling)-42 2173 y Fn(Because)c(Lua)g(is)e(an)h +(extension)g(language,)f(all)g(Lua)i(actions)e(start)g(from)f(C)i(co)q +(de)h(calling)d(a)i(function)g(from)e(the)-42 2230 y(Lua)j(library)l(.) +k(Whenev)o(er)13 b(an)g(error)f(o)q(ccurs)i(during)f(Lua)g(compilation) +d(or)j(execution,)g(an)g(error)f(fallbac)o(k)g(func-)-42 +2286 y(tion)k(is)g(called,)f(and)i(then)f(the)g(corresp)q(onding)h +(function)f(from)e(the)i(library)f(\()p Fl(lua_dofile)p +Fn(,)g Fl(lua_dostring)p Fn(,)-42 2343 y Fl(lua_call)p +Fn(,)f(and)i Fl(lua_callfunction)p Fn(\))c(is)j(terminated)e(returning) +i(an)g(error)g(condition.)29 2399 y(The)21 b(only)g(argumen)o(t)e(to)h +(the)h(error)g(fallbac)o(k)e(function)i(is)g(a)f(string)g(describing)h +(the)g(error)g(and)g(some)-42 2456 y(extra)c(informations,)d(lik)o(e)h +(curren)o(t)i(line)g(\(when)g(the)f(error)h(is)f(at)g(compilation\))e +(or)i(curren)o(t)h(function)f(\(when)-42 2512 y(the)g(error)f(is)g(at)g +(execution\).)21 b(F)l(or)15 b(more)f(information)e(ab)q(out)k(an)f +(error,)g(the)g(Lua)h(program)e(can)h(include)h(the)-42 +2569 y(compilation)10 b(pragma)h Fl($debug)p Fn(.)18 +b(This)12 b(pragma)f(m)o(ust)f(b)q(e)k(written)d(in)h(a)h(line)f(b)o(y) +g(itself.)18 b(When)13 b(an)f(error)g(o)q(ccurs)911 2748 +y(10)p eop +%%Page: 11 11 +11 10 bop -42 199 a Fn(in)15 b(a)g(program)e(compiled)h(with)h(this)f +(option,)g(the)i(error)e(message)g(includes)h(extra)g(information)d +(sho)o(wing)i(the)-42 256 y(stac)o(k)h(of)g(calls.)29 +312 y(The)g(standard)f(error)g(routine)g(only)g(prin)o(ts)g(the)g +(error)g(message)f(to)h Fl(stderr)p Fn(.)19 b(If)14 b(needed,)i(it)e +(is)g(p)q(ossible)g(to)-42 369 y(c)o(hange)i(the)f(error)g(fallbac)o(k) +e(routine;)i(see)g(Section)g(4.7.)29 425 y(Lua)e(co)q(de)g(can)f +(generate)g(an)g(error)g(b)o(y)g(calling)f(the)i(function)f +Fl(error)p Fn(.)18 b(Its)13 b(optional)d(parameter)h(is)h(a)g(string,) +-42 482 y(whic)o(h)k(is)e(used)i(as)f(the)g(error)g(message.)-42 +624 y Fo(5)67 b(The)23 b(Application)h(Program)f(In)n(terface)-42 +725 y Fn(This)13 b(section)g(describ)q(es)h(the)f(API)g(for)g(Lua,)h +(that)e(is,)h(the)g(set)g(of)f(C)h(functions)g(a)o(v)m(ailable)f(to)h +(the)g(host)g(program)-42 782 y(to)i(comm)o(unicate)e(with)h(the)h +(library)l(.)k(The)d(API)f(functions)g(can)h(b)q(e)f(classi\014ed)g(in) +g(the)h(follo)o(wing)d(categories:)14 869 y(1.)22 b(executing)15 +b(Lua)h(co)q(de;)14 961 y(2.)22 b(con)o(v)o(erting)14 +b(v)m(alues)i(b)q(et)o(w)o(een)f(C)g(and)g(Lua;)14 1052 +y(3.)22 b(manipulating)13 b(\(reading)h(and)i(writing\))d(Lua)j(ob)s +(jects;)14 1144 y(4.)22 b(calling)14 b(Lua)i(functions;)14 +1235 y(5.)22 b(C)15 b(functions)g(to)g(b)q(e)g(called)g(b)o(y)g(Lua;)14 +1326 y(6.)22 b(lo)q(c)o(king)14 b(Lua)i(Ob)s(jects.)-42 +1414 y(All)f(API)h(functions)f(are)f(declared)i(in)f(the)g(\014le)g +Fl(lua.h)p Fn(.)-42 1535 y Fd(5.1)56 b(Executing)18 b(Lua)h(Co)r(de)-42 +1621 y Fn(A)i(host)g(program)d(can)j(execute)h(Lua)f(programs)d +(written)i(in)h(a)f(\014le)h(or)f(in)h(a)g(string,)f(using)h(the)g +(follo)o(wing)-42 1677 y(functions:)-42 1765 y Fl(int)286 +b(lua_dofile)357 b(\(char)23 b(*filename\);)-42 1821 +y(int)286 b(lua_dostring)309 b(\(char)23 b(*string\);)-42 +1909 y Fn(Both)15 b(functions)f(return)g(an)g(error)f(co)q(de:)20 +b(0,)14 b(in)g(case)g(of)g(success;)h(non)f(zero,)g(in)g(case)h(of)e +(errors.)19 b(The)c(function)-42 1965 y Fl(lua_dofile)p +Fn(,)f(if)h(called)f(with)h(argumen)o(t)e(NULL)j(\(0\),)e(executes)i +(the)f(\\\014le")g Fl(stdin)p Fn(.)-42 2086 y Fd(5.2)56 +b(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 +(Lua)-42 2172 y Fn(Because)13 b(Lua)g(has)f(no)g(static)f(t)o(yp)q(e)h +(system,)f(all)h(v)m(alues)g(passed)g(b)q(et)o(w)o(een)h(Lua)f(and)h(C) +f(ha)o(v)o(e)g(t)o(yp)q(e)g Fl(lua)p 1739 2172 15 2 v +17 w(Object)p Fn(,)-42 2228 y(whic)o(h)k(w)o(orks)e(lik)o(e)g(an)h +(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) +m(alue.)29 2285 y(Lua)11 b(has)f(automatic)e(memory)f(managemen)o(t,)i +(and)h(garbage)g(collection.)17 b(Because)11 b(of)f(that,)g(a)g +Fl(lua_Object)-42 2341 y Fn(has)18 b(a)f(limited)e(scop)q(e,)j(and)g +(is)f(only)g(v)m(alid)g(inside)g(the)h Fm(blo)n(ck)j +Fn(where)d(it)f(w)o(as)f(created.)27 b(A)17 b(C)h(function)f(called)-42 +2398 y(from)c(Lua)i(is)f(a)h(blo)q(c)o(k,)f(and)h(its)e(parameters)g +(are)h(v)m(alid)h(only)f(un)o(til)g(its)f(end.)21 b(A)14 +b(go)q(o)q(d)h(programmi)o(ng)d(practice)-42 2454 y(is)i(to)f(con)o(v)o +(ert)g(Lua)h(ob)s(jects)f(to)g(C)h(v)m(alues)g(as)f(so)q(on)h(as)f +(they)h(are)g(a)o(v)m(ailable,)e(and)i(nev)o(er)g(to)f(store)g +Fl(lua_Object)p Fn(s)-42 2511 y(in)j(C)e(global)g(v)m(ariables.)29 +2567 y(When)f(C)g(co)q(de)h(calls)e(Lua)h(rep)q(eatedly)l(,)g(as)g(in)g +(a)f(lo)q(op,)h(ob)s(jects)f(returned)i(b)o(y)f(these)g(calls)f(accum)o +(ulate,)f(and)-42 2623 y(ma)o(y)j(create)h(a)g(memory)d(problem.)19 +b(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 +(de\014ned)g(with)f(the)g(functions:)911 2748 y(11)p +eop +%%Page: 12 12 +12 11 bop -42 199 a Fl(void)262 b(lua_beginblock)f(\(void\);)-42 +256 y(void)h(lua_endblock)309 b(\(void\);)-42 350 y Fn(After)15 +b(the)h(end)f(of)g(the)g(blo)q(c)o(k,)g(all)f Fl(lua_Object)p +Fn('s)g(created)h(inside)g(it)f(are)h(released.)29 406 +y(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 +Fn(,)e(the)i(follo)o(wing)e(function)i(is)g(a)o(v)m(ailable:)-42 +500 y Fl(int)286 b(lua_type)405 b(\(lua_Object)22 b(object\);)-42 +594 y Fn(plus)16 b(the)f(follo)o(wing)e(macros:)-42 687 +y Fl(int)286 b(lua_isnil)381 b(\(lua_Object)22 b(object\);)-42 +744 y(int)286 b(lua_isnumber)309 b(\(lua_Object)22 b(object\);)-42 +800 y(int)286 b(lua_isstring)309 b(\(lua_Object)22 b(object\);)-42 +857 y(int)286 b(lua_istable)333 b(\(lua_Object)22 b(object\);)-42 +913 y(int)286 b(lua_iscfunction)237 b(\(lua_Object)22 +b(object\);)-42 970 y(int)286 b(lua_isuserdata)261 b(\(lua_Object)22 +b(object\);)-42 1064 y Fn(All)15 b(macros)e(return)j(1)e(if)h(the)g(ob) +s(ject)g(has)g(the)g(giv)o(en)g(t)o(yp)q(e,)g(and)g(0)g(otherwise.)29 +1120 y(The)20 b(function)g Fl(lua_type)f Fn(can)h(b)q(e)h(used)f(to)g +(distinguish)f(b)q(et)o(w)o(een)h(di\013eren)o(t)f(kinds)h(of)g(user)g +(data;)h(see)-42 1176 y(b)q(elo)o(w.)29 1233 y(T)l(o)15 +b(translate)f(a)h(v)m(alue)g(from)f(t)o(yp)q(e)h Fl(lua_Object)f +Fn(to)g(a)h(sp)q(eci\014c)h(C)f(t)o(yp)q(e,)g(the)g(programmer)d(can)k +(use:)-42 1327 y Fl(double)214 b(lua_getnumber)285 b(\(lua_Object)22 +b(object\);)-42 1383 y(char)239 b(*lua_getstring)284 +b(\(lua_Object)22 b(object\);)-42 1440 y(lua_CFunction)46 +b(lua_getcfunction)213 b(\(lua_Object)22 b(object\);)-42 +1496 y(void)239 b(*lua_getuserdata)d(\(lua_Object)22 +b(object\);)-42 1590 y(lua_getnumber)14 b Fn(con)o(v)o(erts)g(a)g +Fl(lua_Object)g Fn(to)g(a)h(\015oat.)k(This)c Fl(lua_Object)e +Fn(m)o(ust)h(b)q(e)h(a)g(n)o(um)o(b)q(er)f(or)h(a)f(string)-42 +1646 y(con)o(v)o(ertible)h(to)f(n)o(um)o(b)q(er)h(\(see)g(Section)g +(4.2\);)f(otherwise,)g(the)h(function)g(returns)g(0.)29 +1703 y Fl(lua_getstring)c Fn(con)o(v)o(erts)g(a)h Fl(lua_Object)f +Fn(to)h(a)g(string)g(\()p Fl(char)23 b(*)p Fn(\).)18 +b(This)12 b Fl(lua_Object)f Fn(m)o(ust)g(b)q(e)i(a)f(string)-42 +1759 y(or)k(a)f(n)o(um)o(b)q(er;)h(otherwise,)e(the)i(function)g +(returns)g(0)f(\(the)h(n)o(ull)f(p)q(oin)o(ter\).)21 +b(This)16 b(function)f(do)q(es)i(not)e(create)h(a)-42 +1816 y(new)f(string,)d(but)i(returns)g(a)f(p)q(oin)o(ter)g(to)h(a)f +(string)g(inside)g(the)h(Lua)g(en)o(vironmen)o(t.)k(Because)d(Lua)f +(has)f(garbage)-42 1872 y(collection,)h(there)h(is)g(no)g(guaran)o(tee) +g(that)f(suc)o(h)i(p)q(oin)o(ter)e(will)g(b)q(e)i(v)m(alid)f(after)f +(the)i(blo)q(c)o(k)f(ends.)29 1929 y Fl(lua_getcfunction)f +Fn(con)o(v)o(erts)h(a)h Fl(lua_Object)f Fn(to)g(a)h(C)g(function.)23 +b(This)15 b Fl(lua_Object)g Fn(m)o(ust)g(ha)o(v)o(e)g(t)o(yp)q(e)-42 +1985 y Fm(CF)m(unction)s Fn(;)j(otherwise,)f(the)h(function)g(returns)g +(0)f(\(the)h(n)o(ull)f(p)q(oin)o(ter\).)27 b(The)18 b(t)o(yp)q(e)g +Fl(lua_CFunction)e Fn(is)h(ex-)-42 2042 y(plained)f(in)f(Section)g +(5.5.)29 2098 y Fl(lua_getuserdata)10 b Fn(con)o(v)o(erts)i(a)g +Fl(lua_Object)e Fn(to)i Fl(void*)p Fn(.)18 b(This)12 +b Fl(lua_Object)f Fn(m)o(ust)g(ha)o(v)o(e)h(t)o(yp)q(e)g +Fm(user)n(data)s Fn(;)-42 2154 y(otherwise,)j(the)g(function)g(returns) +g(0)g(\(the)g(n)o(ull)f(p)q(oin)o(ter\).)29 2211 y(The)j(rev)o(erse)g +(pro)q(cess,)h(that)e(is,)h(passing)f(a)h(sp)q(eci\014c)h(C)f(v)m(alue) +g(to)g(Lua,)h(is)e(done)i(b)o(y)f(using)g(the)g(follo)o(wing)-42 +2267 y(functions:)-42 2361 y Fl(void)262 b(lua_pushnumber)f(\(double)23 +b(n\);)-42 2418 y(void)262 b(lua_pushstring)f(\(char)23 +b(*s\);)-42 2474 y(void)262 b(lua_pushliteral)237 b(\(char)23 +b(*s\);)-42 2531 y(void)262 b(lua_pushcfunction)189 b(\(lua_CFunction) +22 b(f\);)-42 2587 y(void)262 b(lua_pushusertag)237 b(\(void)23 +b(*u,)h(int)f(tag\);)911 2748 y Fn(12)p eop +%%Page: 13 13 +13 12 bop -42 199 a Fn(plus)16 b(the)f(macro:)-42 293 +y Fl(void)262 b(lua_pushuserdata)213 b(\(void)23 b(*u\);)-42 +387 y Fn(All)17 b(of)f(them)g(receiv)o(e)h(a)f(C)h(v)m(alue,)g(con)o(v) +o(ert)f(it)h(to)f(a)g(corresp)q(onden)o(t)i Fl(lua_Object)p +Fn(,)d(and)i(lea)o(v)o(e)f(the)h(result)g(on)-42 443 +y(the)h(top)g(of)f(the)h(Lua)g(stac)o(k,)f(where)h(it)f(can)h(b)q(e)h +(assigned)e(to)g(a)h(Lua)g(v)m(ariable,)f(passed)h(as)g(paramen)o(ter)e +(to)h(a)-42 500 y(Lua)f(function,)g(etc)f(\(see)h(b)q(elo)o(w\).)21 +b Fl(lua_pushliteral)13 b Fn(is)i(lik)o(e)g Fl(lua_pushstring)p +Fn(,)f(but)h(also)g(puts)h(the)f(string)-42 556 y(in)h(the)g(Lua)g +(literal)e(table.)21 b(This)15 b(a)o(v)o(oids)g(the)h(string)e(to)h(b)q +(e)i(garbage)e(collected,)g(and)h(therefore)f(has)h(a)f(b)q(etter)-42 +613 y(o)o(v)o(erall)e(p)q(erformance.)19 b(As)14 b(a)h(rule,)f(when)h +(the)f(string)g(to)g(b)q(e)h(pushed)g(is)f(a)h(literal,)d +Fl(lua_pushliteral)g Fn(should)-42 669 y(b)q(e)k(used.)29 +726 y(User)10 b(data)g(can)h(ha)o(v)o(e)e(di\013eren)o(t)h(tags,)g +(whose)g(seman)o(tics)f(are)h(de\014ned)h(b)o(y)g(the)f(host)g +(program.)16 b(An)o(y)10 b(p)q(ositiv)o(e)-42 782 y(in)o(teger)15 +b(can)h(b)q(e)h(used)f(to)g(tag)e(a)i(user)g(data.)21 +b(When)16 b(a)g(user)g(data)f(is)g(retriev)o(ed,)g(the)h(function)g +Fl(lua_type)e Fn(can)-42 839 y(b)q(e)i(used)g(to)f(get)f(its)h(tag.)29 +895 y(T)l(o)g(complete)f(the)h(set,)g(the)g(v)m(alue)g +Fk(nil)g Fn(or)f(a)h Fl(lua_Object)f Fn(can)h(also)g(b)q(e)g(pushed)i +(on)o(to)d(the)h(stac)o(k,)f(with:)-42 989 y Fl(void)262 +b(lua_pushnil)333 b(\(void\);)-42 1045 y(void)262 b(lua_pushobject)f +(\(lua_Object)22 b(object\);)-42 1167 y Fd(5.3)56 b(Manipulating)22 +b(Lua)c(Ob)s(jects)-42 1253 y Fn(T)l(o)d(read)h(the)f(v)m(alue)g(of)g +(an)o(y)g(global)f(Lua)h(v)m(ariable,)f(one)i(can)f(use)h(the)f +(function:)-42 1347 y Fl(lua_Object)118 b(lua_getglobal)285 +b(\(char)23 b(*varname\);)-42 1440 y Fn(T)l(o)15 b(store)g(a)g(v)m +(alue)g(previously)g(pushed)h(on)o(to)e(the)i(stac)o(k)e(in)h(a)g +(global)f(v)m(ariable,)g(there)h(is)g(the)g(function:)-42 +1534 y Fl(void)262 b(lua_storeglobal)237 b(\(char)23 +b(*varname\);)29 1628 y Fn(T)l(ables)15 b(can)g(also)f(b)q(e)i +(manipulated)e(via)g(the)i(API.)f(The)g(function)-42 +1722 y Fl(lua_Object)118 b(lua_getsubscript)213 b(\(void\);)-42 +1816 y Fn(exp)q(ects)16 b(on)f(the)h(stac)o(k)e(a)h(table)f(and)i(an)f +(index,)g(and)g(returns)g(the)g(con)o(ten)o(ts)g(of)g(the)g(table)f(at) +h(that)f(index.)20 b(As)-42 1872 y(in)15 b(Lua,)g(if)g(the)g(\014rst)f +(ob)s(ject)h(is)f(not)h(a)f(table,)g(or)h(the)g(index)g(is)g(not)f +(presen)o(t)h(in)g(the)g(table,)f(the)h(corresp)q(onden)o(t)-42 +1929 y(fallbac)o(k)f(is)h(called.)29 1985 y(F)l(or)g(compatibilit)n(y)d +(with)j(previous)g(v)o(ersions)f(of)h(the)g(API,)g(the)h(follo)o(wing)d +(macros)g(are)i(supp)q(orted:)-42 2079 y Fl(lua_Object)118 +b(lua_getindexed)261 b(\(lua_Object)22 b(table,)h(float)h(index\);)-42 +2135 y(lua_Object)118 b(lua_getfield)309 b(\(lua_Object)22 +b(table,)h(char)h(*field\);)-42 2229 y Fn(The)16 b(\014rst)f(one)g(is)g +(used)h(for)e(n)o(umeric)g(indices,)h(while)g(the)g(second)h(can)f(b)q +(e)h(used)g(for)e(an)o(y)h(string)f(index.)29 2286 y(T)l(o)i(store)g(a) +g(v)m(alue)h(in)f(an)h(index,)g(the)f(program)e(m)o(ust)h(push)j(on)o +(to)d(the)i(stac)o(k)e(the)i(table,)f(the)h(index,)f(and)-42 +2342 y(the)g(v)m(alue,)f(and)g(then)h(call)e(the)h(function:)-42 +2436 y Fl(void)24 b(lua_storesubscript)d(\(void\);)-42 +2530 y Fn(Again,)15 b(the)g(corresp)q(onden)o(t)g(fallbac)o(k)f(is)h +(called)g(if)f(needed.)29 2586 y(Finally)l(,)g(the)h(function)911 +2748 y(13)p eop +%%Page: 14 14 +14 13 bop -42 199 a Fl(lua_Object)118 b(lua_createtable)237 +b(\(void\);)-42 293 y Fn(creates)15 b(a)g(new)h(table.)29 +349 y Fm(Ple)n(ase)22 b(Notic)n(e:)36 b Fn(Most)22 b(functions)g(from)e +(the)j(Lua)f(library)f(receiv)o(e)i(parameters)d(through)i(the)h(stac)o +(k.)-42 406 y(Because)c(other)e(functions)g(also)g(use)h(the)g(stac)o +(k,)f(it)g(is)g(imp)q(ortan)o(t)e(that)i(these)h(parameters)e(b)q(e)i +(pushed)h(just)-42 462 y(b)q(efore)d(the)f(corresp)q(onden)o(t)g(call,) +f(without)g(in)o(termediate)e(calls)i(to)h(the)g(Lua)g(library)l(.)k(F) +l(or)14 b(instance,)h(supp)q(ose)-42 519 y(the)h(user)f(w)o(an)o(ts)f +(the)h(v)m(alue)h(of)f Fl(a[i])p Fn(.)k(A)c(simplistic)e(solution)h(w)o +(ould)g(b)q(e:)6 613 y Fl(/*)24 b(Warning:)f(WRONG)g(CODE)g(*/)6 +669 y(lua_Object)g(result;)6 725 y(lua_pushobject\(lua_getglobal)o +(\("a"\)\);)44 b(/*)24 b(push)f(table)g(*/)6 782 y +(lua_pushobject\(lua_getglobal)o(\("i"\)\);)44 b(/*)24 +b(push)f(index)g(*/)6 838 y(result)g(=)h(lua_getsubscript\(\);)-42 +932 y Fn(Ho)o(w)o(ev)o(er,)c(the)f(call)g Fl(lua_getglobal\("i"\))e +Fn(mo)q(di\014es)i(the)h(stac)o(k,)f(and)h(in)o(v)m(alidates)e(the)i +(previous)f(pushed)-42 989 y(v)m(alue.)i(A)15 b(correct)g(solution)f +(could)h(b)q(e:)6 1082 y Fl(lua_Object)23 b(result;)6 +1139 y(lua_Object)g(index)g(=)h(lua_getglobal\("i"\);)6 +1195 y(lua_pushobject\(lua_getglobal)o(\("a"\)\);)44 +b(/*)24 b(push)f(table)g(*/)6 1252 y(lua_pushobject\(index\);)355 +b(/*)24 b(push)f(index)g(*/)6 1308 y(result)g(=)h +(lua_getsubscript\(\);)-42 1430 y Fd(5.4)56 b(Calling)21 +b(Lua)e(F)-5 b(unctions)-42 1516 y Fn(F)l(unctions)19 +b(de\014ned)g(in)g(Lua)f(b)o(y)h(a)f(c)o(h)o(unk)g(executed)i(with)e +Fl(dofile)f Fn(or)h Fl(dostring)f Fn(can)i(b)q(e)g(called)f(from)e(the) +-42 1572 y(host)h(program.)23 b(This)16 b(is)g(done)h(using)g(the)g +(follo)o(wing)e(proto)q(col:)22 b(\014rst,)16 b(the)h(argumen)o(ts)e +(to)h(the)h(function)g(are)-42 1629 y(pushed)f(on)o(to)d(the)i(Lua)g +(stac)o(k)e(\(see)i(Section)f(5.2\),)f(in)h(direct)g(order,)g(i.e.,)g +(the)g(\014rst)g(argumen)o(t)f(is)h(pushed)h(\014rst.)-42 +1685 y(Again,)g(it)f(is)h(imp)q(ortan)o(t)e(to)h(emphasize)h(that,)f +(during)h(this)f(phase,)i(no)f(other)g(Lua)g(function)g(can)g(b)q(e)h +(called.)29 1741 y(Then,)f(the)h(function)f(is)f(called)h(using)-42 +1835 y Fl(int)286 b(lua_call)405 b(\(char)23 b(*functionname\);)-42 +1929 y Fn(or)-42 2023 y Fl(int)286 b(lua_callfunction)213 +b(\(lua_Object)22 b(function\);)-42 2116 y Fn(Both)16 +b(functions)g(return)f(an)h(error)f(co)q(de:)22 b(0,)15 +b(in)h(case)g(of)f(success;)i(non)f(zero,)f(in)h(case)g(of)f(errors.)21 +b(Finally)l(,)14 b(the)-42 2173 y(returned)i(v)m(alues)f(\(a)g(Lua)h +(function)f(ma)o(y)e(return)i(man)o(y)f(v)m(alues\))h(can)g(b)q(e)h +(retriev)o(ed)f(with)f(the)i(macro)-42 2267 y Fl(lua_Object)118 +b(lua_getresult)309 b(\(int)23 b(number\);)-42 2360 y +Fn(where)18 b Fl(number)d Fn(is)i(the)g(order)f(of)h(the)g(result,)f +(starting)f(with)h(1.)25 b(When)17 b(called)f(with)g(a)h(n)o(um)o(b)q +(er)f(larger)g(than)-42 2417 y(the)g(actual)e(n)o(um)o(b)q(er)h(of)f +(results,)h(this)f(function)h(returns)g Fl(LUA_NOOBJECT)p +Fn(.)29 2473 y(Tw)o(o)j(sp)q(ecial)g(Lua)g(functions)h(ha)o(v)o(e)e +(exclusiv)o(e)i(in)o(terfaces:)25 b Fl(error)18 b Fn(and)g +Fl(setfallback)p Fn(.)28 b(A)18 b(C)h(function)-42 2530 +y(can)d(generate)f(a)g(Lua)g(error)g(calling)f(the)h(function)-42 +2623 y Fl(void)24 b(lua_error)e(\(char)i(*message\);)911 +2748 y Fn(14)p eop +%%Page: 15 15 +15 14 bop -42 199 a Fn(This)18 b(function)g(nev)o(er)g(returns.)28 +b(If)18 b(the)g(C)f(function)h(has)g(b)q(een)h(called)f(from)e(Lua,)i +(the)g(corresp)q(onding)g(Lua)-42 256 y(execution)f(terminates,)d(as)i +(if)g(an)g(error)f(had)i(o)q(ccurred)g(inside)f(Lua)h(co)q(de.)23 +b(Otherwise,)16 b(the)h(whole)f(program)-42 312 y(terminates.)29 +369 y(F)l(allbac)o(ks)e(can)h(b)q(e)h(c)o(hanged)g(with:)-42 +460 y Fl(lua_Object)23 b(lua_setfallback)f(\(char)h(*name,)g +(lua_CFunction)f(fallback\);)-42 552 y Fn(The)12 b(\014rst)f(parameter) +f(is)g(the)i(fallbac)o(k)e(name,)h(and)g(the)h(second)f(a)h(CF)l +(unction)f(to)f(b)q(e)i(used)g(as)f(the)h(new)f(fallbac)o(k.)-42 +608 y(This)k(function)g(returns)g(a)g Fl(lua_Object)p +Fn(,)f(whic)o(h)h(is)g(the)g(old)g(fallbac)o(k)f(v)m(alue,)h(or)g(nil)f +(on)h(fail)g(\(in)o(v)m(alid)f(fallbac)o(k)-42 665 y(name\).)19 +b(This)c(old)g(v)m(alue)g(can)g(b)q(e)h(used)g(for)f(c)o(haining)f +(fallbac)o(ks.)29 721 y(An)i(example)e(of)g(C)h(co)q(de)h(calling)e(a)h +(Lua)g(function)h(is)e(sho)o(wn)h(in)g(Section)g(7.6.)-42 +842 y Fd(5.5)56 b(C)19 b(F)-5 b(unctions)-42 928 y Fn(T)l(o)15 +b(register)g(a)f(C)h(function)g(to)g(Lua,)g(there)g(is)g(the)g(follo)o +(wing)e(macro:)-42 1020 y Fl(#define)23 b(lua_register\(n,f\))165 +b(\(lua_pushcfunction\(f\),)21 b(lua_storeglobal\(n\)\))-42 +1076 y(/*)j(char)f(*n;)215 b(*/)-42 1133 y(/*)24 b(lua_CFunction)e(f;)i +(*/)-42 1224 y Fn(whic)o(h)15 b(receiv)o(es)g(the)f(name)g(the)h +(function)f(will)g(ha)o(v)o(e)g(in)g(Lua,)h(and)g(a)f(p)q(oin)o(ter)g +(to)g(the)h(function.)20 b(This)14 b(p)q(oin)o(ter)-42 +1281 y(m)o(ust)g(ha)o(v)o(e)h(t)o(yp)q(e)g Fl(lua_CFunction)p +Fn(,)e(whic)o(h)i(is)g(de\014ned)i(as)-42 1372 y Fl(typedef)23 +b(void)h(\(*lua_CFunction\))d(\(void\);)-42 1464 y Fn(that)15 +b(is,)f(a)h(p)q(oin)o(ter)g(to)f(a)h(function)g(with)g(no)g(parameters) +e(and)j(no)f(results.)29 1521 y(In)g(order)e(to)h(comm)o(unicate)d +(prop)q(erly)j(with)f(Lua,)h(a)f(C)h(function)g(m)o(ust)e(follo)o(w)g +(a)i(proto)q(col,)f(whic)o(h)g(de\014nes)-42 1577 y(the)j(w)o(a)o(y)e +(parameters)f(and)j(results)e(are)h(passed.)29 1633 y(T)l(o)g(access)g +(its)g(argumen)o(ts,)e(a)i(C)g(function)g(calls:)-42 +1725 y Fl(lua_Object)118 b(lua_getparam)309 b(\(int)23 +b(number\);)-42 1817 y Fn(where)16 b Fl(number)e Fn(starts)g(with)h(1)g +(to)f(get)h(the)h(\014rst)e(argumen)o(t.)19 b(When)c(called)g(with)g(a) +g(n)o(um)o(b)q(er)f(larger)g(than)h(the)-42 1873 y(actual)e(n)o(um)o(b) +q(er)f(of)g(argumen)o(ts,)f(this)i(function)f(returns)h +Fl(LUA)p 1029 1873 15 2 v 17 w(NOOBJECT)p Fn(.)e(In)j(this)e(w)o(a)o(y) +l(,)g(it)g(is)h(p)q(ossible)f(to)g(write)-42 1930 y(functions)j(that)g +(w)o(ork)f(with)h(a)g(v)m(ariable)f(n)o(um)o(b)q(er)h(of)f(parameters.) +29 1986 y(T)l(o)g(return)g(v)m(alues,)g(a)g(C)g(function)g(just)f +(pushes)i(them)e(on)o(to)g(the)i(stac)o(k,)e(in)h(direct)g(order;)f +(see)i(Section)f(5.2.)-42 2042 y(Lik)o(e)i(a)e(Lua)i(function,)f(a)g(C) +g(function)g(called)f(b)o(y)h(Lua)h(can)f(also)g(return)g(man)o(y)e +(results.)29 2099 y(Section)i(7.5)f(presen)o(ts)i(an)f(example)f(of)g +(a)h(CF)l(unction.)-42 2220 y Fd(5.6)56 b(Lo)r(c)n(king)19 +b(Lua)f(Ob)s(jects)-42 2306 y Fn(As)h(already)g(noted,)g +Fl(lua_Object)p Fn(s)f(are)h(v)o(olatile.)29 b(If)19 +b(the)g(C)g(co)q(de)h(needs)g(to)e(k)o(eep)h(a)g Fl(lua_Object)f +Fn(outside)-42 2363 y(blo)q(c)o(k)d(b)q(oundaries,)h(it)e(has)h(to)g +Fm(lo)n(ck)f Fn(the)h(ob)s(ject.)20 b(The)15 b(routines)g(to)f +(manipulate)g(lo)q(c)o(king)g(are)h(the)g(follo)o(wing:)-42 +2454 y Fl(int)191 b(lua_lock)23 b(\(void\);)-42 2511 +y(lua_Object)g(lua_getlocked)46 b(\(int)23 b(ref\);)-42 +2567 y(void)167 b(lua_pushlocked)22 b(\(int)h(ref\);)-42 +2623 y(void)167 b(lua_unlock)22 b(\(int)i(ref\);)911 +2748 y Fn(15)p eop +%%Page: 16 16 +16 15 bop -42 199 a Fn(The)18 b(function)e Fl(lua_lock)g +Fn(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) +h(the)g(stac)o(k,)f(and)h(returns)f(a)h(reference)-42 +256 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 +(needed,)i(a)e(call)g(to)g Fl(lua_getlocked)f Fn(returns)i(a)f(handle)h +(to)f(it,)g(while)-42 312 y Fl(lua_pushlocked)f Fn(pushes)i(the)f +(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 +(ject)g(is)f(no)h(longer)g(needed,)h(it)e(can)-42 369 +y(b)q(e)j(unlo)q(c)o(k)o(ed)g(with)e(a)h(call)f(to)h +Fl(lua_unlock)p Fn(.)-42 512 y Fo(6)67 b(Prede\014ned)24 +b(F)-6 b(unctions)24 b(and)f(Libraries)-42 613 y Fn(The)17 +b(set)g(of)f(prede\014ned)i(functions)e(in)h(Lua)f(is)h(small)d(but)j +(p)q(o)o(w)o(erful.)23 b(Most)15 b(of)h(them)g(pro)o(vide)g(features)g +(that)-42 670 y(allo)o(ws)d(some)g(degree)h(of)g(re\015exivit)o(y)f(in) +h(the)g(language.)19 b(Man)o(y)13 b(of)h(these)h(features)e(cannot)h(b) +q(e)h(sim)o(ulated)d(with)-42 726 y(the)k(rest)f(of)f(the)i(Language)f +(nor)g(with)f(the)i(standard)e(API.)29 783 y(The)g(libraries,)e(on)i +(the)f(other)g(hand,)h(pro)o(vide)g(useful)f(routines)g(that)g(are)h +(implemen)o(ted)d(directly)i(through)-42 839 y(the)g(standard)f(API.)h +(Therefore,)f(they)h(are)f(not)g(necessary)h(to)f(the)g(language,)g +(and)h(are)f(pro)o(vided)h(as)f(separated)-42 896 y(C)j(mo)q(dules.)k +(Curren)o(tly)c(there)g(are)g(three)g(standard)g(libraries:)27 +989 y Fi(\017)22 b Fn(string)14 b(manipulation;)27 1083 +y Fi(\017)22 b Fn(mathematical)11 b(functions)k(\(sin,)g(cos,)f(etc\);) +27 1177 y Fi(\017)22 b Fn(input)15 b(and)h(output.)-42 +1271 y(In)h(order)f(to)g(ha)o(v)o(e)g(access)g(to)g(these)g(libraries,) +f(the)h(host)g(program)e(m)o(ust)h(call)g(the)h(functions)g +Fl(strlib_open)p Fn(,)-42 1327 y Fl(mathlib_open)p Fn(,)e(and)h +Fl(iolib_open)p Fn(,)e(declared)j(in)f Fl(lualib.h)p +Fn(.)-42 1449 y Fd(6.1)56 b(Prede\014ned)18 b(F)-5 b(unctions)-42 +1535 y Fl(dofile)24 b(\(filename\))-42 1621 y Fn(This)16 +b(function)f(receiv)o(es)g(a)g(\014le)h(name,)e(op)q(ens)i(it)f(and)h +(executes)g(its)f(con)o(ten)o(ts)f(as)i(a)f(Lua)h(c)o(h)o(unk.)21 +b(It)15 b(returns)h(1)-42 1677 y(if)f(there)g(are)g(no)g(errors,)g +Fk(nil)f Fn(otherwise.)-42 1797 y Fl(dostring)23 b(\(string\))-42 +1883 y Fn(This)e(function)h(executes)g(a)f(giv)o(en)g(string)f(as)h(a)g +(Lua)h(c)o(h)o(unk.)38 b(It)22 b(returns)f(1)g(if)g(there)g(are)g(no)h +(errors,)f Fk(nil)-42 1939 y Fn(otherwise.)-42 2059 y +Fl(next)j(\(table,)f(index\))-42 2145 y Fn(This)18 b(function)f(allo)o +(ws)f(a)i(program)d(to)i(tra)o(v)o(erse)g(all)g(\014elds)h(of)f(a)g +(table.)27 b(Its)18 b(\014rst)f(argumen)o(t)f(is)i(a)f(table)g(and)-42 +2202 y(its)e(second)i(argumen)o(t)c(is)j(an)f(index)h(in)g(this)f +(table.)21 b(It)15 b(returns)h(the)g(next)f(index)h(of)g(the)f(table)h +(and)f(the)h(v)m(alue)-42 2258 y(asso)q(ciated)g(with)f(the)h(index.)23 +b(When)17 b(called)e(with)h Fk(nil)f Fn(as)g(its)h(second)g(argumen)o +(t,)e(the)j(function)e(returns)h(the)-42 2315 y(\014rst)g(index)g(of)g +(the)g(table)g(\(and)f(its)h(asso)q(ciated)f(v)m(alue\).)22 +b(When)17 b(called)e(with)h(the)g(last)f(index,)h(or)f(with)h +Fk(nil)f Fn(in)-42 2371 y(an)h(empt)o(y)e(table,)g(it)g(returns)h +Fk(nil)p Fn(.)29 2428 y(In)i(Lua)f(there)g(is)g(no)g(declaration)f(of)h +(\014elds;)g(seman)o(tically)l(,)d(there)j(is)g(no)g(di\013erence)g(b)q +(et)o(w)o(een)h(a)e(\014eld)i(not)-42 2484 y(presen)o(t)g(in)f(a)g +(table)f(or)h(a)g(\014eld)h(with)e(v)m(alue)i Fk(nil)p +Fn(.)22 b(Therefore,)16 b(the)g(function)g(only)g(considers)g(\014elds) +h(with)e(non)-42 2540 y(nil)g(v)m(alues.)20 b(The)c(order)f(the)g +(indices)g(are)g(en)o(umerated)f(is)h(not)g(sp)q(eci\014ed,)h +Fm(even)f(for)i(numeric)f(indic)n(es)p Fn(.)29 2597 y(See)g(Section)f +(7.1)f(for)h(an)g(example)f(of)h(the)g(use)h(of)e(this)h(function.)911 +2748 y(16)p eop +%%Page: 17 17 +17 16 bop -42 199 a Fl(nextvar)23 b(\(name\))-42 285 +y Fn(This)18 b(function)g(is)g(similar)d(to)i(the)i(function)f +Fl(next)p Fn(,)f(but)i(it)e(iterates)g(o)o(v)o(er)g(the)h(global)f(v)m +(ariables.)28 b(Its)18 b(single)-42 342 y(argumen)o(t)c(is)h(the)h +(name)e(of)h(a)g(global)f(v)m(ariable,)g(or)h Fk(nil)g +Fn(to)g(get)g(a)g(\014rst)g(name.)k(Similarly)13 b(to)h +Fl(next)p Fn(,)h(it)g(returns)-42 398 y(the)j(name)e(of)g(another)h(v)m +(ariable)f(and)h(its)f(v)m(alue,)i(or)e Fk(nil)g Fn(if)g(there)h(are)g +(no)g(more)e(v)m(ariables.)25 b(See)18 b(Section)e(7.1)-42 +454 y(for)f(an)g(example)f(of)h(the)g(use)h(of)f(this)f(function.)-42 +574 y Fl(print)24 b(\(e1,)f(e2,)g(...\))-42 660 y Fn(This)18 +b(function)g(receiv)o(es)g(an)o(y)g(n)o(um)o(b)q(er)g(of)f(argumen)o +(ts,)g(and)h(prin)o(ts)g(their)f(v)m(alues)i(in)f(a)g(reasonable)f +(format.)-42 717 y(Eac)o(h)i(v)m(alue)g(is)f(prin)o(ted)h(in)f(a)h(new) +g(line.)30 b(This)18 b(function)h(is)f(not)g(in)o(tended)h(for)f +(formatted)f(output,)i(but)g(as)-42 773 y(a)h(quic)o(k)f(w)o(a)o(y)g +(to)g(sho)o(w)g(a)g(v)m(alue,)i(for)e(instance)g(for)g(error)g +(messages)f(or)h(debugging.)34 b(See)20 b(Section)f(6.4)g(for)-42 +830 y(functions)c(for)g(formatted)e(output.)-42 950 y +Fl(tonumber)23 b(\(e\))-42 1036 y Fn(This)13 b(function)f(receiv)o(es)g +(one)h(argumen)o(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(er.)18 b(If)13 b(the)g(argumen)o(t)d(is)i(already)-42 +1092 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 +(a)g(n)o(um)o(b)q(er)f(\(see)h(Section)h(4.2\),)d(it)i(returns)g(that)f +(n)o(um)o(b)q(er;)h(otherwise,)-42 1148 y(it)g(returns)g +Fk(nil)p Fn(.)-42 1269 y Fl(type)24 b(\(v\))-42 1354 +y Fn(This)13 b(function)h(allo)o(ws)d(Lua)j(to)e(test)h(the)g(t)o(yp)q +(e)h(of)f(a)g(v)m(alue.)19 b(It)13 b(receiv)o(es)h(one)f(argumen)o(t,)f +(and)h(returns)g(its)g(t)o(yp)q(e,)-42 1411 y(co)q(ded)21 +b(as)e(a)g(string.)31 b(The)19 b(p)q(ossible)g(results)g(of)g(this)g +(function)g(are)g Fl("nil")g Fn(\(a)f(string,)h(not)g(the)h(v)m(alue)f +Fk(nil)p Fn(\),)-42 1467 y Fl("number")p Fn(,)g Fl("string")p +Fn(,)g Fl("table")p Fn(,)h Fl("function")e Fn(\(returned)h(b)q(oth)h +(for)f(C)g(functions)g(and)h(Lua)f(functions\),)-42 1524 +y(and)d Fl("userdata")p Fn(.)29 1580 y(Besides)f(this)f(string,)f(the)i +(function)f(returns)h(a)f(second)h(result,)f(whic)o(h)g(is)g(the)h +Fm(tag)g Fn(of)f(the)g(v)m(alue.)20 b(This)14 b(tag)-42 +1637 y(can)g(b)q(e)h(used)f(to)f(distinguish)g(b)q(et)o(w)o(een)g(user) +h(data)f(with)g(di\013eren)o(t)g(tags,)g(and)h(b)q(et)o(w)o(een)f(C)h +(functions)f(and)h(Lua)-42 1693 y(functions.)-42 1813 +y Fl(error)24 b(\(message\))-42 1899 y Fn(This)e(function)f(issues)g +(an)h(error)f(message)f(and)h(terminates)f(the)h(last)g(called)g +(function)g(from)f(the)i(library)-42 1955 y(\()p Fl(lua_dofile)p +Fn(,)14 b Fl(lua_dostring)p Fn(,)f Fc(:)8 b(:)g(:)d Fn(\).)20 +b(It)15 b(nev)o(er)g(returns.)-42 2075 y Fl(setglobal)23 +b(\(name,)g(value\))-42 2161 y Fn(This)18 b(function)h(assigns)e(the)i +(giv)o(en)f(v)m(alue)g(to)g(a)g(global)f(v)m(ariable.)29 +b(The)19 b(string)e Fl(name)h Fn(do)q(es)h(not)f(need)h(to)f(b)q(e)-42 +2218 y(a)f(syn)o(tactically)d(v)m(alid)i(v)m(ariable)g(name.)22 +b(Therefore,)17 b(this)f(function)g(can)g(set)h(global)e(v)m(ariables)g +(with)h(strange)-42 2274 y(names)f(lik)o(e)f Fl(m)24 +b(v)f(1)15 b Fn(or)g Fl(34)p Fn(.)-42 2394 y Fl(getglobal)23 +b(\(name\))-42 2480 y Fn(This)e(function)g(retriev)o(es)g(the)g(v)m +(alue)h(of)f(a)g(global)f(v)m(ariable.)37 b(The)22 b(string)e +Fl(name)h Fn(do)q(es)g(not)g(need)h(to)f(b)q(e)h(a)-42 +2536 y(syn)o(tactically)14 b(v)m(alid)g(v)m(ariable)h(name.)911 +2748 y(17)p eop +%%Page: 18 18 +18 17 bop -42 199 a Fl(setfallback)23 b(\(fallbackname,)f +(newfallback\))-42 285 y Fn(This)13 b(function)f(sets)g(a)h(new)f +(fallbac)o(k)g(function)g(to)g(the)h(giv)o(en)f(fallbac)o(k.)18 +b(It)12 b(returns)h(the)g(old)f(fallbac)o(k)f(function.)-42 +407 y Fd(6.2)56 b(String)19 b(Manipulation)-42 493 y +Fn(This)j(library)e(pro)o(vides)i(generic)f(functions)h(for)f(string)g +(manipulation,)f(suc)o(h)i(as)g(\014nding)g(and)g(extracting)-42 +549 y(substrings.)29 b(When)19 b(indexing)f(a)g(string,)f(the)i +(\014rst)f(c)o(haracter)f(has)h(p)q(osition)g(1.)29 b(See)19 +b(Section)f(7.2)f(for)h(some)-42 606 y(examples)c(on)i(string)e +(manipulation)f(in)i(Lua.)-42 726 y Fl(strfind)23 b(\(str,)h(substr,)e +([init,)i([end]]\))-42 811 y Fn(Receiv)o(es)c(t)o(w)o(o)e(string)h +(argumen)o(ts,)f(and)h(returns)g(a)g(n)o(um)o(b)q(er.)32 +b(This)19 b(n)o(um)o(b)q(er)f(indicates)h(the)g(\014rst)g(p)q(osition) +-42 868 y(where)13 b(the)f(second)h(argumen)o(t)e(app)q(ears)h(in)g +(the)g(\014rst)g(argumen)o(t.)17 b(If)c(the)f(second)h(argumen)o(t)d +(is)i(not)g(a)g(substring)-42 924 y(of)j(the)g(\014rst)g(one,)f(then)i +Fl(strfind)e Fn(returns)h Fk(nil)p Fn(.)j(A)e(third)e(optional)g(n)o +(umerical)f(argumen)o(t)g(sp)q(eci\014es)j(where)f(to)-42 +981 y(start)f(the)i(searc)o(h.)j(Another)d(optional)d(n)o(umerical)h +(argumen)o(t)f(sp)q(eci\014es)j(where)g(to)e(stop)h(it.)-42 +1101 y Fl(strlen)24 b(\(s\))-42 1187 y Fn(Receiv)o(es)16 +b(a)f(string)f(and)i(returns)f(its)f(length.)-42 1307 +y Fl(strsub)24 b(\(s,)f(i,)h([j]\))-42 1392 y Fn(Returns)17 +b(another)f(string,)f(whic)o(h)h(is)g(a)g(substring)g(of)g +Fl(s)p Fn(,)g(starting)e(at)i Fl(i)g Fn(and)g(runing)g(un)o(til)g +Fl(j)p Fn(.)23 b(If)16 b Fl(j)g Fn(is)g(absen)o(t,)-42 +1449 y(it)f(is)g(assumed)g(to)f(b)q(e)i(equal)g(to)e(the)i(length)f(of) +g Fl(s)p Fn(.)20 b(P)o(articularly)l(,)13 b(the)j(call)e +Fl(strsub\(s,1,j\))g Fn(returns)h(a)g(pre\014x)-42 1505 +y(of)g Fl(s)g Fn(with)g(length)g Fl(j)p Fn(,)f(while)h(the)g(call)g +Fl(strsub\(s,i\))e Fn(returns)i(a)g(su\016x)g(of)g Fl(s)p +Fn(,)g(starting)e(at)i Fl(i)p Fn(.)-42 1625 y Fl(strlower)23 +b(\(s\))-42 1711 y Fn(Receiv)o(es)14 b(a)e(string)g(and)h(returns)f(a)h +(cop)o(y)f(of)h(that)f(string)f(with)h(all)g(upp)q(er)i(case)f(letters) +e(c)o(hanged)i(to)f(lo)o(w)o(er)g(case.)-42 1768 y(All)j(other)g(c)o +(haracters)f(are)h(left)g(unc)o(hanged.)-42 1888 y Fl(strupper)23 +b(\(s\))-42 1974 y Fn(Receiv)o(es)14 b(a)e(string)g(and)h(returns)f(a)h +(cop)o(y)f(of)h(that)f(string)f(with)h(all)g(lo)o(w)o(er)f(case)i +(letters)f(c)o(hanged)h(to)f(upp)q(er)i(case.)-42 2030 +y(All)h(other)g(c)o(haracters)f(are)h(left)g(unc)o(hanged.)-42 +2150 y Fl(ascii)24 b(\(s,)f([i]\))-42 2236 y Fn(Returns)16 +b(the)f(ascii)g(co)q(de)h(of)e(the)i(c)o(haracter)e Fl(s[i])p +Fn(.)19 b(If)d Fl(i)f Fn(is)g(absen)o(t,)f(it)h(is)f(assumed)h(to)f(b)q +(e)i(1.)-42 2356 y Fl(int2str)23 b(\()p Fi(f)p Fl(i)p +Fi(g)p Fl(\))-42 2442 y Fn(Receiv)o(es)e(0)f(or)g(more)f(n)o(um)o(b)q +(ers.)34 b(Returns)21 b(a)f(string)f(with)h(length)g(equal)g(to)g(the)g +(n)o(um)o(b)q(er)g(of)g(argumen)o(ts,)-42 2498 y(wherein)c(eac)o(h)f(c) +o(haracter)g(has)g(ascii)f(v)m(alue)h(equal)g(to)g(its)f(corresp)q +(onden)o(t)i(argumen)o(t.)911 2748 y(18)p eop +%%Page: 19 19 +19 18 bop -42 199 a Fd(6.3)56 b(Mathematical)20 b(F)-5 +b(unctions)-42 285 y Fn(This)13 b(library)f(is)h(an)g(in)o(terface)f +(to)h(some)e(functions)i(of)g(the)g(standard)g(C)g(math)e(library)l(.) +19 b(Moreo)o(v)o(er,)11 b(it)i(registers)-42 342 y(a)i(fallbac)o(k)f +(for)h(the)g(binary)g(op)q(erator)f Fl(^)h Fn(whic)o(h,)g(when)h +(applied)f(to)f(n)o(um)o(b)q(ers)h Fl(x^y)p Fn(,)f(returns)h +Fc(x)1619 325 y Fb(y)1639 342 y Fn(.)29 398 y(The)g(library)f(pro)o +(vides)h(the)g(follo)o(wing)e(functions:)-42 492 y Fl(abs)24 +b(acos)f(asin)h(atan)f(atan2)g(ceil)g(cos)h(floor)-42 +548 y(log)g(log10)f(max)h(min)47 b(mod)g(sin)h(sqrt)23 +b(tan)-42 642 y Fn(Most)17 b(of)g(them)g(are)g(only)g(in)o(terfaces)g +(to)g(the)g(homon)o(ymous)e(functions)j(in)f(the)h(C)f(library)l(,)g +(except)h(that,)f(for)-42 699 y(the)f(trigonometri)o(c)d(functions,)h +(all)h(angles)f(are)h(expressed)h(in)f(degrees.)29 755 +y(The)d(function)f Fl(max)g Fn(returns)g(the)g(maxim)o(um)d(v)m(alue)j +(of)g(its)f(n)o(umeric)h(argumen)o(ts.)16 b(Similarly)l(,)9 +b Fl(min)i Fn(computes)-42 811 y(the)16 b(minim)o(um)o(.)h(Both)e(can)g +(b)q(e)h(used)g(with)e(an)h(unlimited)f(n)o(um)o(b)q(er)g(of)h(argumen) +o(ts.)29 868 y(The)g(function)h Fl(mod)e Fn(is)h(equiv)m(alen)o(t)g(to) +f(the)i Fl(\045)f Fn(op)q(erator)f(in)h(C.)-42 990 y +Fd(6.4)56 b(I/O)19 b(F)-5 b(acilities)-42 1075 y Fn(All)20 +b(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) +f Fm(curr)n(ent)i Fn(\014les,)g(one)g(for)g(reading)f(and)h(one)g(for)f +(writing.)-42 1132 y(Initially)l(,)14 b(the)h(curren)o(t)g(input)h +(\014le)f(is)g Fl(stdin)p Fn(,)f(and)h(the)g(curren)o(t)g(output)g +(\014le)h(is)e Fl(stdout)p Fn(.)29 1188 y(Unless)h(otherwise)g(stated,) +f(all)g(I/O)i(functions)f(return)g(1)g(on)g(success)h(and)f +Fk(nil)f Fn(on)h(failure.)-42 1308 y Fl(readfrom)23 b(\(filename\))-42 +1394 y Fn(This)e(function)g(op)q(ens)g(a)g(\014le)g(named)f +Fl(filename)g Fn(and)h(sets)g(it)f(as)h(the)g Fm(curr)n(ent)f +Fn(input)h(\014le.)38 b(When)21 b(called)-42 1451 y(without)c +(parameters,)e(this)i(function)g(closes)f(the)i(curren)o(t)f(input)g +(\014le,)g(and)h(restores)e Fl(stdin)h Fn(as)f(the)i(curren)o(t)-42 +1507 y(input)e(\014le.)29 1564 y Fm(System)f(dep)n(endent:)k +Fn(if)13 b Fl(filename)h Fn(starts)e(with)i(a)g Fl(|)p +Fn(,)g(then)g(a)g(pip)q(ed)h(input)g(is)e(op)q(en,)i(via)e(function)i +Fl(popen)p Fn(.)-42 1684 y Fl(writeto)23 b(\(filename\))-42 +1769 y Fn(This)13 b(function)g(op)q(ens)h(a)e(\014le)i(named)e +Fl(filename)g Fn(and)h(sets)g(it)f(as)h(the)g Fm(curr)n(ent)g +Fn(output)g(\014le.)19 b(Notice)12 b(that,)h(if)f(the)-42 +1826 y(\014le)19 b(already)e(exists,)g(it)h(is)f(completely)f(erased)j +(with)e(this)g(op)q(eration.)28 b(When)18 b(called)g(without)f +(parameters,)-42 1882 y(this)e(function)g(closes)g(the)g(curren)o(t)g +(output)g(\014le,)g(and)h(restores)e Fl(stdout)g Fn(as)h(the)g(curren)o +(t)g(output)g(\014le.)29 1939 y Fm(System)e(dep)n(endent:)18 +b Fn(if)12 b Fl(filename)f Fn(starts)g(with)h(a)g Fl(|)p +Fn(,)g(then)h(a)f(pip)q(ed)h(output)g(is)e(op)q(en,)j(via)d(function)i +Fl(popen)p Fn(.)-42 2059 y Fl(appendto)23 b(\(filename\))-42 +2145 y Fn(This)11 b(function)g(op)q(ens)h(a)f(\014le)g(named)f +Fl(filename)g Fn(and)i(sets)f(it)f(as)h(the)g Fm(curr)n(ent)g +Fn(output)g(\014le.)19 b(Unlik)o(e)10 b(the)h Fl(writeto)-42 +2201 y Fn(op)q(eration,)16 b(this)f(function)h(do)q(es)h(not)f(erase)f +(an)o(y)h(previous)g(con)o(ten)o(t)g(of)f(the)i(\014le.)22 +b(This)16 b(function)g(returns)g(2)g(if)-42 2258 y(the)g(\014le)f +(already)f(exists,)h(1)f(if)h(it)g(creates)g(a)f(new)i(\014le,)f(and)g +Fk(nil)f Fn(on)h(failure.)-42 2378 y Fl(remove)24 b(\(filename\))-42 +2463 y Fn(This)15 b(function)g(deletes)h(the)f(\014le)g(with)g(the)g +(giv)o(en)g(name.)911 2748 y(19)p eop +%%Page: 20 20 +20 19 bop -42 199 a Fl(read)24 b(\([format]\))-42 285 +y Fn(This)17 b(function)g(returns)f(a)h(v)m(alue)g(read)g(from)e(the)i +(curren)o(t)g(input.)25 b(An)17 b(optional)f(string)g(argumen)o(t)f(sp) +q(eci\014es)-42 342 y(the)h(w)o(a)o(y)e(the)h(input)g(is)g(in)o +(terpreted.)29 398 y(Without)d(a)h(format)d(argumen)o(t,)h +Fl(read)i Fn(\014rst)f(skips)h(blanks,)g(tabs)f(and)h(newlines.)19 +b(Then)14 b(it)e(c)o(hec)o(ks)h(whether)-42 454 y(the)h(curren)o(t)f(c) +o(haracter)f(is)h Fl(")g Fn(or)f Fl(')p Fn(.)19 b(If)14 +b(so,)e(it)h(reads)g(a)f(string)g(up)i(to)f(the)g(ending)g(quotation)f +(mark,)f(and)j(returns)-42 511 y(this)h(string,)f(without)g(the)h +(quotation)f(marks.)k(Otherwise)d(it)g(reads)g(up)h(to)e(a)h(blank,)g +(tab)f(or)h(newline.)29 567 y(The)g(format)e(string)i(can)g(ha)o(v)o(e) +g(the)g(follo)o(wing)e(format:)30 658 y Fl(?[n])-42 748 +y Fn(where)j Fl(?)f Fn(can)g(b)q(e:)-42 839 y Fk('s')i(or)g('S')k +Fn(to)15 b(read)g(a)g(string;)-42 931 y Fk('f)5 b(')17 +b(or)g('F')22 b Fn(to)14 b(read)h(a)g(real)g(n)o(um)o(b)q(er;)-42 +1024 y Fk('i')h(or)i('I')j Fn(to)15 b(read)g(an)g(in)o(teger.)-42 +1114 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 +(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 +(read)g(to)e(comp)q(ose)h(the)g(input)-42 1171 y(v)m(alue.)21 +b(P)o(articularly)l(,)12 b(the)k(format)c Fl("s1")j Fn(reads)g(a)g +(single)g(c)o(haracter.)-42 1290 y Fl(readuntil)23 b(\(char\))-42 +1376 y Fn(Reads)18 b(the)f(curren)o(t)g(input)g(un)o(til)f(the)g +(\014rst)h(o)q(currence)h(of)e(the)h(giv)o(en)f(c)o(haracter.)25 +b(Returns)17 b(the)g(string)f(read.)-42 1432 y(The)g(c)o(haracter)e +(itself)h(is)f(not)h(read.)-42 1552 y Fl(write)24 b(\(value,)f +([format]\))-42 1637 y Fn(This)d(function)g(writes)f(the)i(v)m(alue)f +(of)g(its)f(\014rst)h(argumen)o(t)e(to)i(the)g(curren)o(t)g(output.)35 +b(An)20 b(optional)f(second)-42 1694 y(argumen)o(t)13 +b(sp)q(eci\014es)i(the)f(format)e(to)i(b)q(e)h(used.)20 +b(This)14 b(format)e(is)i(giv)o(en)f(as)h(a)g(string,)f(comp)q(osed)h +(of)g(four)f(parts.)-42 1750 y(The)j(\014rst)f(part)f(is)h(the)g(only)g +(one)g(not)g(optional,)f(and)h(m)o(ust)f(b)q(e)i(one)f(of)g(the)g +(follo)o(wing)e(c)o(haracters:)-42 1841 y Fk('s')k(or)g('S')k +Fn(to)15 b(write)f(strings;)-42 1933 y Fk('f)5 b(')17 +b(or)g('F')22 b Fn(to)14 b(write)g(\015oats;)-42 2026 +y Fk('i')i(or)i('I')j Fn(to)15 b(write)f(in)o(tegers.)-42 +2116 y(These)i(c)o(haracters)e(can)i(b)q(e)g(follo)o(w)o(ed)d(b)o(y)30 +2207 y Fl([?][m][.n])-42 2297 y Fn(where:)-42 2388 y +Fl(?)23 b Fn(indicates)15 b(justi\014cation)f(inside)h(the)g(\014eld.) +100 2480 y(')p Fl(<)p Fn(')22 b(righ)o(t)14 b(justi\014cation)g +(\(default\);)100 2552 y(')p Fl(>)p Fn(')22 b(left)15 +b(justi\014cation;)100 2623 y(')p Fl(|)p Fn(')22 b(cen)o(ter)15 +b(justi\014cation.)911 2748 y(20)p eop +%%Page: 21 21 +21 20 bop -42 199 a Fl(m)23 b Fn(Indicates)16 b(the)f(\014eld)g(size)g +(in)g(c)o(haracters.)-42 293 y Fl(.n)23 b Fn(F)l(or)18 +b(reals,)h(indicates)f(the)h(n)o(um)o(b)q(er)f(of)g(digital)f(places.) +31 b(F)l(or)18 b(in)o(tegers,)h(it)f(is)g(the)h(minim)o(um)c(n)o(um)o +(b)q(er)j(of)72 350 y(digits.)h(This)c(option)f(has)h(no)g(meaning)f +(for)h(strings.)29 443 y(When)20 b(called)e(without)g(a)h(format)e +(string,)i(this)f(function)h(writes)f(n)o(um)o(b)q(ers)h(using)f(the)i +Fl(\045g)e Fn(format)f(and)-42 500 y(strings)e(with)f +Fl(\045s)p Fn(.)-42 643 y Fo(7)67 b(Some)22 b(Examples)-42 +744 y Fn(This)17 b(section)f(giv)o(es)g(examples)g(sho)o(wing)g(some)g +(features)g(of)h(Lua.)25 b(It)17 b(do)q(es)g(not)g(in)o(tend)f(to)h(co) +o(v)o(er)f(the)h(whole)-42 801 y(language,)e(but)g(only)g(to)f +(illustrate)f(some)h(in)o(teresting)g(uses)i(of)e(the)i(system.)-42 +923 y Fd(7.1)56 b(The)18 b(F)-5 b(unctions)21 b Fa(next)c +Fd(and)i Fa(nextvar)-42 1008 y Fn(This)f(example)f(sho)o(ws)g(ho)o(w)h +(to)f(use)i(the)f(function)g Fl(next)f Fn(to)h(iterate)f(o)o(v)o(er)g +(the)h(\014elds)g(of)g(a)g(table.)28 b(F)l(unction)-42 +1065 y Fm(clone)15 b Fn(receiv)o(es)g(an)o(y)g(table)f(and)i(returns)f +(a)g(clone)g(of)g(it.)-42 1159 y Fl(function)23 b(clone)g(\(t\))263 +b(--)23 b(t)h(is)f(a)h(table)6 1215 y(local)f(new_t)h(=)f({})263 +b(--)23 b(creates)g(a)h(new)f(table)6 1272 y(local)g(i,)h(v)g(=)f +(next\(t,)g(nil\))48 b(--)23 b(i)h(is)f(an)h(index)f(of)h(t,)f(v)h(=)g +(t[i])6 1328 y(while)f(i)h(do)54 1385 y(new_t[i])f(=)g(v)54 +1441 y(i,)h(v)f(=)h(next\(t,)f(i\))191 b(--)23 b(get)h(next)f(index)6 +1497 y(end)6 1554 y(return)g(new_t)-42 1610 y(end)29 +1704 y Fn(The)15 b(next)h(example)e(prin)o(ts)g(the)i(names)e(of)g(all) +h(global)e(v)m(ariables)i(in)g(the)g(system)f(with)h(non)g(nil)g(v)m +(alues:)-42 1798 y Fl(function)23 b(printGlobalVariables)e(\(\))6 +1854 y(local)i(i,)h(v)g(=)f(nextvar\(nil\))6 1911 y(while)g(i)h(do)54 +1967 y(print\(i\))54 2024 y(i,)g(v)f(=)h(nextvar\(i\))6 +2080 y(end)-42 2137 y(end)-42 2258 y Fd(7.2)56 b(String)19 +b(Manipulation)-42 2344 y Fn(The)d(\014rst)f(example)f(is)g(a)h +(function)g(to)g(trim)e(extra)i(blanks)g(at)f(the)h(b)q(eginning)h(and) +f(end)h(of)f(a)g(string.)-42 2438 y Fl(function)23 b(trim\(s\))6 +2495 y(local)g(l)h(=)g(1)6 2551 y(while)f(strsub\(s,l,l\))f(==)i(')g(') +g(do)54 2607 y(l)g(=)f(l+1)911 2748 y Fn(21)p eop +%%Page: 22 22 +22 21 bop 6 199 a Fl(end)6 256 y(local)23 b(r)h(=)g(strlen\(s\))6 +312 y(while)f(strsub\(s,r,r\))f(==)i(')g(')g(do)54 369 +y(r)g(=)f(r-1)6 425 y(end)6 482 y(return)g(strsub\(s,l,r\))-42 +538 y(end)29 631 y Fn(The)15 b(second)h(example)e(sho)o(ws)h(a)g +(function)g(that)f(eliminates)f(all)h(blanks)h(of)g(a)g(string.)-42 +723 y Fl(function)23 b(remove_blanks)f(\(s\))6 780 y(local)h(b)h(=)g +(strfind\(s,)e(')i('\))6 836 y(while)f(b)h(do)54 893 +y(s)g(=)f(strsub\(s,)g(1,)h(b-1\))f(..)h(strsub\(s,)e(b+1\))54 +949 y(b)i(=)f(strfind\(s,)g(')h('\))6 1006 y(end)6 1062 +y(return)f(s)-42 1118 y(end)-42 1240 y Fd(7.3)56 b(P)n(ersistence)-42 +1326 y Fn(Because)21 b(of)e(its)g(re\015exiv)o(e)g(facilities,)g(p)q +(ersistence)h(in)f(Lua)h(can)g(b)q(e)g(ac)o(hiev)o(ed)g(within)f(the)g +(language.)33 b(This)-42 1382 y(section)12 b(sho)o(ws)f(some)g(w)o(a)o +(ys)g(to)g(store)g(and)h(retriev)o(e)f(v)m(alues)i(in)e(Lua,)i(using)f +(a)f(text)h(\014le)g(written)e(in)i(the)g(language)-42 +1439 y(itself)j(as)f(the)i(storage)e(media.)29 1495 y(T)l(o)h(store)f +(a)h(single)g(v)m(alue)g(with)g(a)g(name,)f(the)h(follo)o(wing)e(co)q +(de)j(is)e(enough:)-42 1588 y Fl(function)23 b(store)g(\(name,)g +(value\))6 1644 y(write\('\\n')g(..)g(name)h(..)f('='\))6 +1701 y(write_value\(value\))-42 1757 y(end)-42 1862 y(function)g +(write_value)g(\(value\))6 1918 y(local)g(t)h(=)g(type\(value\))102 +1975 y(if)f(t)h(==)g('nil')94 b(then)24 b(write\('nil'\))6 +2031 y(elseif)f(t)h(==)g('number')e(then)i(write\(value\))6 +2088 y(elseif)f(t)h(==)g('string')e(then)i(write\('[[')e(..)i(value)f +(..)h(']]'\))6 2144 y(end)-42 2200 y(end)-42 2305 y Fn(In)16 +b(order)f(to)g(restore)f(this)h(v)m(alue,)g(a)g Fl(lua_dofile)f +Fn(su\016ces.)29 2361 y(Storing)i(tables)h(is)g(a)g(little)e(more)h +(complex.)25 b(Assuming)16 b(that)g(the)h(table)g(is)g(a)g(tree,)g(and) +g(all)f(indices)i(are)-42 2418 y(iden)o(ti\014ers)13 +b(\(that)e(is,)i(the)g(tables)f(are)g(b)q(eing)h(used)g(as)g +(records\),)f(its)g(v)m(alue)h(can)g(b)q(e)g(written)f(directly)g(with) +g(table)-42 2474 y(constructors.)19 b(First,)14 b(the)h(function)g +Fl(write_value)f Fn(is)h(c)o(hanged)g(to)-42 2567 y Fl(function)23 +b(write_value)g(\(value\))6 2623 y(local)g(t)h(=)g(type\(value\))911 +2748 y Fn(22)p eop +%%Page: 23 23 +23 22 bop 102 199 a Fl(if)23 b(t)h(==)g('nil')94 b(then)24 +b(write\('nil'\))6 256 y(elseif)f(t)h(==)g('number')e(then)i +(write\(value\))6 312 y(elseif)f(t)h(==)g('string')e(then)i(write\('"') +e(..)i(value)f(..)h('"'\))6 369 y(elseif)f(t)h(==)g('table')46 +b(then)24 b(write_record\(value\))6 425 y(end)-42 482 +y(end)-42 575 y Fn(The)16 b(function)f Fl(write_record)e +Fn(is:)-42 669 y Fl(function)23 b(write_record\(t\))6 +726 y(local)g(i,)h(v)g(=)f(next\(t,)g(nil\))6 782 y(write\('{'\))47 +b(--)23 b(starts)g(constructor)6 839 y(while)g(i)h(do)54 +895 y(store\(i,)f(v\))54 951 y(write\(',)g('\))54 1008 +y(i,)h(v)f(=)h(next\(t,)f(i\))6 1064 y(end)6 1121 y(write\('}'\))47 +b(--)23 b(closes)g(constructor)-42 1177 y(end)-42 1299 +y Fd(7.4)56 b(Inheritance)-42 1385 y Fn(The)15 b(fallbac)o(k)f(for)g +(absen)o(t)g(indices)h(can)g(b)q(e)g(used)g(to)f(implemen)o(t)e(man)o +(y)h(kinds)i(of)f(inheritance)g(in)h(Lua.)20 b(As)15 +b(an)-42 1441 y(example,)f(the)h(follo)o(wing)e(co)q(de)j(implemen)o +(ts)d(single)h(inheritance:)-42 1535 y Fl(function)23 +b(Index)g(\(t,f\))6 1592 y(if)h(f)g(==)f('parent')g(then)47 +b(--)24 b(to)f(avoid)g(loop)54 1648 y(return)g(OldIndex\(t,f\))6 +1704 y(end)6 1761 y(local)g(p)h(=)g(t.parent)6 1817 y(if)g(type\(p\))f +(==)g('table')g(then)54 1874 y(return)g(p[f])6 1930 y(else)54 +1987 y(return)g(OldIndex\(t,f\))6 2043 y(end)-42 2100 +y(end)-42 2213 y(OldIndex)g(=)h(setfallback\("index",)d(Index\))-42 +2306 y Fn(Whenev)o(er)15 b(Lua)g(attempts)d(to)i(access)h(an)f(absen)o +(t)g(\014eld)h(in)f(a)g(table,)g(it)g(calls)f(the)i(fallbac)o(k)e +(function)h Fl(Index)p Fn(.)19 b(If)-42 2363 y(the)14 +b(table)e(has)h(a)g(\014eld)h Fl(parent)e Fn(with)h(a)g(table)f(v)m +(alue,)i(then)f(Lua)h(attempts)d(to)h(access)i(the)f(desired)g(\014eld) +h(in)f(this)-42 2419 y(paren)o(t)i(ob)s(ject.)k(This)c(pro)q(cess)g(is) +f(rep)q(eated)h(\\up)o(w)o(ards")f(un)o(til)g(a)h(v)m(alue)g(for)f(the) +h(\014eld)g(is)g(found)g(or)f(the)h(ob)s(ject)-42 2476 +y(has)h(no)f(paren)o(t.)k(In)d(the)f(latter)f(case,)h(the)g(previous)g +(fallbac)o(k)f(is)h(called)g(to)f(supply)i(a)e(v)m(alue)i(for)e(the)i +(\014eld.)29 2532 y(When)e(b)q(etter)g(p)q(erformance)f(is)g(needed,)i +(the)f(same)e(fallbac)o(k)h(ma)o(y)f(b)q(e)i(implemen)o(ted)e(in)i(C,)f +(as)g(illustrated)-42 2589 y(in)j(Figure)e(1.)20 b(This)14 +b(co)q(de)i(m)o(ust)e(b)q(e)i(registered)e(with:)911 +2748 y(23)p eop +%%Page: 24 24 +24 23 bop -42 317 1950 6 v -42 411 a Fl(int)24 b(lockedParentName;)45 +b(/*)24 b(stores)f(the)g(lock)h(index)f(for)g(the)h(string)f("parent")g +(*/)-42 467 y(int)h(lockedOldIndex;)93 b(/*)24 b(previous)f(fallback)f +(function)h(*/)-42 580 y(void)h(callOldFallback)e(\(lua_Object)g +(table,)h(lua_Object)g(index\))-42 637 y({)6 693 y(lua_Object)g +(oldIndex)f(=)i(lua_getlocked\(lockedOldIndex)o(\);)6 +750 y(lua_pushobject\(table\);)6 806 y(lua_pushobject\(index\);)6 +863 y(lua_callfunction\(oldIndex\);)-42 919 y(})-42 1032 +y(void)g(Index)f(\(void\))-42 1088 y({)6 1145 y(lua_Object)g(table)g(=) +h(lua_getparam\(1\);)6 1201 y(lua_Object)f(index)g(=)h +(lua_getparam\(2\);)6 1258 y(lua_Object)f(parent;)6 1314 +y(if)h(\(lua_isstring\(index\))d(&&)j(strcmp\(lua_getstring\(in)o +(dex\),)d("parent"\))h(==)i(0\))6 1371 y({)54 1427 y +(callOldFallback\(table,)d(index\);)54 1484 y(return;)6 +1540 y(})6 1597 y(lua_pushobject\(table\);)6 1653 y +(lua_pushlocked\(lockedParentN)o(ame\);)6 1709 y(parent)i(=)h +(lua_getsubscript\(\);)6 1766 y(if)g(\(lua_istable\(parent\)\))6 +1822 y({)54 1879 y(lua_pushobject\(parent\);)54 1935 +y(lua_pushobject\(index\);)54 1992 y(/*)g(return)f(result)g(from)g +(getsubscript)f(*/)54 2048 y(lua_pushobject\(lua_getsubs)o(cript\(\))o +(\);)6 2105 y(})6 2161 y(else)54 2218 y(callOldFallback\(table,)f +(index\);)-42 2274 y(})665 2409 y Fn(Figure)15 b(1:)k(Inheritance)d(in) +f(C.)p -42 2466 V 911 2748 a(24)p eop +%%Page: 25 25 +25 24 bop -42 159 1950 6 v -42 253 a Fl(void)24 b(math_max)f(\(void\)) +-42 310 y({)-18 366 y(int)h(i=1;)71 b(/*)23 b(number)g(of)h(arguments)f +(*/)-18 423 y(double)g(d,)h(dmax;)-18 479 y(lua_Object)f(o;)-18 +536 y(/*)h(the)f(function)g(must)g(get)h(at)g(least)f(one)g(argument)g +(*/)-18 592 y(if)h(\(\(o)f(=)h(lua_getparam\(i++\)\))e(==)h +(LUA_NOOBJECT\))30 648 y(lua_error)g(\("too)g(few)g(arguments)g(to)h +(function)e(`max'"\);)-18 705 y(/*)i(and)f(this)h(argument)e(must)i(be) +f(a)h(number)f(*/)-18 761 y(if)h(\(!lua_isnumber\(o\)\))30 +818 y(lua_error)f(\("incorrect)f(argument)h(to)g(function)g(`max'"\);) +-18 874 y(dmax)h(=)f(lua_getnumber)f(\(o\);)-18 931 y(/*)i(loops)f +(until)g(there)g(is)h(no)g(more)f(arguments)g(*/)-18 +987 y(while)h(\(\(o)f(=)h(lua_getparam\(i++\)\))d(!=)j(LUA_NOOBJECT\)) +-18 1044 y({)6 1100 y(if)g(\(!lua_isnumber\(o\)\))54 +1157 y(lua_error)f(\("incorrect)f(argument)h(to)g(function)g(`max'"\);) +6 1213 y(d)h(=)g(lua_getnumber)e(\(o\);)6 1270 y(if)i(\(d)f(>)h(dmax\)) +f(dmax)h(=)f(d;)-18 1326 y(})-18 1382 y(/*)h(push)f(the)h(result)f(to)g +(be)h(returned)f(*/)-18 1439 y(lua_pushnumber)f(\(dmax\);)-42 +1495 y(})623 1631 y Fn(Figure)14 b(2:)20 b(C)15 b(function)g +Fl(math)p 1147 1631 15 2 v 16 w(max)p Fn(.)p -42 1687 +1950 6 v 6 1815 a Fl(lua_pushliteral\("parent"\);)6 1871 +y(lockedParentName)22 b(=)i(lua_lock\(\);)6 1928 y +(lua_pushobject\(lua_setfallba)o(ck\("ind)o(ex",)d(Index\)\);)6 +1984 y(lockedOldIndex)h(=)i(lua_lock\(\);)-42 2076 y +Fn(Notice)15 b(ho)o(w)g(the)g(string)f Fl("parent")g +Fn(is)h(k)o(ept)g(lo)q(c)o(k)o(ed)g(in)g(Lua)h(for)e(optimal)f(p)q +(erformance.)-42 2198 y Fd(7.5)56 b(A)19 b(CF)-5 b(unction)-42 +2284 y Fn(A)18 b(CF)l(unction)f(to)f(compute)h(the)g(maxim)o(um)c(of)k +(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) +g(in)g(Figure)f(2.)-42 2340 y(After)f(registered)g(with)-42 +2432 y Fl(lua_register)23 b(\("max",)g(math_max\);)-42 +2525 y Fn(this)15 b(function)g(is)g(a)o(v)m(ailable)f(in)h(Lua,)g(as)g +(follo)o(ws:)-42 2617 y Fl(i)24 b(=)g(max\(4,)f(5,)h(10,)f(-34\))47 +b(--)24 b(i)g(receives)e(10)911 2748 y Fn(25)p eop +%%Page: 26 26 +26 25 bop -42 199 a Fd(7.6)56 b(Calling)21 b(Lua)e(F)-5 +b(unctions)-42 285 y Fn(This)17 b(example)e(illustrates)f(ho)o(w)i(a)h +(C)f(function)g(can)h(call)e(the)i(Lua)g(function)f Fl(remove_blanks)f +Fn(presen)o(ted)i(in)-42 342 y(Section)f(7.2.)-42 435 +y Fl(void)24 b(remove_blanks)e(\(char)h(*s\))-42 492 +y({)6 548 y(lua_pushstring\(s\);)45 b(/*)24 b(prepare)f(parameter)g(*/) +6 605 y(lua_call\("remove_blanks"\);)44 b(/*)24 b(call)f(Lua)h +(function)f(*/)6 661 y(strcpy\(s,)g(lua_getstring\(lua_getresu)o +(lt\(1\)\)\))o(;)45 b(/*)24 b(copy)f(result)g(back)g(to)h('s')f(*/)-42 +718 y(})-42 861 y Fo(Ac)n(kno)n(wledgmen)n(ts)-42 962 +y Fn(The)18 b(authors)f(w)o(ould)g(lik)o(e)f(to)h(thank)h(CENPES/PETR)o +(OBR)1073 951 y(\023)1067 962 y(AS)g(whic)o(h,)g(join)o(tly)d(with)i(T) +l(eCGraf,)g(used)h(ex-)-42 1019 y(tensiv)o(ely)13 b(early)h(v)o +(ersions)f(of)g(this)g(system)g(and)h(ga)o(v)o(e)e(v)m(aluable)i +(commen)o(ts.)j(The)d(authors)f(w)o(ould)g(also)g(lik)o(e)g(to)-42 +1075 y(thank)j(Carlos)d(Henrique)j(Levy)l(,)f(who)g(found)h(the)f(name) +f(of)h(the)h(game)1204 1059 y Fj(3)1221 1075 y Fn(.)-42 +1218 y Fo(A)68 b(Incompatibiliti)q(es)24 b(with)f(Previous)h(V)-6 +b(ersions)-42 1320 y Fn(Although)15 b(great)f(care)h(has)g(b)q(een)h +(tak)o(en)f(to)f(a)o(v)o(oid)g(incompatibiliti)o(es)e(with)j(the)g +(previous)g(public)g(v)o(ersions)f(of)-42 1376 y(Lua,)i(some)e +(di\013erences)h(had)g(to)g(b)q(e)h(in)o(tro)q(duced.)k(Here)15 +b(is)g(a)g(list)f(of)h(all)f(these)h(di\013erences.)-42 +1498 y Fd(Incompatibilities)21 b(with)f(v)n(ersion)f(2.1)27 +1584 y Fi(\017)j Fn(The)16 b(function)g Fl(type)f Fn(no)o(w)h(returns)g +(the)g(string)f Fl(function)f Fn(b)q(oth)i(for)g(C)g(and)g(Lua)g +(functions.)22 b(Because)72 1640 y(Lua)c(functions)g(and)g(C)g +(functions)f(are)h(compatible,)e(this)i(b)q(eha)o(vior)f(is)g(usually)h +(more)e(useful.)28 b(When)72 1697 y(needed,)20 b(the)e(second)g(result) +g(of)f(function)h Fl(type)f Fn(ma)o(y)f(b)q(e)j(used)g(to)e +(distinguish)g(b)q(et)o(w)o(een)h(Lua)h(and)f(C)72 1753 +y(functions.)27 1847 y Fi(\017)k Fn(A)15 b(function)g(de\014nition)g +(only)g(assigns)f(the)h(function)g(v)m(alue)g(to)g(the)g(giv)o(en)f(v)m +(ariable)h(at)f(execution)h(time.)-42 1969 y Fd(Incompatibilities)21 +b(with)f(v)n(ersion)f(1.1)27 2055 y Fi(\017)j Fn(The)16 +b(equalit)o(y)e(test)g(op)q(erator)h(no)o(w)f(is)h(denoted)h(b)o(y)f +Fl(==)p Fn(,)f(instead)h(of)g Fl(=)p Fn(.)27 2148 y Fi(\017)22 +b Fn(The)13 b(syn)o(tax)f(for)g(table)g(construction)g(has)h(b)q(een)h +(greatly)d(simpli\014ed.)18 b(The)13 b(old)f Fl(@\(size\))g +Fn(has)g(b)q(een)i(sub-)72 2205 y(stituted)h(b)o(y)h +Fl({})p Fn(.)21 b(The)16 b(list)e(constructor)h(\(formerly)e +Fl(@[...])p Fn(\))i(and)h(the)f(record)h(constructor)f(\(formerly)72 +2261 y Fl(@{...})p Fn(\))f(no)o(w)g(are)h(b)q(oth)f(co)q(ded)i(lik)o(e) +e Fl({...})p Fn(.)19 b(When)c(the)g(construction)f(in)o(v)o(olv)o(es)g +(a)g(function)h(call,)e(lik)o(e)72 2318 y(in)i Fl(@func{...})p +Fn(,)e(the)i(new)g(syn)o(tax)f(do)q(es)i(not)e(use)h(the)g +Fl(@)p Fn(.)20 b(More)14 b(imp)q(ortan)o(t,)e Fm(a)17 +b(c)n(onstruction)e(function)72 2374 y(must)i(now)f(explicitly)g(r)n +(eturn)g(the)g(c)n(onstructe)n(d)g(table)p Fn(.)27 2468 +y Fi(\017)22 b Fn(The)16 b(function)f Fl(lua_call)f Fn(no)h(longer)f +(has)h(the)h(parameter)d Fl(nparam)p Fn(.)p -42 2509 +780 2 v 10 2536 a Fh(3)28 2552 y Fg(BTW,)f(Lua)i(means)f +Fe(mo)n(on)f Fg(in)i(P)o(ortuguese.)911 2748 y Fn(26)p +eop +%%Page: 27 27 +27 26 bop 27 199 a Fi(\017)22 b Fn(The)g(function)f Fl(lua_pop)g +Fn(is)g(no)h(longer)e(a)o(v)m(ailable,)i(since)g(it)f(could)g(lead)g +(to)g(strange)g(b)q(eha)o(vior.)39 b(In)72 256 y(particular,)18 +b(to)h(access)g(results)g(returned)g(from)f(a)g(Lua)i(function,)f(the)h +(new)f(macro)e Fl(lua_getresult)72 312 y Fn(should)e(b)q(e)h(used.)27 +406 y Fi(\017)22 b Fn(The)16 b(old)e(functions)h Fl(lua_storefield)f +Fn(and)h Fl(lua_storeindexed)e Fn(ha)o(v)o(e)i(b)q(een)h(replaced)f(b)o +(y)72 518 y Fl(int)24 b(lua_storesubscript)d(\(void\);)72 +631 y Fn(with)15 b(the)g(parameters)e(explicitly)h(pushed)j(on)e(the)g +(stac)o(k.)27 725 y Fi(\017)22 b Fn(The)12 b(functionalit)o(y)e(of)i +(the)g(function)f Fl(lua_errorfunction)f Fn(has)h(b)q(een)i(replaced)f +(b)o(y)g(the)g Fm(fal)r(lb)n(ack)f Fn(mec)o(h-)72 781 +y(anism;)i(see)j(Section)f(4.8.)27 875 y Fi(\017)22 b +Fn(When)16 b(calling)e(a)h(function)h(from)d(the)j(Lua)g(library)l(,)e +(parameters)g(passed)h(through)h(the)f(stac)o(k)g(m)o(ust)f(b)q(e)72 +932 y(pushed)20 b(just)f(b)q(efore)g(the)g(corresp)q(onden)o(t)g(call,) +f(with)g(no)h(in)o(termediate)e(calls)g(to)i(Lua.)31 +b(Sp)q(ecial)19 b(care)72 988 y(should)c(b)q(e)h(tak)o(en)f(with)f +(macros)g(lik)o(e)g Fl(lua_getindexed)f Fn(and)j Fl(lua_getfield)p +Fn(.)911 2748 y(27)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/domake b/domake index 56d5825..16bc8c3 100755 --- a/domake +++ b/domake @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/sh -x # makefile for lua hierarchy +VERSION=2.2 LUA=`pwd` -export LUA +export LUA VERSION cd $LUA/src; make $* cd $LUA/include; make $* diff --git a/include/Makefile b/include/Makefile index 5ef4d4b..e55b771 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,8 +1,15 @@ # makefile for lua distribution +SRCS= lua.h lualib.h luadebug.h + all: +dynamic: + clean: co: - co -M lua.h lualib.h + co -f -M $(SRCS) + +klean: clean + rm -f $(SRCS) diff --git a/include/lua.h b/include/lua.h index 09a0909..4e0a52e 100644 --- a/include/lua.h +++ b/include/lua.h @@ -2,13 +2,18 @@ ** LUA - Linguagem para Usuarios de Aplicacao ** Grupo de Tecnologia em Computacao Grafica ** TeCGraf - PUC-Rio -** $Id: lua.h,v 3.16 1995/01/27 17:19:06 celes Exp $ +** $Id: lua.h,v 3.21 1995/11/13 15:36:52 roberto Exp $ */ #ifndef lua_h #define lua_h +#define LUA_VERSION "Lua 2.2" +#define LUA_COPYRIGHT "Copyright (C) 1994, 1995 TeCGraf" +#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" + + /* Private Part */ typedef enum @@ -19,6 +24,9 @@ typedef enum LUA_T_ARRAY = -4, LUA_T_FUNCTION = -5, LUA_T_CFUNCTION= -6, + LUA_T_MARK = -7, + LUA_T_CMARK = -8, + LUA_T_LINE = -9, LUA_T_USERDATA = 0 } lua_Type; diff --git a/include/luadebug.h b/include/luadebug.h new file mode 100644 index 0000000..c1e26dc --- /dev/null +++ b/include/luadebug.h @@ -0,0 +1,20 @@ +/* +** LUA - Linguagem para Usuarios de Aplicacao +** Grupo de Tecnologia em Computacao Grafica +** TeCGraf - PUC-Rio +** $Id: luadebug.h,v 1.2 1995/10/26 14:21:56 roberto Exp $ +*/ + + +#ifndef luadebug_h +#define luadebug_h + +#include "lua.h" + +lua_Object lua_stackedfunction(int level); +void lua_funcinfo (lua_Object func, char **filename, int *linedefined); +int lua_currentline (lua_Object func); +char *getobjname (lua_Object o, char **name); + + +#endif diff --git a/include/lualib.h b/include/lualib.h index 9ce7e44..d250aa5 100644 --- a/include/lualib.h +++ b/include/lualib.h @@ -2,7 +2,7 @@ ** Libraries to be used in LUA programs ** Grupo de Tecnologia em Computacao Grafica ** TeCGraf - PUC-Rio -** $Id: lualib.h,v 1.3 1994/12/13 15:59:16 roberto Exp $ +** $Id: lualib.h,v 1.4 1995/11/10 17:54:31 roberto Exp $ */ #ifndef lualib_h @@ -12,5 +12,11 @@ void iolib_open (void); void strlib_open (void); void mathlib_open (void); + +/* auxiliar functions (private) */ +void lua_arg_error(char *funcname); +char *lua_check_string (int numArg, char *funcname); +float lua_check_number (int numArg, char *funcname); + #endif diff --git a/src/Makefile b/src/Makefile index 6d1f1bb..f629678 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,12 +10,13 @@ WARN= -Wall -Wmissing-prototypes -Wshadow -ansi CC= gcc CFLAGS= $(INCS) $(DEFS) $(WARN) -O2 -OBJS= fallback.o hash.o inout.o lex.o mem.o opcode.o parser.o table.o tree.o +OBJS= fallback.o func.o hash.o inout.o lex.o mem.o opcode.o parser.o table.o tree.o +SRCS= 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.stx SLIB= $(LIB)/liblua.a # dynamic libraries only work for SunOs -DLIB= $(LIB)/liblua.so.2.1 +DLIB= $(LIB)/liblua.so.$(VERSION) all: $(SLIB) @@ -32,4 +33,8 @@ clean: rm -f $(OBJS) $(SLIB) $(DLIB) co: - co -M fallback.c hash.c inout.c lex.c mem.c opcode.c table.c tree.c fallback.h hash.h inout.h mem.h opcode.h table.h tree.h types.h ugly.h + co -f -M $(SRCS) + yacc -d lua.stx ; mv -f y.tab.c parser.c ; mv -f y.tab.h parser.h + +klean: clean + rm -f $(SRCS) parser.c parser.h diff --git a/src/fallback.c b/src/fallback.c index d5bbbba..aa9fc99 100644 --- a/src/fallback.c +++ b/src/fallback.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_fallback="$Id: fallback.c,v 1.11 1995/02/06 19:34:03 roberto Exp $"; +char *rcs_fallback="$Id: fallback.c,v 1.17 1995/10/17 14:30:05 roberto Exp $"; #include #include @@ -11,7 +11,6 @@ char *rcs_fallback="$Id: fallback.c,v 1.11 1995/02/06 19:34:03 roberto Exp $"; #include "mem.h" #include "fallback.h" #include "opcode.h" -#include "inout.h" #include "lua.h" @@ -29,15 +28,16 @@ static void funcFB (void); ** Warning: This list must be in the same order as the #define's */ struct FB luaI_fallBacks[] = { -{"error", {LUA_T_CFUNCTION, errorFB}}, -{"index", {LUA_T_CFUNCTION, indexFB}}, -{"gettable", {LUA_T_CFUNCTION, gettableFB}}, -{"arith", {LUA_T_CFUNCTION, arithFB}}, -{"order", {LUA_T_CFUNCTION, orderFB}}, -{"concat", {LUA_T_CFUNCTION, concatFB}}, -{"settable", {LUA_T_CFUNCTION, gettableFB}}, -{"gc", {LUA_T_CFUNCTION, GDFB}}, -{"function", {LUA_T_CFUNCTION, funcFB}} +{"error", {LUA_T_CFUNCTION, {errorFB}}, 1, 0}, +{"index", {LUA_T_CFUNCTION, {indexFB}}, 2, 1}, +{"gettable", {LUA_T_CFUNCTION, {gettableFB}}, 2, 1}, +{"arith", {LUA_T_CFUNCTION, {arithFB}}, 3, 1}, +{"order", {LUA_T_CFUNCTION, {orderFB}}, 3, 1}, +{"concat", {LUA_T_CFUNCTION, {concatFB}}, 2, 1}, +{"settable", {LUA_T_CFUNCTION, {gettableFB}}, 3, 0}, +{"gc", {LUA_T_CFUNCTION, {GDFB}}, 1, 0}, +{"function", {LUA_T_CFUNCTION, {funcFB}}, -1, -1} + /* no fixed number of params or results */ }; #define N_FB (sizeof(luaI_fallBacks)/sizeof(struct FB)) @@ -48,10 +48,7 @@ void luaI_setfallback (void) char *name = lua_getstring(lua_getparam(1)); lua_Object func = lua_getparam(2); if (name == NULL || !(lua_isfunction(func) || lua_iscfunction(func))) - { - lua_pushnil(); - return; - } + lua_error("incorrect argument to function `setfallback'"); for (i=0; i + +#include "luadebug.h" +#include "table.h" +#include "mem.h" +#include "func.h" +#include "opcode.h" + +static TFunc *function_root = NULL; + + +/* +** Insert function in list for GC +*/ +void luaI_insertfunction (TFunc *f) +{ + lua_pack(); + f->next = function_root; + function_root = f; + f->marked = 0; +} + + +/* +** Free function +*/ +static void freefunc (TFunc *f) +{ + luaI_free (f->code); + luaI_free (f); +} + +/* +** Garbage collection function. +** This function traverse the function list freeing unindexed functions +*/ +Long luaI_funccollector (void) +{ + TFunc *curr = function_root; + TFunc *prev = NULL; + Long counter = 0; + while (curr) + { + TFunc *next = curr->next; + if (!curr->marked) + { + if (prev == NULL) + function_root = next; + else + prev->next = next; + freefunc (curr); + ++counter; + } + else + { + curr->marked = 0; + prev = curr; + } + curr = next; + } + return counter; +} + + +void lua_funcinfo (lua_Object func, char **filename, int *linedefined) +{ + Object *f = luaI_Address(func); + if (f->tag == LUA_T_MARK || f->tag == LUA_T_FUNCTION) + { + *filename = f->value.tf->fileName; + *linedefined = f->value.tf->lineDefined; + } + else if (f->tag == LUA_T_CMARK || f->tag == LUA_T_CFUNCTION) + { + *filename = "(C)"; + *linedefined = -1; + } +} + diff --git a/src/func.h b/src/func.h new file mode 100644 index 0000000..2723180 --- /dev/null +++ b/src/func.h @@ -0,0 +1,24 @@ +#ifndef func_h +#define func_h + +#include "types.h" +#include "lua.h" + +/* +** Header para funcoes. +*/ +typedef struct TFunc +{ + struct TFunc *next; + char marked; + int size; + Byte *code; + int lineDefined; + char *fileName; +} TFunc; + +Long luaI_funccollector (void); +void luaI_insertfunction (TFunc *f); + + +#endif diff --git a/src/hash.c b/src/hash.c index 2f227d2..e474573 100644 --- a/src/hash.c +++ b/src/hash.c @@ -3,14 +3,13 @@ ** hash manager for lua */ -char *rcs_hash="$Id: hash.c,v 2.24 1995/02/06 19:34:03 roberto Exp $"; +char *rcs_hash="$Id: hash.c,v 2.26 1995/10/04 14:20:26 roberto Exp $"; #include #include "mem.h" #include "opcode.h" #include "hash.h" -#include "inout.h" #include "table.h" #include "lua.h" @@ -54,7 +53,7 @@ static Word hashindex (Hash *t, Object *ref) /* hash function */ switch (tag(ref)) { case LUA_T_NIL: - lua_reportbug ("unexpected type to index table"); + lua_error ("unexpected type to index table"); return -1; /* UNREACHEABLE */ case LUA_T_NUMBER: return (((Word)nvalue(ref))%nhash(t)); @@ -71,7 +70,7 @@ static Word hashindex (Hash *t, Object *ref) /* hash function */ return (Word)h%nhash(t); /* make it a valid index */ } case LUA_T_FUNCTION: - return (((IntPoint)bvalue(ref))%nhash(t)); + return (((IntPoint)ref->value.tf)%nhash(t)); case LUA_T_CFUNCTION: return (((IntPoint)fvalue(ref))%nhash(t)); case LUA_T_ARRAY: @@ -90,7 +89,7 @@ Bool lua_equalObj (Object *t1, Object *t2) case LUA_T_NUMBER: return nvalue(t1) == nvalue(t2); case LUA_T_STRING: return streq(svalue(t1), svalue(t2)); case LUA_T_ARRAY: return avalue(t1) == avalue(t2); - case LUA_T_FUNCTION: return bvalue(t1) == bvalue(t2); + case LUA_T_FUNCTION: return t1->value.tf == t2->value.tf; case LUA_T_CFUNCTION: return fvalue(t1) == fvalue(t2); default: return uvalue(t1) == uvalue(t2); } diff --git a/src/inout.c b/src/inout.c index 7bd7c23..c73030e 100644 --- a/src/inout.c +++ b/src/inout.c @@ -5,7 +5,7 @@ ** Also provides some predefined lua functions. */ -char *rcs_inout="$Id: inout.c,v 2.16 1994/12/20 21:20:36 roberto Exp $"; +char *rcs_inout="$Id: inout.c,v 2.25 1995/10/25 13:05:51 roberto Exp $"; #include #include @@ -19,27 +19,19 @@ char *rcs_inout="$Id: inout.c,v 2.16 1994/12/20 21:20:36 roberto Exp $"; #include "tree.h" #include "lua.h" -/* Exported variables */ -Word lua_linenumber; -Bool lua_debug; -Word lua_debugline = 0; - -/* Internal variables */ - #ifndef MAXFUNCSTACK #define MAXFUNCSTACK 100 #endif - -typedef struct FuncStackNode { - struct FuncStackNode *next; - char *file; - Word function; - Word line; -} FuncStackNode; - -static FuncStackNode *funcStack = NULL; -static Word nfuncstack=0; + +#define MAXMESSAGE MAXFUNCSTACK*80 + + +/* Exported variables */ +Word lua_linenumber; +Bool lua_debug = 0; +char *lua_parsedfile; + static FILE *fp; static char *st; @@ -66,16 +58,23 @@ static int stringinput (void) */ char *lua_openfile (char *fn) { - lua_linenumber = 1; lua_setinput (fileinput); - fp = fopen (fn, "r"); + if (fn == NULL) + { + fp = stdin; + fn = "(stdin)"; + } + else + fp = fopen (fn, "r"); if (fp == NULL) { - static char buff[32]; - sprintf(buff, "unable to open file %.10s", fn); + static char buff[255]; + sprintf(buff, "unable to open file `%.200s'", fn); return buff; } - return lua_addfile (fn); + lua_linenumber = 1; + lua_parsedfile = lua_constcreate(fn)->ts.str; + return NULL; } /* @@ -83,9 +82,8 @@ char *lua_openfile (char *fn) */ void lua_closefile (void) { - if (fp != NULL) + if (fp != NULL && fp != stdin) { - lua_delfile(); fclose (fp); fp = NULL; } @@ -94,16 +92,12 @@ void lua_closefile (void) /* ** Function to open a string to be input unit */ -char *lua_openstring (char *s) +void lua_openstring (char *s) { - lua_linenumber = 1; lua_setinput (stringinput); st = s; - { - char sn[64]; - sprintf (sn, "String: %10.10s...", s); - return lua_addfile (sn); - } + lua_linenumber = 1; + lua_parsedfile = lua_constcreate("(string)")->ts.str; } /* @@ -111,75 +105,6 @@ char *lua_openstring (char *s) */ void lua_closestring (void) { - lua_delfile(); -} - - -/* -** Called to execute SETFUNCTION opcode, this function pushs a function into -** function stack. -*/ -void lua_pushfunction (char *file, Word function) -{ - FuncStackNode *newNode; - if (nfuncstack++ >= MAXFUNCSTACK) - { - lua_reportbug("function stack overflow"); - } - newNode = new(FuncStackNode); - newNode->function = function; - newNode->file = file; - newNode->line= lua_debugline; - newNode->next = funcStack; - funcStack = newNode; -} - -/* -** Called to execute RESET opcode, this function pops a function from -** function stack. -*/ -void lua_popfunction (void) -{ - FuncStackNode *temp = funcStack; - if (temp == NULL) return; - --nfuncstack; - lua_debugline = temp->line; - funcStack = temp->next; - luaI_free(temp); -} - -/* -** Report bug building a message and sending it to lua_error function. -*/ -void lua_reportbug (char *s) -{ - char msg[MAXFUNCSTACK*80]; - strcpy (msg, s); - if (lua_debugline != 0) - { - if (funcStack) - { - FuncStackNode *func = funcStack; - int line = lua_debugline; - sprintf (strchr(msg,0), "\n\tactive stack:\n"); - do - { - sprintf (strchr(msg,0), - "\t-> function \"%s\" at file \"%s\":%u\n", - lua_constant[func->function]->str, func->file, line); - line = func->line; - func = func->next; - lua_popfunction(); - } while (func); - } - else - { - sprintf (strchr(msg,0), - "\n\tin statement begining at line %u of file \"%s\"", - lua_debugline, lua_filename()); - } - } - lua_error (msg); } @@ -218,7 +143,7 @@ void lua_print (void) { if (lua_isnumber(obj)) printf("%g\n",lua_getnumber(obj)); else if (lua_isstring(obj)) printf("%s\n",lua_getstring(obj)); - else if (lua_isfunction(obj)) printf("function: %p\n",bvalue(luaI_Address(obj))); + else if (lua_isfunction(obj)) printf("function: %p\n",(luaI_Address(obj))->value.tf); else if (lua_iscfunction(obj)) printf("cfunction: %p\n",lua_getcfunction(obj) ); else if (lua_isuserdata(obj)) printf("userdata: %p\n",lua_getuserdata(obj)); @@ -235,9 +160,11 @@ void lua_print (void) void luaI_type (void) { lua_Object o = lua_getparam(1); + int t; if (o == LUA_NOOBJECT) lua_error("no parameter to function 'type'"); - switch (lua_type(o)) + t = lua_type(o); + switch (t) { case LUA_T_NIL : lua_pushliteral("nil"); @@ -252,15 +179,14 @@ void luaI_type (void) lua_pushliteral("table"); break; case LUA_T_FUNCTION : - lua_pushliteral("function"); - break; case LUA_T_CFUNCTION : - lua_pushliteral("cfunction"); + lua_pushliteral("function"); break; default : lua_pushliteral("userdata"); break; } + lua_pushnumber(t); } /* @@ -289,6 +215,6 @@ void luaI_error (void) { char *s = lua_getstring(lua_getparam(1)); if (s == NULL) s = "(no message)"; - lua_reportbug(s); + lua_error(s); } diff --git a/src/inout.h b/src/inout.h index 2209302..da9c1cc 100644 --- a/src/inout.h +++ b/src/inout.h @@ -1,5 +1,5 @@ /* -** $Id: inout.h,v 1.7 1994/12/20 21:20:36 roberto Exp $ +** $Id: inout.h,v 1.10 1995/10/17 11:58:41 roberto Exp $ */ @@ -8,17 +8,16 @@ #include "types.h" + extern Word lua_linenumber; extern Bool lua_debug; extern Word lua_debugline; +extern char *lua_parsedfile; char *lua_openfile (char *fn); void lua_closefile (void); -char *lua_openstring (char *s); +void lua_openstring (char *s); void lua_closestring (void); -void lua_pushfunction (char *file, Word function); -void lua_popfunction (void); -void lua_reportbug (char *s); void lua_internaldofile (void); void lua_internaldostring (void); diff --git a/src/lex.c b/src/lex.c index 2916084..da5ec1d 100644 --- a/src/lex.c +++ b/src/lex.c @@ -1,12 +1,12 @@ -char *rcs_lex = "$Id: lex.c,v 2.14 1994/12/27 20:50:38 celes Exp $"; +char *rcs_lex = "$Id: lex.c,v 2.21 1995/11/16 20:46:24 roberto Exp $"; #include -#include #include #include #include +#include "mem.h" #include "tree.h" #include "table.h" #include "opcode.h" @@ -14,6 +14,8 @@ char *rcs_lex = "$Id: lex.c,v 2.14 1994/12/27 20:50:38 celes Exp $"; #include "parser.h" #include "ugly.h" +#define MINBUFF 260 + #define lua_strcmp(a,b) (a[0]b[0]?(1):strcmp(a,b))) #define next() { current = input(); } @@ -21,7 +23,8 @@ char *rcs_lex = "$Id: lex.c,v 2.14 1994/12/27 20:50:38 celes Exp $"; #define save_and_next() { save(current); next(); } static int current; -static char yytext[256]; +static char *yytext = NULL; +static int textsize = 0; static char *yytextLast; static Input input; @@ -30,6 +33,11 @@ void lua_setinput (Input fn) { current = ' '; input = fn; + if (yytext == NULL) + { + textsize = MINBUFF; + yytext = newvector(textsize, char); + } } char *lua_lasttext (void) @@ -85,9 +93,64 @@ static int findReserved (char *name) } +static void growtext (void) +{ + int size = yytextLast - yytext; + textsize *= 2; + yytext = growvector(yytext, textsize, char); + yytextLast = yytext + size; +} + + +static int read_long_string (void) +{ + int cont = 0; + int spaceleft = textsize - (yytextLast - yytext); + while (1) + { + if (spaceleft <= 2) /* may read more than 1 char in one cicle */ + { + growtext(); + spaceleft = textsize - (yytextLast - yytext); + } + switch (current) + { + case EOF: + case 0: + return WRONGTOKEN; + case '[': + save_and_next(); spaceleft--; + if (current == '[') + { + cont++; + save_and_next(); spaceleft--; + } + continue; + case ']': + save_and_next(); spaceleft--; + if (current == ']') + { + if (cont == 0) return STRING; + cont--; + save_and_next(); spaceleft--; + } + continue; + case '\n': + lua_linenumber++; /* goes through */ + default: + save_and_next(); spaceleft--; + } + } +} + + int yylex (void) { float a; + static int linelasttoken = 0; + if (lua_debug) + luaI_codedebugline(linelasttoken); + linelasttoken = lua_linenumber; while (1) { yytextLast = yytext; @@ -99,8 +162,9 @@ int yylex (void) case EOF: case 0: return 0; - case '\n': lua_linenumber++; + case '\n': linelasttoken = ++lua_linenumber; case ' ': + case '\r': /* CR: to avoid problems with DOS/Windows */ case '\t': next(); continue; @@ -124,10 +188,25 @@ int yylex (void) case '-': save_and_next(); - if (current != '-') return '-'; + if (current != '-') return '-'; /* else goes through */ + case '#': do { next(); } while (current != '\n' && current != 0); continue; + case '[': + save_and_next(); + if (current != '[') return '['; + else + { + save_and_next(); /* pass the second '[' */ + if (read_long_string() == WRONGTOKEN) + return WRONGTOKEN; + save_and_next(); /* pass the second ']' */ + *(yytextLast-2) = 0; /* erases ']]' */ + yylval.vWord = luaI_findconstantbyname(yytext+2); + return STRING; + } + case '=': save_and_next(); if (current != '=') return '='; @@ -152,9 +231,16 @@ int yylex (void) case '\'': { int del = current; + int spaceleft = textsize - (yytextLast - yytext); next(); /* skip the delimiter */ while (current != del) { + if (spaceleft <= 2) /* may read more than 1 char in one cicle */ + { + growtext(); + spaceleft = textsize - (yytextLast - yytext); + } + spaceleft--; switch (current) { case EOF: @@ -177,7 +263,7 @@ int yylex (void) } next(); /* skip the delimiter */ *yytextLast = 0; - yylval.vWord = luaI_findconstant(lua_constcreate(yytext)); + yylval.vWord = luaI_findconstantbyname(yytext); return STRING; } diff --git a/src/yacc/lua.stx b/src/lua.stx similarity index 71% rename from src/yacc/lua.stx rename to src/lua.stx index 9c81870..99e9617 100644 --- a/src/yacc/lua.stx +++ b/src/lua.stx @@ -1,6 +1,6 @@ %{ -char *rcs_luastx = "$Id: lua.stx,v 3.17 1995/01/13 22:11:12 roberto Exp $"; +char *rcs_luastx = "$Id: lua.stx,v 3.25 1995/10/26 17:02:50 roberto Exp $"; #include #include @@ -13,6 +13,7 @@ char *rcs_luastx = "$Id: lua.stx,v 3.17 1995/01/13 22:11:12 roberto Exp $"; #include "tree.h" #include "table.h" #include "lua.h" +#include "func.h" /* to avoid warnings generated by yacc */ int yyparse (void); @@ -36,12 +37,14 @@ static Byte *basepc; static int maincode; static int pc; + #define MAXVAR 32 static Long varbuffer[MAXVAR]; /* variables in an assignment list; it's long to store negative Word values */ static int nvarbuffer=0; /* number of variables at a list */ -static Word localvar[STACKGAP]; /* store local variable names */ +#define MAXLOCALS 32 +static Word localvar[MAXLOCALS]; /* store local variable names */ static int nlocalvar=0; /* number of local variables */ #define MAXFIELDS FIELDS_PER_FLUSH*2 @@ -51,6 +54,14 @@ static int nfields=0; /* Internal functions */ +static void yyerror (char *s) +{ + static char msg[256]; + sprintf (msg,"%s near \"%s\" at line %d in file `%s'", + s, lua_lasttext (), lua_linenumber, lua_parsedfile); + lua_error (msg); +} + static void code_byte (Byte c) { if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */ @@ -83,10 +94,10 @@ static void code_float (float n) code_byte(code.m.c4); } -static void code_code (Byte *b) +static void code_code (TFunc *tf) { CodeCode code; - code.b = b; + code.tf = tf; code_byte(code.m.c1); code_byte(code.m.c2); code_byte(code.m.c3); @@ -103,10 +114,10 @@ static void code_word_at (Byte *p, Word n) static void push_field (Word name) { - if (nfields < STACKGAP-1) + if (nfields < MAXFIELDS) fields[nfields++] = name; else - lua_error ("too many fields in a constructor"); + lua_error ("too many fields in nested constructors"); } static void flush_record (int n) @@ -135,18 +146,26 @@ static void flush_list (int m, int n) code_byte(n); } -static void add_nlocalvar (int n) +static void add_localvar (Word name) +{ + if (nlocalvar < MAXLOCALS) + localvar[nlocalvar++] = name; + else + lua_error ("too many local variables"); +} + +static void store_localvar (Word name, int n) { - if (MAX_TEMPS+nlocalvar+MAXVAR+n < STACKGAP) - nlocalvar += n; + if (nlocalvar+n < MAXLOCALS) + localvar[nlocalvar+n] = name; else lua_error ("too many local variables"); } -static void incr_nvarbuffer (void) +static void add_varbuffer (Long var) { - if (nvarbuffer < MAXVAR-1) - nvarbuffer++; + if (nvarbuffer < MAXVAR) + varbuffer[nvarbuffer++] = var; else lua_error ("variable buffer overflow"); } @@ -225,26 +244,35 @@ static void lua_codeadjust (int n) } } -static void init_function (TreeNode *func) +static void change2main (void) { - if (funcCode == NULL) /* first function */ - { - funcCode = newvector(CODE_BLOCK, Byte); - maxcode = CODE_BLOCK; - } - pc=0; basepc=funcCode; maxcurr=maxcode; - nlocalvar=0; - if (lua_debug) + /* (re)store main values */ + pc=maincode; basepc=*initcode; maxcurr=maxmain; + nlocalvar=0; +} + +static void savemain (void) +{ + /* save main values */ + maincode=pc; *initcode=basepc; maxmain=maxcurr; +} + +static void init_func (void) +{ + if (funcCode == NULL) /* first function */ { - code_byte(SETFUNCTION); - code_code((Byte *)luaI_strdup(lua_file[lua_nfile-1])); - code_word(luaI_findconstant(func)); + funcCode = newvector(CODE_BLOCK, Byte); + maxcode = CODE_BLOCK; } + savemain(); /* save main values */ + /* set func values */ + pc=0; basepc=funcCode; maxcurr=maxcode; + nlocalvar = 0; + luaI_codedebugline(lua_linenumber); } static void codereturn (void) { - if (lua_debug) code_byte(RESET); if (nlocalvar == 0) code_byte(RETCODE0); else @@ -254,49 +282,71 @@ static void codereturn (void) } } -static void codedebugline (void) +void luaI_codedebugline (int line) { - if (lua_debug) + static int lastline = 0; + if (lua_debug && line != lastline) { code_byte(SETLINE); - code_word(lua_linenumber); + code_word(line); + lastline = line; } } -static void adjust_mult_assign (int vars, int exps, int temps) +static int adjust_functioncall (Long exp, int i) { - if (exps < 0) + if (exp <= 0) + return -exp; /* exp is -list length */ + else { - int r = vars - (-exps-1); - if (r >= 0) - code_byte(r); + int temp = basepc[exp]; + basepc[exp] = i; + return temp+i; + } +} + +static void adjust_mult_assign (int vars, Long exps, int temps) +{ + if (exps > 0) + { /* must correct function call */ + int diff = vars - basepc[exps]; + if (diff >= 0) + adjust_functioncall(exps, diff); else { - code_byte(0); + adjust_functioncall(exps, 0); lua_codeadjust(temps); } } - else if (vars != exps) + else if (vars != -exps) lua_codeadjust(temps); } -static void lua_codestore (int i) +static void storesinglevar (Long v) { - if (varbuffer[i] > 0) /* global var */ + if (v > 0) /* global var */ { - code_byte(STOREGLOBAL); - code_word(varbuffer[i]-1); + code_byte(STOREGLOBAL); + code_word(v-1); } - else if (varbuffer[i] < 0) /* local var */ + else if (v < 0) /* local var */ { - int number = (-varbuffer[i]) - 1; - if (number < 10) code_byte(STORELOCAL0 + number); - else - { - code_byte(STORELOCAL); - code_byte(number); - } + int number = (-v) - 1; + if (number < 10) code_byte(STORELOCAL0 + number); + else + { + code_byte(STORELOCAL); + code_byte(number); + } } + else + code_byte(STOREINDEXED0); +} + +static void lua_codestore (int i) +{ + if (varbuffer[i] != 0) /* global or local var */ + storesinglevar(varbuffer[i]); else /* indexed var */ { int j; @@ -332,26 +382,22 @@ static void codeIf (Long thenAdd, Long elseAdd) code_word_at(basepc+thenAdd+1,elseinit-(thenAdd+sizeof(Word)+1)); } -static void yyerror (char *s) -{ - static char msg[256]; - sprintf (msg,"%s near \"%s\" at line %d in file \"%s\"", - s, lua_lasttext (), lua_linenumber, lua_filename()); - lua_error (msg); -} - /* ** Parse LUA code. */ -void lua_parse (Byte **code) +void lua_parse (TFunc *tf) { - initcode = code; + lua_debug = 0; + initcode = &(tf->code); *initcode = newvector(CODE_BLOCK, Byte); maincode = 0; maxmain = CODE_BLOCK; + change2main(); if (yyparse ()) lua_error("parse error"); + savemain(); (*initcode)[maincode++] = RETCODE0; + tf->size = maincode; #if LISTING { static void PrintCode (Byte *c, Byte *end); PrintCode(*initcode,*initcode+maincode); } @@ -369,7 +415,7 @@ void lua_parse (Byte **code) char *pChar; Word vWord; Long vLong; - Byte *pByte; + TFunc *pFunc; TreeNode *pNode; } @@ -387,12 +433,17 @@ void lua_parse (Byte **code) %token DEBUG %type PrepJump -%type expr, exprlist, exprlist1, varlist1, funcParams, funcvalue +%type exprlist, exprlist1 /* if > 0, points to function return + counter (which has list length); if <= 0, -list lenght */ +%type functioncall, expr /* if != 0, points to function return + counter */ +%type varlist1, funcParams, funcvalue %type fieldlist, localdeclist, decinit -%type ffieldlist1 -%type lfieldlist1 -%type var, singlevar -%type body +%type ffieldlist, ffieldlist1, semicolonpart +%type lfieldlist, lfieldlist1 +%type parlist +%type var, singlevar, funcname +%type body %left AND OR %left EQ NE '>' '<' LE GE @@ -407,62 +458,48 @@ void lua_parse (Byte **code) functionlist : /* empty */ - | functionlist - { - pc=maincode; basepc=*initcode; maxcurr=maxmain; - nlocalvar=0; - } - stat sc - { - maincode=pc; *initcode=basepc; maxmain=maxcurr; - } + | functionlist globalstat | functionlist function - | functionlist method - | functionlist setdebug ; -function : FUNCTION NAME - { - init_function($2); - } - body +globalstat : stat sc + | setdebug + ; + +function : FUNCTION funcname body { - Word func = luaI_findsymbol($2); - s_tag(func) = LUA_T_FUNCTION; - s_bvalue(func) = $4; + code_byte(PUSHFUNCTION); + code_code($3); + storesinglevar($2); } ; -method : FUNCTION NAME ':' NAME - { - init_function($4); - localvar[nlocalvar]=luaI_findsymbolbyname("self"); - add_nlocalvar(1); - } - body - { - /* assign function to table field */ - pc=maincode; basepc=*initcode; maxcurr=maxmain; - nlocalvar=0; - lua_pushvar(luaI_findsymbol($2)+1); - code_byte(PUSHSTRING); - code_word(luaI_findconstant($4)); - code_byte(PUSHFUNCTION); - code_code($6); - code_byte(STOREINDEXED0); - maincode=pc; *initcode=basepc; maxmain=maxcurr; - } - ; +funcname : var { $$ =$1; init_func(); } + | varexp ':' NAME + { + code_byte(PUSHSTRING); + code_word(luaI_findconstant($3)); + $$ = 0; /* indexed variable */ + init_func(); + add_localvar(luaI_findsymbolbyname("self")); + } + ; body : '(' parlist ')' block END { codereturn(); - $$ = newvector(pc, Byte); - memcpy($$, basepc, pc*sizeof(Byte)); + $$ = new(TFunc); + $$->size = pc; + $$->code = newvector(pc, Byte); + $$->fileName = lua_parsedfile; + $$->lineDefined = $2; + memcpy($$->code, basepc, pc*sizeof(Byte)); + /* save func values */ funcCode = basepc; maxcode=maxcurr; #if LISTING PrintCode(funcCode,funcCode+pc); #endif + change2main(); /* change back to main code */ } ; @@ -472,11 +509,7 @@ statlist : /* empty */ sc : /* empty */ | ';' ; -stat : { codedebugline(); } stat1 ; - -cond : { codedebugline(); } expr1 ; - -stat1 : IF expr1 THEN PrepJump block PrepJump elsepart END +stat : IF expr1 THEN PrepJump block PrepJump elsepart END { codeIf($4, $6); } | WHILE {$$=pc;} expr1 DO PrepJump block PrepJump END @@ -487,7 +520,7 @@ stat1 : IF expr1 THEN PrepJump block PrepJump elsepart END code_word_at(basepc+$7+1, pc - ($2)); } - | REPEAT {$$=pc;} block UNTIL cond PrepJump + | REPEAT {$$=pc;} block UNTIL expr1 PrepJump { basepc[$6] = IFFUPJMP; code_word_at(basepc+$6+1, pc - ($2)); @@ -504,16 +537,16 @@ stat1 : IF expr1 THEN PrepJump block PrepJump elsepart END lua_codeadjust (0); } } - | functioncall { code_byte(0); } + | functioncall | LOCAL localdeclist decinit - { add_nlocalvar($2); + { nlocalvar += $2; adjust_mult_assign($2, $3, 0); - } + } ; elsepart : /* empty */ | ELSE block - | ELSEIF cond THEN PrepJump block PrepJump elsepart + | ELSEIF expr1 THEN PrepJump block PrepJump elsepart { codeIf($4, $6); } ; @@ -528,9 +561,9 @@ block : {$$ = nlocalvar;} statlist ret ; ret : /* empty */ - | RETURN { codedebugline(); } exprlist sc + | RETURN exprlist sc { - if ($3 < 0) code_byte(MULT_RET); + adjust_functioncall($2, MULT_RET); codereturn(); } ; @@ -542,46 +575,46 @@ PrepJump : /* empty */ code_word (0); } -expr1 : expr { if ($1 == 0) code_byte(1); } +expr1 : expr { adjust_functioncall($1, 1); } ; expr : '(' expr ')' { $$ = $2; } - | expr1 EQ expr1 { code_byte(EQOP); $$ = 1; } - | expr1 '<' expr1 { code_byte(LTOP); $$ = 1; } - | expr1 '>' expr1 { code_byte(GTOP); $$ = 1; } - | expr1 NE expr1 { code_byte(EQOP); code_byte(NOTOP); $$ = 1; } - | expr1 LE expr1 { code_byte(LEOP); $$ = 1; } - | expr1 GE expr1 { code_byte(GEOP); $$ = 1; } - | expr1 '+' expr1 { code_byte(ADDOP); $$ = 1; } - | expr1 '-' expr1 { code_byte(SUBOP); $$ = 1; } - | expr1 '*' expr1 { code_byte(MULTOP); $$ = 1; } - | expr1 '/' expr1 { code_byte(DIVOP); $$ = 1; } - | expr1 '^' expr1 { code_byte(POWOP); $$ = 1; } - | expr1 CONC expr1 { code_byte(CONCOP); $$ = 1; } - | '-' expr1 %prec UNARY { code_byte(MINUSOP); $$ = 1;} - | table { $$ = 1; } - | varexp { $$ = 1;} - | NUMBER { code_number($1); $$ = 1; } + | expr1 EQ expr1 { code_byte(EQOP); $$ = 0; } + | expr1 '<' expr1 { code_byte(LTOP); $$ = 0; } + | expr1 '>' expr1 { code_byte(GTOP); $$ = 0; } + | expr1 NE expr1 { code_byte(EQOP); code_byte(NOTOP); $$ = 0; } + | expr1 LE expr1 { code_byte(LEOP); $$ = 0; } + | expr1 GE expr1 { code_byte(GEOP); $$ = 0; } + | expr1 '+' expr1 { code_byte(ADDOP); $$ = 0; } + | expr1 '-' expr1 { code_byte(SUBOP); $$ = 0; } + | expr1 '*' expr1 { code_byte(MULTOP); $$ = 0; } + | expr1 '/' expr1 { code_byte(DIVOP); $$ = 0; } + | expr1 '^' expr1 { code_byte(POWOP); $$ = 0; } + | expr1 CONC expr1 { code_byte(CONCOP); $$ = 0; } + | '-' expr1 %prec UNARY { code_byte(MINUSOP); $$ = 0;} + | table { $$ = 0; } + | varexp { $$ = 0;} + | NUMBER { code_number($1); $$ = 0; } | STRING { code_byte(PUSHSTRING); code_word($1); - $$ = 1; + $$ = 0; } - | NIL {code_byte(PUSHNIL); $$ = 1; } - | functioncall { $$ = 0; } - | NOT expr1 { code_byte(NOTOP); $$ = 1;} + | NIL {code_byte(PUSHNIL); $$ = 0; } + | functioncall { $$ = $1; } + | NOT expr1 { code_byte(NOTOP); $$ = 0;} | expr1 AND PrepJump {code_byte(POP); } expr1 { basepc[$3] = ONFJMP; code_word_at(basepc+$3+1, pc - ($3 + sizeof(Word)+1)); - $$ = 1; + $$ = 0; } | expr1 OR PrepJump {code_byte(POP); } expr1 { basepc[$3] = ONTJMP; code_word_at(basepc+$3+1, pc - ($3 + sizeof(Word)+1)); - $$ = 1; + $$ = 0; } ; @@ -597,7 +630,12 @@ table : ; functioncall : funcvalue funcParams - { code_byte(CALLFUNC); code_byte($1+$2); } + { + code_byte(CALLFUNC); + code_byte($1+$2); + $$ = pc; + code_byte(0); /* may be modified by other rules */ + } ; funcvalue : varexp { $$ = 0; } @@ -610,7 +648,7 @@ funcvalue : varexp { $$ = 0; } ; funcParams : '(' exprlist ')' - { if ($2<0) { code_byte(1); $$ = -$2; } else $$ = $2; } + { $$ = adjust_functioncall($2, 1); } | table { $$ = 1; } ; @@ -618,45 +656,54 @@ exprlist : /* empty */ { $$ = 0; } | exprlist1 { $$ = $1; } ; -exprlist1 : expr { if ($1 == 0) $$ = -1; else $$ = 1; } - | exprlist1 ',' { if ($1 < 0) code_byte(1); } expr +exprlist1 : expr { if ($1 != 0) $$ = $1; else $$ = -1; } + | exprlist1 ',' { $$ = adjust_functioncall($1, 1); } expr { - int r = $1 < 0 ? -$1 : $1; - $$ = ($4 == 0) ? -(r+1) : r+1; + if ($4 == 0) $$ = -($3 + 1); /* -length */ + else + { + adjust_functioncall($4, $3); + $$ = $4; + } } ; -parlist : /* empty */ { lua_codeadjust(0); } - | parlist1 { lua_codeadjust(0); } +parlist : /* empty */ { lua_codeadjust(0); $$ = lua_linenumber; } + | parlist1 { lua_codeadjust(0); $$ = lua_linenumber; } ; parlist1 : NAME { - localvar[nlocalvar]=luaI_findsymbol($1); - add_nlocalvar(1); + add_localvar(luaI_findsymbol($1)); } | parlist1 ',' NAME { - localvar[nlocalvar]=luaI_findsymbol($3); - add_nlocalvar(1); + add_localvar(luaI_findsymbol($3)); } ; -fieldlist : /* empty */ { $$ = 0; } - | lfieldlist1 lastcomma - { $$ = $1; flush_list($1/FIELDS_PER_FLUSH, $1%FIELDS_PER_FLUSH); } +fieldlist : lfieldlist + { flush_list($1/FIELDS_PER_FLUSH, $1%FIELDS_PER_FLUSH); } + semicolonpart + { $$ = $1+$3; } | ffieldlist1 lastcomma { $$ = $1; flush_record($1%FIELDS_PER_FLUSH); } - | lfieldlist1 ';' - { flush_list($1/FIELDS_PER_FLUSH, $1%FIELDS_PER_FLUSH); } - ffieldlist1 lastcomma - { $$ = $1+$4; flush_record($4%FIELDS_PER_FLUSH); } ; +semicolonpart : /* empty */ + { $$ = 0; } + | ';' ffieldlist + { $$ = $2; flush_record($2%FIELDS_PER_FLUSH); } + ; + lastcomma : /* empty */ | ',' ; +ffieldlist : /* empty */ { $$ = 0; } + | ffieldlist1 lastcomma { $$ = $1; } + ; + ffieldlist1 : ffield {$$=1;} | ffieldlist1 ',' ffield { @@ -671,6 +718,10 @@ ffield : NAME '=' expr1 } ; +lfieldlist : /* empty */ { $$ = 0; } + | lfieldlist1 lastcomma { $$ = $1; } + ; + lfieldlist1 : expr1 {$$=1;} | lfieldlist1 ',' expr1 { @@ -683,12 +734,12 @@ lfieldlist1 : expr1 {$$=1;} varlist1 : var { nvarbuffer = 0; - varbuffer[nvarbuffer] = $1; incr_nvarbuffer(); + add_varbuffer($1); $$ = ($1 == 0) ? 1 : 0; } | varlist1 ',' var { - varbuffer[nvarbuffer] = $3; incr_nvarbuffer(); + add_varbuffer($3); $$ = ($3 == 0) ? $1 + 1 : $1; } ; @@ -720,10 +771,10 @@ singlevar : NAME varexp : var { lua_pushvar($1); } ; -localdeclist : NAME {localvar[nlocalvar]=luaI_findsymbol($1); $$ = 1;} +localdeclist : NAME {store_localvar(luaI_findsymbol($1), 0); $$ = 1;} | localdeclist ',' NAME { - localvar[nlocalvar+$1]=luaI_findsymbol($3); + store_localvar(luaI_findsymbol($3), $1); $$ = $1+1; } ; @@ -732,7 +783,8 @@ decinit : /* empty */ { $$ = 0; } | '=' exprlist1 { $$ = $2; } ; -setdebug : DEBUG {lua_debug = $1;} +setdebug : DEBUG { lua_debug = $1; } + ; %% @@ -788,7 +840,7 @@ static void PrintCode (Byte *code, Byte *end) int n = p-code; p++; get_code(c,p); - printf ("%d PUSHFUNCTION %p\n", n, c.b); + printf ("%d PUSHFUNCTION %p\n", n, c.tf); } break; @@ -944,17 +996,6 @@ static void PrintCode (Byte *code, Byte *end) printf ("%d RETCODE %d\n", p-code, *(++p)); p++; break; - case SETFUNCTION: - { - CodeCode c1; - CodeWord c2; - int n = p-code; - p++; - get_code(c1,p); - get_word(c2,p); - printf ("%d SETFUNCTION %s %d\n", n, (char *)c1.b, c2.w); - } - break; case SETLINE: { CodeWord c; @@ -965,7 +1006,6 @@ static void PrintCode (Byte *code, Byte *end) } break; - case RESET: printf ("%d RESET\n", (p++)-code); break; default: printf ("%d Cannot happen: code %d\n", (p++)-code, *(p-1)); break; } } diff --git a/src/opcode.c b/src/opcode.c index 7ce5b2a..e4089f0 100644 --- a/src/opcode.c +++ b/src/opcode.c @@ -3,14 +3,14 @@ ** TecCGraf - PUC-Rio */ -char *rcs_opcode="$Id: opcode.c,v 3.34 1995/02/06 19:35:09 roberto Exp $"; +char *rcs_opcode="$Id: opcode.c,v 3.50 1995/11/16 20:46:24 roberto Exp $"; #include #include #include #include -#include +#include "luadebug.h" #include "mem.h" #include "opcode.h" #include "hash.h" @@ -23,13 +23,15 @@ char *rcs_opcode="$Id: opcode.c,v 3.34 1995/02/06 19:35:09 roberto Exp $"; #define tostring(o) ((tag(o) != LUA_T_STRING) && (lua_tostring(o) != 0)) -#define STACK_BUFFER (STACKGAP+128) +#define STACK_SIZE 128 typedef int StkId; /* index to stack elements */ -static Long maxstack = 0L; -static Object *stack = NULL; -static Object *top = NULL; +static Object initial_stack; + +static Object *stackLimit = &initial_stack+1; +static Object *stack = &initial_stack; +static Object *top = &initial_stack; /* macros to convert from lua_Object to (Object *) and back */ @@ -38,6 +40,11 @@ static Object *top = NULL; #define Ref(st) ((st)-stack+1) +/* macro to increment stack top. There must be always an empty slot in +* the stack +*/ +#define incr_top if (++top >= stackLimit) growstack() + static StkId CBase = 0; /* when Lua calls C or C calls Lua, points to */ /* the first slot after the last parameter. */ static int CnResults = 0; /* when Lua calls C, has the number of parameters; */ @@ -47,7 +54,7 @@ static jmp_buf *errorJmp = NULL; /* current error recover point */ static StkId lua_execute (Byte *pc, StkId base); -static void do_call (Object *func, StkId base, int nResults, StkId whereRes); +static void do_call (StkId base, int nResults); @@ -57,61 +64,40 @@ Object *luaI_Address (lua_Object o) } -/* -** Error messages -*/ - -static void lua_message (char *s) -{ - lua_pushstring(s); - do_call(&luaI_fallBacks[FB_ERROR].function, (top-stack)-1, 0, (top-stack)-1); -} - -/* -** Reports an error, and jumps up to the available recover label -*/ -void lua_error (char *s) -{ - if (s) lua_message(s); - if (errorJmp) - longjmp(*errorJmp, 1); - else - { - fprintf (stderr, "lua: exit(1). Unable to recover\n"); - exit(1); - } -} - /* ** Init stack */ static void lua_initstack (void) { - maxstack = STACK_BUFFER; + Long maxstack = STACK_SIZE; stack = newvector(maxstack, Object); + stackLimit = stack+maxstack; top = stack; + *(top++) = initial_stack; } /* ** Check stack overflow and, if necessary, realloc vector */ -#define lua_checkstack(n) if ((Long)(n) > maxstack) checkstack(n) +#define lua_checkstack(nt) if ((nt) >= stackLimit) growstack() -static void checkstack (StkId n) +static void growstack (void) { - StkId t; - if (stack == NULL) + if (stack == &initial_stack) lua_initstack(); - if (maxstack >= MAX_INT) - lua_error("stack size overflow"); - t = top-stack; - maxstack *= 2; - if (maxstack >= MAX_INT) - maxstack = MAX_INT; - stack = growvector(stack, maxstack, Object); - top = stack + t; + else + { + StkId t = top-stack; + Long maxstack = stackLimit - stack; + maxstack *= 2; + stack = growvector(stack, maxstack, Object); + stackLimit = stack+maxstack; + top = stack + t; + if (maxstack >= MAX_WORD/2) + lua_error("stack size overflow"); + } } @@ -184,15 +170,25 @@ static int lua_tostring (Object *obj) */ static void adjust_top (StkId newtop) { - Object *nt = stack+newtop; + Object *nt; + lua_checkstack(stack+newtop); + nt = stack+newtop; /* warning: previous call may change stack */ while (top < nt) tag(top++) = LUA_T_NIL; top = nt; /* top could be bigger than newtop */ } +#define adjustC(nParams) adjust_top(CBase+nParams) + -static void adjustC (int nParams) +/* +** Open a hole below "nelems" from the top. +*/ +static void open_stack (int nelems) { - adjust_top(CBase+nParams); + int i; + for (i=0; ibase; i--) - stack[i] = stack[i-1]; - top++; - stack[base] = *func; - do_call(&luaI_fallBacks[FB_FUNCTION].function, base, nResults, whereRes); + int nParams = luaI_fallBacks[fb].nParams; + open_stack(nParams); + *(top-nParams-1) = luaI_fallBacks[fb].function; + do_call((top-stack)-nParams, luaI_fallBacks[fb].nResults); } /* ** Call a function (C or Lua). The parameters must be on the stack, -** between [stack+base,top). When returns, the results are on the stack, -** between [stack+whereRes,top). The number of results is nResults, unless -** nResults=MULT_RET. +** between [stack+base,top). The function to be called is at stack+base-1. +** When returns, the results are on the stack, between [stack+base-1,top). +** The number of results is nResults, unless nResults=MULT_RET. */ -static void do_call (Object *func, StkId base, int nResults, StkId whereRes) +static void do_call (StkId base, int nResults) { StkId firstResult; + Object *func = stack+base-1; + int i; if (tag(func) == LUA_T_CFUNCTION) + { + tag(func) = LUA_T_CMARK; firstResult = callC(fvalue(func), base); + } else if (tag(func) == LUA_T_FUNCTION) - firstResult = lua_execute(bvalue(func), base); + { + tag(func) = LUA_T_MARK; + firstResult = lua_execute(func->value.tf->code, base); + } else { /* func is not a function */ - call_funcFB(func, base, nResults, whereRes); + /* Call the fallback for invalid functions */ + open_stack((top-stack)-(base-1)); + stack[base-1] = luaI_fallBacks[FB_FUNCTION].function; + do_call(base, nResults); return; } /* adjust the number of results */ if (nResults != MULT_RET && top - (stack+firstResult) != nResults) adjust_top(firstResult+nResults); - /* move results to the given position */ - if (firstResult != whereRes) - { - int i; - nResults = top - (stack+firstResult); /* actual number of results */ - for (i=0; i= stack; o--) - fn (o); + fn (o); } /* -** Execute a protected call. If function is null compiles the pre-set input. -** Leave nResults on the stack. +** Error messages and debug functions +*/ + +static void lua_message (char *s) +{ + lua_pushstring(s); + callFB(FB_ERROR); +} + +/* +** Reports an error, and jumps up to the available recover label */ -static int do_protectedrun (Object *function, int nResults) +void lua_error (char *s) +{ + if (s) lua_message(s); + if (errorJmp) + longjmp(*errorJmp, 1); + else + { + fprintf (stderr, "lua: exit(1). Unable to recover\n"); + exit(1); + } +} + + +lua_Object lua_stackedfunction (int level) +{ + Object *p = top; + while (--p >= stack) + if (p->tag == LUA_T_MARK || p->tag == LUA_T_CMARK) + if (level-- == 0) + return Ref(p); + return LUA_NOOBJECT; +} + + +int lua_currentline (lua_Object func) +{ + Object *f = Address(func); + return (f+1 < top && (f+1)->tag == LUA_T_LINE) ? (f+1)->value.i : -1; +} + + +/* +** Execute a protected call. Assumes that function is at CBase and +** parameters are on top of it. Leave nResults on the stack. +*/ +static int do_protectedrun (int nResults) { jmp_buf myErrorJmp; int status; @@ -326,13 +371,13 @@ static int do_protectedrun (Object *function, int nResults) errorJmp = &myErrorJmp; if (setjmp(myErrorJmp) == 0) { - do_call(function, CBase, nResults, CBase); + do_call(CBase+1, nResults); CnResults = (top-stack) - CBase; /* number of results */ CBase += CnResults; /* incorporate results on the stack */ status = 0; } else - { + { /* an error occurred: restore CBase and top */ CBase = oldCBase; top = stack+CBase; status = 1; @@ -344,27 +389,30 @@ static int do_protectedrun (Object *function, int nResults) static int do_protectedmain (void) { - Byte *code = NULL; + TFunc tf; int status; - StkId oldCBase = CBase; jmp_buf myErrorJmp; jmp_buf *oldErr = errorJmp; errorJmp = &myErrorJmp; + adjustC(1); /* one slot for the pseudo-function */ + stack[CBase].tag = LUA_T_FUNCTION; + stack[CBase].value.tf = &tf; + tf.lineDefined = 0; + tf.fileName = lua_parsedfile; + tf.code = NULL; if (setjmp(myErrorJmp) == 0) { - Object f; - lua_parse(&code); - tag(&f) = LUA_T_FUNCTION; bvalue(&f) = code; - do_call(&f, CBase, 0, CBase); - status = 0; + lua_parse(&tf); + status = do_protectedrun(0); } else + { status = 1; - if (code) - luaI_free(code); + adjustC(0); /* erase extra slot */ + } errorJmp = oldErr; - CBase = oldCBase; - top = stack+CBase; + if (tf.code) + luaI_free(tf.code); return status; } @@ -377,14 +425,20 @@ int lua_callfunction (lua_Object function) if (function == LUA_NOOBJECT) return 1; else - return do_protectedrun (Address(function), MULT_RET); + { + open_stack((top-stack)-CBase); + stack[CBase] = *Address(function); + return do_protectedrun (MULT_RET); + } } int lua_call (char *funcname) { Word n = luaI_findsymbolbyname(funcname); - return do_protectedrun(&s_object(n), MULT_RET); + open_stack((top-stack)-CBase); + stack[CBase] = s_object(n); + return do_protectedrun(MULT_RET); } @@ -413,12 +467,7 @@ int lua_dofile (char *filename) int lua_dostring (char *string) { int status; - char *message = lua_openstring(string); - if (message) - { - lua_message(message); - return 1; - } + lua_openstring(string); status = do_protectedmain(); lua_closestring(); return status; @@ -430,12 +479,15 @@ int lua_dostring (char *string) */ lua_Object lua_setfallback (char *name, lua_CFunction fallback) { - static Object func = {LUA_T_CFUNCTION, luaI_setfallback}; - adjustC(0); + adjustC(1); /* one slot for the pseudo-function */ + stack[CBase].tag = LUA_T_CFUNCTION; + stack[CBase].value.f = luaI_setfallback; lua_pushstring(name); lua_pushcfunction(fallback); - do_protectedrun(&func, 1); - return (Ref(top-1)); + if (do_protectedrun(1) == 0) + return (Ref(top-1)); + else + return LUA_NOOBJECT; } @@ -497,7 +549,7 @@ lua_Object lua_createtable (void) adjustC(0); avalue(top) = lua_createarray(0); tag(top) = LUA_T_ARRAY; - top++; + incr_top; CBase++; /* incorporate object in the stack */ return Ref(top-1); } @@ -519,9 +571,9 @@ lua_Object lua_getparam (int number) */ real lua_getnumber (lua_Object object) { - if (object == LUA_NOOBJECT || tag(Address(object)) == LUA_T_NIL) return 0.0; + if (object == LUA_NOOBJECT) return 0.0; if (tonumber (Address(object))) return 0.0; - else return (nvalue(Address(object))); + else return (nvalue(Address(object))); } /* @@ -529,7 +581,7 @@ real lua_getnumber (lua_Object object) */ char *lua_getstring (lua_Object object) { - if (object == LUA_NOOBJECT || tag(Address(object)) == LUA_T_NIL) return NULL; + if (object == LUA_NOOBJECT) return NULL; if (tostring (Address(object))) return NULL; else return (svalue(Address(object))); } @@ -559,7 +611,7 @@ lua_Object lua_getlocked (int ref) { adjustC(0); *top = *luaI_getlocked(ref); - top++; + incr_top; CBase++; /* incorporate object in the stack */ return Ref(top-1); } @@ -567,9 +619,8 @@ lua_Object lua_getlocked (int ref) void lua_pushlocked (int ref) { - lua_checkstack(top-stack+1); *top = *luaI_getlocked(ref); - top++; + incr_top; } @@ -580,15 +631,16 @@ int lua_lock (void) } + /* -** Get a global object. Return the object handle or NULL on error. +** Get a global object. */ lua_Object lua_getglobal (char *name) { Word n = luaI_findsymbolbyname(name); adjustC(0); *top = s_object(n); - top++; + incr_top; CBase++; /* incorporate object in the stack */ return Ref(top-1); } @@ -608,8 +660,8 @@ void lua_storeglobal (char *name) */ void lua_pushnil (void) { - lua_checkstack(top-stack+1); - tag(top++) = LUA_T_NIL; + tag(top) = LUA_T_NIL; + incr_top; } /* @@ -617,8 +669,8 @@ void lua_pushnil (void) */ void lua_pushnumber (real n) { - lua_checkstack(top-stack+1); - tag(top) = LUA_T_NUMBER; nvalue(top++) = n; + tag(top) = LUA_T_NUMBER; nvalue(top) = n; + incr_top; } /* @@ -626,10 +678,9 @@ void lua_pushnumber (real n) */ void lua_pushstring (char *s) { - lua_checkstack(top-stack+1); tsvalue(top) = lua_createstring(s); tag(top) = LUA_T_STRING; - top++; + incr_top; } /* @@ -637,10 +688,9 @@ void lua_pushstring (char *s) */ void lua_pushliteral (char *s) { - lua_checkstack(top-stack+1); - tsvalue(top) = lua_constant[luaI_findconstant(lua_constcreate(s))]; + tsvalue(top) = lua_constant[luaI_findconstantbyname(s)]; tag(top) = LUA_T_STRING; - top++; + incr_top; } /* @@ -648,8 +698,8 @@ void lua_pushliteral (char *s) */ void lua_pushcfunction (lua_CFunction fn) { - lua_checkstack(top-stack+1); - tag(top) = LUA_T_CFUNCTION; fvalue(top++) = fn; + tag(top) = LUA_T_CFUNCTION; fvalue(top) = fn; + incr_top; } /* @@ -658,8 +708,8 @@ void lua_pushcfunction (lua_CFunction fn) void lua_pushusertag (void *u, int tag) { if (tag < LUA_T_USERDATA) return; - lua_checkstack(top-stack+1); - tag(top) = tag; uvalue(top++) = u; + tag(top) = tag; uvalue(top) = u; + incr_top; } /* @@ -667,8 +717,8 @@ void lua_pushusertag (void *u, int tag) */ void lua_pushobject (lua_Object o) { - lua_checkstack(top-stack+1); - *top++ = *Address(o); + *top = *Address(o); + incr_top; } /* @@ -676,8 +726,8 @@ void lua_pushobject (lua_Object o) */ void luaI_pushobject (Object *o) { - lua_checkstack(top-stack+1); - *top++ = *o; + *top = *o; + incr_top; } int lua_type (lua_Object o) @@ -691,15 +741,16 @@ int lua_type (lua_Object o) void luaI_gcFB (Object *o) { - *(top++) = *o; - do_call(&luaI_fallBacks[FB_GC].function, (top-stack)-1, 0, (top-stack)-1); + *top = *o; + incr_top; + callFB(FB_GC); } static void call_arith (char *op) { lua_pushstring(op); - do_call(&luaI_fallBacks[FB_ARITH].function, (top-stack)-3, 1, (top-stack)-3); + callFB(FB_ARITH); } static void comparison (lua_Type tag_less, lua_Type tag_equal, @@ -713,7 +764,7 @@ static void comparison (lua_Type tag_less, lua_Type tag_equal, else if (tostring(l) || tostring(r)) { lua_pushstring(op); - do_call(&luaI_fallBacks[FB_ORDER].function, (top-stack)-3, 1, (top-stack)-3); + callFB(FB_ORDER); return; } else @@ -732,26 +783,28 @@ static void comparison (lua_Type tag_less, lua_Type tag_equal, */ static StkId lua_execute (Byte *pc, StkId base) { - lua_checkstack(STACKGAP+MAX_TEMPS+base); while (1) { OpCode opcode; switch (opcode = (OpCode)*pc++) { - case PUSHNIL: tag(top++) = LUA_T_NIL; break; + case PUSHNIL: tag(top) = LUA_T_NIL; incr_top; break; case PUSH0: case PUSH1: case PUSH2: tag(top) = LUA_T_NUMBER; - nvalue(top++) = opcode-PUSH0; + nvalue(top) = opcode-PUSH0; + incr_top; break; - case PUSHBYTE: tag(top) = LUA_T_NUMBER; nvalue(top++) = *pc++; break; + case PUSHBYTE: + tag(top) = LUA_T_NUMBER; nvalue(top) = *pc++; incr_top; break; case PUSHWORD: { CodeWord code; get_word(code,pc); - tag(top) = LUA_T_NUMBER; nvalue(top++) = code.w; + tag(top) = LUA_T_NUMBER; nvalue(top) = code.w; + incr_top; } break; @@ -759,7 +812,8 @@ static StkId lua_execute (Byte *pc, StkId base) { CodeFloat code; get_float(code,pc); - tag(top) = LUA_T_NUMBER; nvalue(top++) = code.f; + tag(top) = LUA_T_NUMBER; nvalue(top) = code.f; + incr_top; } break; @@ -767,7 +821,8 @@ static StkId lua_execute (Byte *pc, StkId base) { CodeWord code; get_word(code,pc); - tag(top) = LUA_T_STRING; tsvalue(top++) = lua_constant[code.w]; + tag(top) = LUA_T_STRING; tsvalue(top) = lua_constant[code.w]; + incr_top; } break; @@ -775,22 +830,27 @@ static StkId lua_execute (Byte *pc, StkId base) { CodeCode code; get_code(code,pc); - tag(top) = LUA_T_FUNCTION; bvalue(top++) = code.b; + luaI_insertfunction(code.tf); /* may take part in GC */ + top->tag = LUA_T_FUNCTION; + top->value.tf = code.tf; + incr_top; } break; case PUSHLOCAL0: case PUSHLOCAL1: case PUSHLOCAL2: case PUSHLOCAL3: case PUSHLOCAL4: case PUSHLOCAL5: case PUSHLOCAL6: case PUSHLOCAL7: case PUSHLOCAL8: - case PUSHLOCAL9: *top++ = *((stack+base) + (int)(opcode-PUSHLOCAL0)); break; + case PUSHLOCAL9: + *top = *((stack+base) + (int)(opcode-PUSHLOCAL0)); incr_top; break; - case PUSHLOCAL: *top++ = *((stack+base) + (*pc++)); break; + case PUSHLOCAL: *top = *((stack+base) + (*pc++)); incr_top; break; case PUSHGLOBAL: { CodeWord code; get_word(code,pc); - *top++ = s_object(code.w); + *top = s_object(code.w); + incr_top; } break; @@ -803,9 +863,11 @@ static StkId lua_execute (Byte *pc, StkId base) Object receiver = *(top-1); CodeWord code; get_word(code,pc); - tag(top) = LUA_T_STRING; tsvalue(top++) = lua_constant[code.w]; + tag(top) = LUA_T_STRING; tsvalue(top) = lua_constant[code.w]; + incr_top; pushsubscript(); - *(top++) = receiver; + *top = receiver; + incr_top; break; } @@ -835,11 +897,12 @@ static StkId lua_execute (Byte *pc, StkId base) int n = *pc++; if (tag(top-3-n) != LUA_T_ARRAY) { + lua_checkstack(top+2); *(top+1) = *(top-1); *(top) = *(top-2-n); *(top-1) = *(top-3-n); top += 2; - do_call(&luaI_fallBacks[FB_SETTABLE].function, (top-stack)-3, 0, (top-stack)-3); + callFB(FB_SETTABLE); } else { @@ -899,7 +962,7 @@ static StkId lua_execute (Byte *pc, StkId base) get_word(size,pc); avalue(top) = lua_createarray(size.w); tag(top) = LUA_T_ARRAY; - top++; + incr_top; } break; @@ -993,7 +1056,7 @@ static StkId lua_execute (Byte *pc, StkId base) Object *l = top-2; Object *r = top-1; if (tostring(r) || tostring(l)) - do_call(&luaI_fallBacks[FB_CONCAT].function, (top-stack)-2, 1, (top-stack)-2); + callFB(FB_CONCAT); else { tsvalue(l) = lua_createstring (lua_strconc(svalue(l),svalue(r))); @@ -1005,7 +1068,8 @@ static StkId lua_execute (Byte *pc, StkId base) case MINUSOP: if (tonumber(top-1)) { - tag(top++) = LUA_T_NIL; + tag(top) = LUA_T_NIL; + incr_top; call_arith("unm"); } else @@ -1073,9 +1137,8 @@ static StkId lua_execute (Byte *pc, StkId base) { int nParams = *(pc++); int nResults = *(pc++); - Object *func = top-1-nParams; /* function is below parameters */ StkId newBase = (top-stack)-nParams; - do_call(func, newBase, nResults, newBase-1); + do_call(newBase, nResults); } break; @@ -1085,27 +1148,20 @@ static StkId lua_execute (Byte *pc, StkId base) case RETCODE: return base+*pc; - case SETFUNCTION: - { - CodeCode file; - CodeWord func; - get_code(file,pc); - get_word(func,pc); - lua_pushfunction ((char *)file.b, func.w); - } - break; - case SETLINE: { CodeWord code; get_word(code,pc); - lua_debugline = code.w; + if ((stack+base-1)->tag != LUA_T_LINE) + { + /* open space for LINE value */ + open_stack((top-stack)-base); + base++; + (stack+base-1)->tag = LUA_T_LINE; + } + (stack+base-1)->value.i = code.w; + break; } - break; - - case RESET: - lua_popfunction (); - break; default: lua_error ("internal error - opcode doesn't match"); diff --git a/src/opcode.h b/src/opcode.h index e3a6d37..5e33c2c 100644 --- a/src/opcode.h +++ b/src/opcode.h @@ -1,6 +1,6 @@ /* ** TeCGraf - PUC-Rio -** $Id: opcode.h,v 3.10 1994/12/20 21:20:36 roberto Exp $ +** $Id: opcode.h,v 3.14 1995/10/25 13:05:51 roberto Exp $ */ #ifndef opcode_h @@ -9,10 +9,7 @@ #include "lua.h" #include "types.h" #include "tree.h" - -#ifndef STACKGAP -#define STACKGAP 128 -#endif +#include "func.h" #ifndef real #define real float @@ -20,8 +17,6 @@ #define FIELDS_PER_FLUSH 40 -#define MAX_TEMPS 20 - typedef enum { @@ -73,9 +68,7 @@ typedef enum CALLFUNC, RETCODE0, RETCODE, - SETFUNCTION, - SETLINE, - RESET + SETLINE } OpCode; #define MULT_RET 255 @@ -89,9 +82,10 @@ typedef union Cfunction f; real n; TaggedString *ts; - Byte *b; + TFunc *tf; struct Hash *a; void *u; + int i; } Value; typedef struct Object @@ -110,7 +104,6 @@ typedef struct #define nvalue(o) ((o)->value.n) #define svalue(o) ((o)->value.ts->str) #define tsvalue(o) ((o)->value.ts) -#define bvalue(o) ((o)->value.b) #define avalue(o) ((o)->value.a) #define fvalue(o) ((o)->value.f) #define uvalue(o) ((o)->value.u) @@ -120,7 +113,6 @@ typedef struct #define s_tag(i) (tag(&s_object(i))) #define s_nvalue(i) (nvalue(&s_object(i))) #define s_svalue(i) (svalue(&s_object(i))) -#define s_bvalue(i) (bvalue(&s_object(i))) #define s_avalue(i) (avalue(&s_object(i))) #define s_fvalue(i) (fvalue(&s_object(i))) #define s_uvalue(i) (uvalue(&s_object(i))) @@ -143,7 +135,7 @@ typedef union typedef union { struct {char c1; char c2; char c3; char c4;} m; - Byte *b; + TFunc *tf; } CodeCode; #define get_code(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\ code.m.c3 = *pc++; code.m.c4 = *pc++;} @@ -155,8 +147,9 @@ char *lua_strdup (char *l); void lua_setinput (Input fn); /* from "lex.c" module */ char *lua_lasttext (void); /* from "lex.c" module */ int yylex (void); /* from "lex.c" module */ -void lua_parse (Byte **code); /* from "lua.stx" module */ -void lua_travstack (void (*fn)(Object *)); +void lua_parse (TFunc *tf); /* from "lua.stx" module */ +void luaI_codedebugline (int line); /* from "lua.stx" module */ +void lua_travstack (int (*fn)(Object *)); Object *luaI_Address (lua_Object o); void luaI_pushobject (Object *o); void luaI_gcFB (Object *o); diff --git a/src/parser.c b/src/parser.c index 47b77fb..6b0dba9 100644 --- a/src/parser.c +++ b/src/parser.c @@ -13,7 +13,7 @@ # line 2 "lua.stx" -char *rcs_luastx = "$Id: lua.stx,v 3.17 1995/01/13 22:11:12 roberto Exp $"; +char *rcs_luastx = "$Id: lua.stx,v 3.25 1995/10/26 17:02:50 roberto Exp $"; #include #include @@ -26,6 +26,7 @@ char *rcs_luastx = "$Id: lua.stx,v 3.17 1995/01/13 22:11:12 roberto Exp $"; #include "tree.h" #include "table.h" #include "lua.h" +#include "func.h" /* to avoid warnings generated by yacc */ int yyparse (void); @@ -49,12 +50,14 @@ static Byte *basepc; static int maincode; static int pc; + #define MAXVAR 32 static Long varbuffer[MAXVAR]; /* variables in an assignment list; it's long to store negative Word values */ static int nvarbuffer=0; /* number of variables at a list */ -static Word localvar[STACKGAP]; /* store local variable names */ +#define MAXLOCALS 32 +static Word localvar[MAXLOCALS]; /* store local variable names */ static int nlocalvar=0; /* number of local variables */ #define MAXFIELDS FIELDS_PER_FLUSH*2 @@ -64,6 +67,14 @@ static int nfields=0; /* Internal functions */ +static void yyerror (char *s) +{ + static char msg[256]; + sprintf (msg,"%s near \"%s\" at line %d in file `%s'", + s, lua_lasttext (), lua_linenumber, lua_parsedfile); + lua_error (msg); +} + static void code_byte (Byte c) { if (pc>maxcurr-2) /* 1 byte free to code HALT of main code */ @@ -96,10 +107,10 @@ static void code_float (float n) code_byte(code.m.c4); } -static void code_code (Byte *b) +static void code_code (TFunc *tf) { CodeCode code; - code.b = b; + code.tf = tf; code_byte(code.m.c1); code_byte(code.m.c2); code_byte(code.m.c3); @@ -116,10 +127,10 @@ static void code_word_at (Byte *p, Word n) static void push_field (Word name) { - if (nfields < STACKGAP-1) + if (nfields < MAXFIELDS) fields[nfields++] = name; else - lua_error ("too many fields in a constructor"); + lua_error ("too many fields in nested constructors"); } static void flush_record (int n) @@ -148,18 +159,26 @@ static void flush_list (int m, int n) code_byte(n); } -static void add_nlocalvar (int n) +static void add_localvar (Word name) { - if (MAX_TEMPS+nlocalvar+MAXVAR+n < STACKGAP) - nlocalvar += n; + if (nlocalvar < MAXLOCALS) + localvar[nlocalvar++] = name; else lua_error ("too many local variables"); } -static void incr_nvarbuffer (void) +static void store_localvar (Word name, int n) { - if (nvarbuffer < MAXVAR-1) - nvarbuffer++; + if (nlocalvar+n < MAXLOCALS) + localvar[nlocalvar+n] = name; + else + lua_error ("too many local variables"); +} + +static void add_varbuffer (Long var) +{ + if (nvarbuffer < MAXVAR) + varbuffer[nvarbuffer++] = var; else lua_error ("variable buffer overflow"); } @@ -238,26 +257,35 @@ static void lua_codeadjust (int n) } } -static void init_function (TreeNode *func) +static void change2main (void) { - if (funcCode == NULL) /* first function */ - { - funcCode = newvector(CODE_BLOCK, Byte); - maxcode = CODE_BLOCK; - } - pc=0; basepc=funcCode; maxcurr=maxcode; - nlocalvar=0; - if (lua_debug) + /* (re)store main values */ + pc=maincode; basepc=*initcode; maxcurr=maxmain; + nlocalvar=0; +} + +static void savemain (void) +{ + /* save main values */ + maincode=pc; *initcode=basepc; maxmain=maxcurr; +} + +static void init_func (void) +{ + if (funcCode == NULL) /* first function */ { - code_byte(SETFUNCTION); - code_code((Byte *)luaI_strdup(lua_file[lua_nfile-1])); - code_word(luaI_findconstant(func)); + funcCode = newvector(CODE_BLOCK, Byte); + maxcode = CODE_BLOCK; } + savemain(); /* save main values */ + /* set func values */ + pc=0; basepc=funcCode; maxcurr=maxcode; + nlocalvar = 0; + luaI_codedebugline(lua_linenumber); } static void codereturn (void) { - if (lua_debug) code_byte(RESET); if (nlocalvar == 0) code_byte(RETCODE0); else @@ -267,49 +295,71 @@ static void codereturn (void) } } -static void codedebugline (void) +void luaI_codedebugline (int line) { - if (lua_debug) + static int lastline = 0; + if (lua_debug && line != lastline) { code_byte(SETLINE); - code_word(lua_linenumber); + code_word(line); + lastline = line; } } -static void adjust_mult_assign (int vars, int exps, int temps) +static int adjust_functioncall (Long exp, int i) { - if (exps < 0) + if (exp <= 0) + return -exp; /* exp is -list length */ + else { - int r = vars - (-exps-1); - if (r >= 0) - code_byte(r); + int temp = basepc[exp]; + basepc[exp] = i; + return temp+i; + } +} + +static void adjust_mult_assign (int vars, Long exps, int temps) +{ + if (exps > 0) + { /* must correct function call */ + int diff = vars - basepc[exps]; + if (diff >= 0) + adjust_functioncall(exps, diff); else { - code_byte(0); + adjust_functioncall(exps, 0); lua_codeadjust(temps); } } - else if (vars != exps) + else if (vars != -exps) lua_codeadjust(temps); } -static void lua_codestore (int i) +static void storesinglevar (Long v) { - if (varbuffer[i] > 0) /* global var */ + if (v > 0) /* global var */ { - code_byte(STOREGLOBAL); - code_word(varbuffer[i]-1); + code_byte(STOREGLOBAL); + code_word(v-1); } - else if (varbuffer[i] < 0) /* local var */ + else if (v < 0) /* local var */ { - int number = (-varbuffer[i]) - 1; - if (number < 10) code_byte(STORELOCAL0 + number); - else - { - code_byte(STORELOCAL); - code_byte(number); - } + int number = (-v) - 1; + if (number < 10) code_byte(STORELOCAL0 + number); + else + { + code_byte(STORELOCAL); + code_byte(number); + } } + else + code_byte(STOREINDEXED0); +} + +static void lua_codestore (int i) +{ + if (varbuffer[i] != 0) /* global or local var */ + storesinglevar(varbuffer[i]); else /* indexed var */ { int j; @@ -345,26 +395,22 @@ static void codeIf (Long thenAdd, Long elseAdd) code_word_at(basepc+thenAdd+1,elseinit-(thenAdd+sizeof(Word)+1)); } -static void yyerror (char *s) -{ - static char msg[256]; - sprintf (msg,"%s near \"%s\" at line %d in file \"%s\"", - s, lua_lasttext (), lua_linenumber, lua_filename()); - lua_error (msg); -} - /* ** Parse LUA code. */ -void lua_parse (Byte **code) +void lua_parse (TFunc *tf) { - initcode = code; + lua_debug = 0; + initcode = &(tf->code); *initcode = newvector(CODE_BLOCK, Byte); maincode = 0; maxmain = CODE_BLOCK; + change2main(); if (yyparse ()) lua_error("parse error"); + savemain(); (*initcode)[maincode++] = RETCODE0; + tf->size = maincode; #if LISTING { static void PrintCode (Byte *c, Byte *end); PrintCode(*initcode,*initcode+maincode); } @@ -373,7 +419,7 @@ void lua_parse (Byte **code) -# line 365 "lua.stx" +# line 411 "lua.stx" typedef union { int vInt; @@ -381,7 +427,7 @@ typedef union char *pChar; Word vWord; Long vLong; - Byte *pByte; + TFunc *pFunc; TreeNode *pNode; } YYSTYPE; # define WRONGTOKEN 257 @@ -421,7 +467,7 @@ extern int yyerrflag; YYSTYPE yylval, yyval; # define YYERRCODE 256 -# line 737 "lua.stx" +# line 789 "lua.stx" #if LISTING @@ -476,7 +522,7 @@ static void PrintCode (Byte *code, Byte *end) int n = p-code; p++; get_code(c,p); - printf ("%d PUSHFUNCTION %p\n", n, c.b); + printf ("%d PUSHFUNCTION %p\n", n, c.tf); } break; @@ -632,17 +678,6 @@ static void PrintCode (Byte *code, Byte *end) printf ("%d RETCODE %d\n", p-code, *(++p)); p++; break; - case SETFUNCTION: - { - CodeCode c1; - CodeWord c2; - int n = p-code; - p++; - get_code(c1,p); - get_word(c2,p); - printf ("%d SETFUNCTION %s %d\n", n, (char *)c1.b, c2.w); - } - break; case SETLINE: { CodeWord c; @@ -653,7 +688,6 @@ static void PrintCode (Byte *code, Byte *end) } break; - case RESET: printf ("%d RESET\n", (p++)-code); break; default: printf ("%d Cannot happen: code %d\n", (p++)-code, *(p-1)); break; } } @@ -663,203 +697,194 @@ static void PrintCode (Byte *code, Byte *end) int yyexca[] ={ -1, 1, 0, -1, - -2, 2, --1, 20, - 61, 91, - 44, 91, - -2, 97, --1, 32, - 40, 66, - 123, 66, - -2, 53, --1, 47, - 123, 63, - -2, 70, --1, 74, - 125, 79, + -2, 0, +-1, 14, + 61, 88, + 44, 88, + -2, 94, +-1, 22, + 40, 7, + -2, 94, +-1, 29, + 40, 59, + 123, 59, + -2, 46, +-1, 44, + 123, 56, -2, 63, --1, 79, - 275, 37, - 276, 37, - 277, 37, - 278, 37, - 62, 37, - 60, 37, - 279, 37, - 280, 37, - 281, 37, - 43, 37, - 45, 37, - 42, 37, - 47, 37, - 94, 37, - -2, 72, --1, 80, - 91, 97, - 46, 97, - -2, 92, --1, 118, - 261, 33, - 262, 33, - 266, 33, - 267, 33, - -2, 16, --1, 133, - 125, 85, +-1, 71, + 123, 56, + -2, 84, +-1, 76, + 275, 30, + 276, 30, + 277, 30, + 278, 30, + 62, 30, + 60, 30, + 279, 30, + 280, 30, + 281, 30, + 43, 30, + 45, 30, + 42, 30, + 47, 30, + 94, 30, + -2, 65, +-1, 77, + 91, 94, + 46, 94, + -2, 89, +-1, 132, + 123, 56, + -2, 78, +-1, 138, + 123, 56, -2, 63, --1, 158, - 123, 63, - -2, 70, --1, 159, - 275, 37, - 276, 37, - 277, 37, - 278, 37, - 62, 37, - 60, 37, - 279, 37, - 280, 37, - 281, 37, - 43, 37, - 45, 37, - 42, 37, - 47, 37, - 94, 37, - -2, 74, +-1, 155, + 275, 30, + 276, 30, + 277, 30, + 278, 30, + 62, 30, + 60, 30, + 279, 30, + 280, 30, + 281, 30, + 43, 30, + 45, 30, + 42, 30, + 47, 30, + 94, 30, + -2, 67, }; -# define YYNPROD 103 -# define YYLAST 351 +# define YYNPROD 100 +# define YYLAST 311 int yyact[]={ - 64, 62, 6, 63, 152, 65, 7, 64, 62, 145, - 63, 120, 65, 92, 64, 62, 89, 63, 57, 65, - 58, 64, 62, 87, 63, 57, 65, 58, 64, 62, - 24, 63, 57, 65, 58, 64, 62, 54, 63, 57, - 65, 58, 45, 10, 29, 142, 57, 171, 58, 30, - 29, 123, 66, 167, 14, 30, 160, 117, 15, 66, - 16, 162, 163, 173, 19, 131, 66, 138, 24, 28, - 112, 114, 130, 66, 74, 71, 8, 64, 66, 52, - 66, 86, 65, 51, 161, 83, 51, 66, 43, 136, - 27, 12, 64, 62, 26, 63, 133, 65, 49, 70, - 135, 119, 84, 125, 124, 42, 72, 122, 109, 32, - 53, 132, 79, 73, 85, 39, 75, 79, 47, 23, - 149, 91, 143, 31, 78, 20, 88, 38, 50, 66, - 11, 50, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 66, 48, 36, 129, 128, 158, - 113, 141, 94, 81, 79, 77, 18, 41, 40, 80, - 139, 13, 9, 118, 90, 93, 121, 25, 5, 4, - 3, 2, 22, 126, 111, 76, 82, 44, 134, 110, - 21, 46, 17, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 147, 148, 0, 151, 0, 150, - 0, 0, 153, 159, 0, 156, 0, 0, 0, 0, - 164, 107, 108, 0, 0, 0, 0, 0, 79, 116, - 170, 169, 55, 68, 69, 56, 59, 60, 61, 67, - 68, 69, 56, 59, 60, 61, 67, 68, 69, 56, - 59, 60, 61, 67, 68, 69, 56, 59, 60, 61, - 67, 177, 35, 56, 59, 60, 61, 67, 35, 137, - 127, 157, 0, 166, 67, 33, 34, 24, 0, 0, - 146, 33, 34, 115, 0, 0, 0, 37, 0, 0, - 0, 155, 0, 37, 0, 0, 0, 172, 0, 0, - 144, 0, 0, 0, 0, 0, 0, 165, 0, 0, - 0, 0, 0, 154, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 174, 0, 176, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 168, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 175 }; + 61, 59, 148, 60, 141, 62, 118, 61, 59, 90, + 60, 89, 62, 86, 84, 18, 42, 168, 54, 164, + 55, 61, 59, 156, 60, 54, 62, 55, 61, 59, + 115, 60, 73, 62, 157, 61, 59, 19, 60, 54, + 62, 55, 61, 59, 82, 60, 54, 62, 55, 158, + 159, 129, 63, 54, 91, 55, 111, 25, 121, 63, + 54, 109, 55, 127, 26, 61, 59, 26, 60, 27, + 62, 7, 27, 63, 71, 8, 33, 9, 11, 63, + 63, 12, 6, 80, 67, 18, 13, 63, 68, 7, + 48, 40, 4, 8, 63, 9, 24, 76, 138, 12, + 81, 133, 76, 18, 61, 59, 61, 60, 39, 62, + 20, 62, 146, 130, 117, 132, 69, 63, 123, 48, + 104, 105, 122, 70, 124, 120, 72, 106, 48, 50, + 29, 46, 17, 44, 128, 47, 85, 23, 83, 76, + 51, 28, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 88, 140, 63, 45, 63, 36, + 112, 14, 131, 139, 47, 35, 22, 151, 126, 134, + 125, 78, 137, 47, 153, 74, 38, 37, 75, 142, + 116, 5, 3, 154, 2, 49, 21, 147, 16, 87, + 152, 165, 163, 11, 110, 108, 76, 155, 145, 160, + 77, 79, 41, 171, 135, 107, 162, 173, 161, 136, + 15, 43, 10, 167, 143, 144, 1, 0, 169, 0, + 119, 149, 150, 0, 170, 0, 172, 0, 0, 0, + 0, 0, 0, 65, 66, 53, 56, 57, 58, 64, + 65, 66, 53, 56, 57, 58, 64, 17, 166, 0, + 114, 0, 0, 52, 65, 66, 53, 56, 57, 58, + 64, 65, 66, 53, 56, 57, 58, 64, 65, 66, + 53, 56, 57, 58, 64, 0, 14, 53, 56, 57, + 58, 64, 32, 0, 0, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 31, 18, 30, 31, + 113, 0, 0, 0, 64, 0, 0, 34, 0, 0, + 34 }; int yypact[]={ - -1000, -268, -1000, -1000, -1000, -1000, -230, -1000, 32, -205, - 36, -1000, -1000, -1000, 4, -1000, -1000, 44, -1000, -231, - -1000, 78, -1000, 40, -1000, 70, -236, -28, -1000, 4, - 4, -1000, 40, -1000, -1000, -1000, -1000, 4, -49, -1000, - 4, -1000, 4, -243, 41, -1000, -1000, 4, -1000, -250, - 4, -257, -1000, -260, -1000, -1000, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, -1000, -1000, - 67, -21, -16, -16, 10, -35, -209, -1000, 57, -1000, - -1000, 37, -1000, -262, 4, 66, 57, -1000, -42, -1000, - 63, 59, -1000, 70, -1000, -7, -7, -7, -7, -7, - -7, 35, 35, -16, -16, -16, 50, -1000, -1000, -1000, - -53, 52, 56, -21, -1000, 28, -1000, -1000, -223, -1000, - -1000, 57, -1000, -1000, -1000, -264, -1000, -1000, 4, 4, - -1000, -1000, -1000, 4, -1000, -269, 4, -1000, -1000, 4, - 32, -1000, -1000, 4, -211, -1000, -200, -14, -14, -269, - -21, -1000, 28, -21, -1000, -1000, -21, -1000, 4, -1000, - -1000, -214, -1000, -1000, 56, -220, 32, -1000, -1000, -197, - -1000, -1000, -1000, -1000, -1000, -1000, -200, -1000 }; + -1000, -188, -1000, -1000, 51, -1000, -258, 24, -1000, -1000, + 47, -1000, -257, -1000, -1000, 93, -1000, 73, -1000, -1000, + -1000, 89, -1000, 82, -7, -1000, 24, 24, -1000, 73, + -1000, -1000, -1000, -1000, 24, -49, -1000, 24, -1000, 24, + -258, 39, -1000, -1000, 24, -1000, -259, 24, -260, -1000, + -262, -264, -1000, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, -1000, -1000, 86, -21, -15, + -15, 27, -14, -236, -1000, 70, -1000, -1000, 44, -1000, + -267, 24, 84, 70, -1000, -35, -1000, 81, 74, -1000, + -1000, -1000, 23, 23, 23, 23, 23, 23, 64, 64, + -15, -15, -15, 62, -1000, -1000, -1000, -62, -1000, 69, + 71, -1000, -21, 40, -1000, 24, -170, -1000, -1000, 70, + -1000, -1000, -1000, -269, -1000, 24, 24, -1000, 53, -1000, + -271, -1000, 24, 24, -1000, -21, 51, -1000, 24, 24, + -244, -1000, -212, 0, 0, -1000, -271, -1000, 40, -21, + -21, -1000, -1000, -1000, 51, -1000, -1000, -248, -1000, 24, + -1000, 69, -250, -1000, -1000, -1000, -42, -1000, -1000, -1000, + -1000, -1000, -212, -1000 }; int yypgo[]={ - 0, 183, 152, 69, 114, 81, 182, 181, 180, 179, - 177, 176, 70, 174, 115, 172, 79, 171, 76, 130, - 170, 169, 168, 167, 165, 164, 175, 163, 162, 161, - 67, 160, 75, 84, 158, 157, 146, 155, 151, 149, - 123, 109, 148, 147, 127, 122, 121, 65, 120, 71 }; + 0, 216, 54, 44, 138, 76, 57, 212, 211, 210, + 205, 202, 201, 199, 61, 198, 195, 194, 189, 159, + 188, 186, 185, 184, 182, 92, 37, 181, 130, 32, + 180, 88, 34, 177, 176, 175, 172, 141, 170, 168, + 165, 163, 154, 134, 51, 56 }; int yyr1[]={ - 0, 1, 17, 1, 1, 1, 1, 23, 20, 24, - 21, 16, 27, 27, 19, 19, 28, 18, 31, 30, - 29, 34, 29, 35, 29, 29, 29, 29, 33, 33, - 33, 37, 26, 38, 39, 38, 2, 32, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 42, - 3, 43, 3, 44, 40, 36, 8, 8, 7, 7, - 4, 4, 5, 45, 5, 25, 25, 46, 46, 9, - 9, 9, 48, 9, 47, 47, 12, 12, 49, 13, - 13, 6, 6, 14, 14, 14, 15, 41, 10, 10, - 11, 11, 22 }; + 0, 1, 1, 1, 23, 23, 24, 21, 21, 22, + 30, 30, 26, 26, 25, 33, 25, 34, 25, 25, + 25, 25, 32, 32, 32, 35, 29, 36, 36, 2, + 31, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 38, 6, 39, 6, 40, 37, 5, 9, + 9, 8, 8, 3, 3, 4, 41, 4, 18, 18, + 42, 42, 43, 10, 10, 15, 15, 44, 44, 13, + 13, 14, 14, 45, 16, 16, 17, 17, 7, 7, + 19, 19, 19, 20, 28, 11, 11, 12, 12, 27 }; int yyr2[]={ - 0, 0, 1, 9, 4, 4, 4, 1, 9, 1, - 13, 11, 0, 6, 0, 2, 1, 4, 1, 4, - 17, 1, 17, 1, 13, 7, 3, 7, 0, 4, - 15, 1, 7, 0, 1, 9, 1, 3, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 5, 3, 3, 3, 3, 3, 3, 5, 1, - 11, 1, 11, 1, 9, 5, 3, 7, 7, 3, - 1, 3, 3, 1, 9, 1, 3, 3, 7, 1, - 5, 5, 1, 11, 0, 2, 3, 7, 7, 3, - 7, 3, 7, 3, 9, 7, 3, 3, 3, 7, - 1, 5, 3 }; + 0, 0, 4, 4, 4, 2, 7, 3, 7, 11, + 0, 6, 0, 2, 17, 1, 17, 1, 13, 7, + 2, 7, 0, 4, 15, 1, 7, 0, 7, 1, + 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 5, 3, 3, 3, 3, 3, + 3, 5, 1, 11, 1, 11, 1, 9, 5, 3, + 7, 7, 3, 1, 3, 3, 1, 9, 1, 3, + 3, 7, 1, 7, 5, 1, 5, 0, 2, 1, + 5, 3, 7, 7, 1, 5, 3, 7, 3, 7, + 3, 9, 7, 3, 3, 3, 7, 1, 5, 3 }; int yychk[]={ - -1000, -1, -17, -20, -21, -22, 270, 274, -18, -28, - 273, -19, 59, -29, 259, 263, 265, -6, -36, 269, - -14, -8, -15, -41, 273, -23, 58, -32, -3, 40, - 45, -40, -41, 271, 272, 258, -36, 283, -44, -14, - -34, -35, 61, 44, -10, 273, -7, 40, -40, 58, - 91, 46, -16, 40, 273, 260, 277, 60, 62, 278, - 279, 280, 43, 45, 42, 47, 94, 281, 275, 276, - -3, -32, -32, -32, 123, -32, -26, -37, -5, -3, - -14, -41, -11, 44, 61, -4, -5, 273, -32, 273, - -25, -46, 273, -24, -2, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -2, -2, 41, - -9, -13, -12, -32, -49, 273, 264, 266, -27, 44, - 273, -5, 41, 93, 41, 44, -16, -26, -42, -43, - 125, -47, 59, 44, -47, 44, 61, -2, -30, -31, - -18, -38, 268, -45, -26, 273, -2, -32, -32, -48, - -32, -49, 273, -32, -26, -2, -32, -19, -39, -3, - 267, -33, 261, 262, -12, -2, -4, 267, -26, -30, - -47, 267, -19, 260, -2, -26, -2, -33 }; + -1000, -1, -23, -24, -25, -27, 270, 259, 263, 265, + -7, -5, 269, 274, -19, -9, -20, -28, 273, -26, + 59, -21, -19, -28, -31, -6, 40, 45, -37, -28, + 271, 272, 258, -5, 283, -40, -19, -33, -34, 61, + 44, -11, 273, -8, 40, -37, 58, 91, 46, -22, + 40, 58, 260, 277, 60, 62, 278, 279, 280, 43, + 45, 42, 47, 94, 281, 275, 276, -6, -31, -31, + -31, 123, -31, -29, -35, -4, -6, -19, -28, -12, + 44, 61, -3, -4, 273, -31, 273, -18, -42, 273, + 273, -2, -31, -31, -31, -31, -31, -31, -31, -31, + -31, -31, -31, -31, -2, -2, 41, -10, -16, -14, + -17, -45, -31, 273, 264, 266, -30, 44, 273, -4, + 41, 93, 41, 44, -29, -38, -39, 125, -43, -44, + 44, -44, 44, 61, -2, -31, -25, -36, 268, -41, + -29, 273, -2, -31, -31, -15, 59, -45, 273, -31, + -31, -29, -2, -26, -3, -6, 267, -32, 261, 262, + -13, -14, -2, -26, 267, -29, -31, -44, 267, 260, + -2, -29, -2, -32 }; int yydef[]={ - 1, -2, 16, 4, 5, 6, 0, 102, 14, 0, - 7, 3, 15, 17, 63, 21, 23, 0, 26, 0, - -2, 63, 93, 66, 96, 0, 0, 0, 37, 63, - 63, 52, -2, 54, 55, 56, 57, 63, 0, 97, - 63, 31, 63, 0, 100, 98, 65, -2, 69, 0, - 63, 0, 8, 75, 9, 36, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 36, 36, - 37, 0, 51, 58, -2, 0, 0, 12, 25, -2, - -2, 0, 27, 0, 63, 0, 71, 67, 0, 95, - 0, 76, 77, 0, 31, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 59, 61, 38, - 0, 84, 84, 89, 86, 96, 36, 18, -2, 73, - 99, 101, 68, 94, 31, 0, 10, 36, 63, 63, - 64, 80, 82, -2, 81, 85, 63, 31, 36, 63, - 14, 32, 34, 63, 0, 78, 28, 60, 62, 0, - 90, 87, 0, 88, 36, 24, 19, 13, -2, -2, - 11, 0, 31, 18, 84, 0, 14, 20, 29, 0, - 83, 22, 35, 36, 31, 36, 28, 30 }; + 1, -2, 2, 3, 12, 5, 0, 56, 15, 17, + 0, 20, 0, 99, -2, 56, 90, 59, 93, 4, + 13, 0, -2, 0, 0, 30, 56, 56, 45, -2, + 47, 48, 49, 50, 56, 0, 94, 56, 25, 56, + 0, 97, 95, 58, -2, 62, 0, 56, 0, 6, + 68, 0, 29, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 29, 29, 30, 0, 44, + 51, -2, 0, 0, 10, 19, -2, -2, 0, 21, + 0, 56, 0, 64, 60, 0, 92, 0, 69, 70, + 8, 25, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 52, 54, 31, 0, 72, 77, + 77, 81, 86, 93, 29, 56, 27, 66, 96, 98, + 61, 91, 25, 0, 29, 56, 56, 57, 75, 74, + 78, 85, -2, 56, 25, 29, 12, 26, -2, 56, + 0, 71, 22, 53, 55, 73, 79, 82, 0, 87, + 83, 29, 18, 11, 12, -2, 9, 0, 25, 56, + 76, 77, 0, 28, 14, 23, 0, 80, 16, 29, + 25, 29, 22, 24 }; typedef struct { char *t_name; int t_val; } yytoktype; #ifndef YYDEBUG # define YYDEBUG 0 /* don't allow debugging */ @@ -910,39 +935,32 @@ char * yyreds[] = { "-no such reduction-", "functionlist : /* empty */", - "functionlist : functionlist", - "functionlist : functionlist stat sc", + "functionlist : functionlist globalstat", "functionlist : functionlist function", - "functionlist : functionlist method", - "functionlist : functionlist setdebug", - "function : FUNCTION NAME", - "function : FUNCTION NAME body", - "method : FUNCTION NAME ':' NAME", - "method : FUNCTION NAME ':' NAME body", + "globalstat : stat sc", + "globalstat : setdebug", + "function : FUNCTION funcname body", + "funcname : var", + "funcname : varexp ':' NAME", "body : '(' parlist ')' block END", "statlist : /* empty */", "statlist : statlist stat sc", "sc : /* empty */", "sc : ';'", - "stat : /* empty */", - "stat : stat1", - "cond : /* empty */", - "cond : expr1", - "stat1 : IF expr1 THEN PrepJump block PrepJump elsepart END", - "stat1 : WHILE", - "stat1 : WHILE expr1 DO PrepJump block PrepJump END", - "stat1 : REPEAT", - "stat1 : REPEAT block UNTIL cond PrepJump", - "stat1 : varlist1 '=' exprlist1", - "stat1 : functioncall", - "stat1 : LOCAL localdeclist decinit", + "stat : IF expr1 THEN PrepJump block PrepJump elsepart END", + "stat : WHILE", + "stat : WHILE expr1 DO PrepJump block PrepJump END", + "stat : REPEAT", + "stat : REPEAT block UNTIL expr1 PrepJump", + "stat : varlist1 '=' exprlist1", + "stat : functioncall", + "stat : LOCAL localdeclist decinit", "elsepart : /* empty */", "elsepart : ELSE block", - "elsepart : ELSEIF cond THEN PrepJump block PrepJump elsepart", + "elsepart : ELSEIF expr1 THEN PrepJump block PrepJump elsepart", "block : /* empty */", "block : statlist ret", "ret : /* empty */", - "ret : RETURN", "ret : RETURN exprlist sc", "PrepJump : /* empty */", "expr1 : expr", @@ -987,16 +1005,20 @@ char * yyreds[] = "parlist : parlist1", "parlist1 : NAME", "parlist1 : parlist1 ',' NAME", - "fieldlist : /* empty */", - "fieldlist : lfieldlist1 lastcomma", + "fieldlist : lfieldlist", + "fieldlist : lfieldlist semicolonpart", "fieldlist : ffieldlist1 lastcomma", - "fieldlist : lfieldlist1 ';'", - "fieldlist : lfieldlist1 ';' ffieldlist1 lastcomma", + "semicolonpart : /* empty */", + "semicolonpart : ';' ffieldlist", "lastcomma : /* empty */", "lastcomma : ','", + "ffieldlist : /* empty */", + "ffieldlist : ffieldlist1 lastcomma", "ffieldlist1 : ffield", "ffieldlist1 : ffieldlist1 ',' ffield", "ffield : NAME '=' expr1", + "lfieldlist : /* empty */", + "lfieldlist : lfieldlist1 lastcomma", "lfieldlist1 : expr1", "lfieldlist1 : lfieldlist1 ',' expr1", "varlist1 : var", @@ -1507,118 +1529,90 @@ $vars */ switch( yytmp ) { -case 2: -# line 411 "lua.stx" -{ - pc=maincode; basepc=*initcode; maxcurr=maxmain; - nlocalvar=0; - } break; -case 3: -# line 416 "lua.stx" -{ - maincode=pc; *initcode=basepc; maxmain=maxcurr; - } break; -case 7: -# line 425 "lua.stx" -{ - init_function(yypvt[-0].pNode); - } break; -case 8: -# line 429 "lua.stx" +case 6: +# line 470 "lua.stx" { - Word func = luaI_findsymbol(yypvt[-2].pNode); - s_tag(func) = LUA_T_FUNCTION; - s_bvalue(func) = yypvt[-0].pByte; + code_byte(PUSHFUNCTION); + code_code(yypvt[-0].pFunc); + storesinglevar(yypvt[-1].vLong); } break; -case 9: -# line 437 "lua.stx" -{ - init_function(yypvt[-0].pNode); - localvar[nlocalvar]=luaI_findsymbolbyname("self"); - add_nlocalvar(1); - } break; -case 10: -# line 443 "lua.stx" +case 7: +# line 477 "lua.stx" +{ yyval.vLong =yypvt[-0].vLong; init_func(); } break; +case 8: +# line 479 "lua.stx" { - /* assign function to table field */ - pc=maincode; basepc=*initcode; maxcurr=maxmain; - nlocalvar=0; - lua_pushvar(luaI_findsymbol(yypvt[-4].pNode)+1); - code_byte(PUSHSTRING); - code_word(luaI_findconstant(yypvt[-2].pNode)); - code_byte(PUSHFUNCTION); - code_code(yypvt[-0].pByte); - code_byte(STOREINDEXED0); - maincode=pc; *initcode=basepc; maxmain=maxcurr; - } break; -case 11: -# line 458 "lua.stx" + code_byte(PUSHSTRING); + code_word(luaI_findconstant(yypvt[-0].pNode)); + yyval.vLong = 0; /* indexed variable */ + init_func(); + add_localvar(luaI_findsymbolbyname("self")); + } break; +case 9: +# line 489 "lua.stx" { codereturn(); - yyval.pByte = newvector(pc, Byte); - memcpy(yyval.pByte, basepc, pc*sizeof(Byte)); + yyval.pFunc = new(TFunc); + yyval.pFunc->size = pc; + yyval.pFunc->code = newvector(pc, Byte); + yyval.pFunc->fileName = lua_parsedfile; + yyval.pFunc->lineDefined = yypvt[-3].vInt; + memcpy(yyval.pFunc->code, basepc, pc*sizeof(Byte)); + /* save func values */ funcCode = basepc; maxcode=maxcurr; #if LISTING PrintCode(funcCode,funcCode+pc); #endif + change2main(); /* change back to main code */ } break; -case 16: -# line 475 "lua.stx" -{ codedebugline(); } break; -case 18: -# line 477 "lua.stx" -{ codedebugline(); } break; -case 20: -# line 480 "lua.stx" +case 14: +# line 513 "lua.stx" { codeIf(yypvt[-4].vLong, yypvt[-2].vLong); } break; -case 21: -# line 482 "lua.stx" +case 15: +# line 515 "lua.stx" {yyval.vLong=pc;} break; -case 22: -# line 483 "lua.stx" +case 16: +# line 516 "lua.stx" { basepc[yypvt[-3].vLong] = IFFJMP; code_word_at(basepc+yypvt[-3].vLong+1, pc - (yypvt[-3].vLong + sizeof(Word)+1)); basepc[yypvt[-1].vLong] = UPJMP; code_word_at(basepc+yypvt[-1].vLong+1, pc - (yypvt[-6].vLong)); } break; -case 23: -# line 490 "lua.stx" +case 17: +# line 523 "lua.stx" {yyval.vLong=pc;} break; -case 24: -# line 491 "lua.stx" +case 18: +# line 524 "lua.stx" { basepc[yypvt[-0].vLong] = IFFUPJMP; code_word_at(basepc+yypvt[-0].vLong+1, pc - (yypvt[-4].vLong)); } break; -case 25: -# line 497 "lua.stx" +case 19: +# line 530 "lua.stx" { { int i; - adjust_mult_assign(nvarbuffer, yypvt[-0].vInt, yypvt[-2].vInt * 2 + nvarbuffer); + adjust_mult_assign(nvarbuffer, yypvt[-0].vLong, yypvt[-2].vInt * 2 + nvarbuffer); for (i=nvarbuffer-1; i>=0; i--) lua_codestore (i); if (yypvt[-2].vInt > 1 || (yypvt[-2].vInt == 1 && varbuffer[0] != 0)) lua_codeadjust (0); } } break; -case 26: -# line 507 "lua.stx" -{ code_byte(0); } break; -case 27: -# line 509 "lua.stx" -{ add_nlocalvar(yypvt[-1].vInt); +case 21: +# line 542 "lua.stx" +{ nlocalvar += yypvt[-1].vInt; adjust_mult_assign(yypvt[-1].vInt, yypvt[-0].vInt, 0); - } break; -case 30: -# line 517 "lua.stx" + } break; +case 24: +# line 550 "lua.stx" { codeIf(yypvt[-3].vLong, yypvt[-1].vLong); } break; -case 31: -# line 520 "lua.stx" +case 25: +# line 553 "lua.stx" {yyval.vInt = nlocalvar;} break; -case 32: -# line 521 "lua.stx" +case 26: +# line 554 "lua.stx" { if (nlocalvar != yypvt[-2].vInt) { @@ -1626,247 +1620,263 @@ case 32: lua_codeadjust (0); } } break; -case 34: -# line 531 "lua.stx" -{ codedebugline(); } break; -case 35: -# line 532 "lua.stx" +case 28: +# line 565 "lua.stx" { - if (yypvt[-1].vInt < 0) code_byte(MULT_RET); + adjust_functioncall(yypvt[-1].vLong, MULT_RET); codereturn(); } break; -case 36: -# line 539 "lua.stx" +case 29: +# line 572 "lua.stx" { yyval.vLong = pc; code_byte(0); /* open space */ code_word (0); } break; +case 30: +# line 578 "lua.stx" +{ adjust_functioncall(yypvt[-0].vLong, 1); } break; +case 31: +# line 581 "lua.stx" +{ yyval.vLong = yypvt[-1].vLong; } break; +case 32: +# line 582 "lua.stx" +{ code_byte(EQOP); yyval.vLong = 0; } break; +case 33: +# line 583 "lua.stx" +{ code_byte(LTOP); yyval.vLong = 0; } break; +case 34: +# line 584 "lua.stx" +{ code_byte(GTOP); yyval.vLong = 0; } break; +case 35: +# line 585 "lua.stx" +{ code_byte(EQOP); code_byte(NOTOP); yyval.vLong = 0; } break; +case 36: +# line 586 "lua.stx" +{ code_byte(LEOP); yyval.vLong = 0; } break; case 37: -# line 545 "lua.stx" -{ if (yypvt[-0].vInt == 0) code_byte(1); } break; +# line 587 "lua.stx" +{ code_byte(GEOP); yyval.vLong = 0; } break; case 38: -# line 548 "lua.stx" -{ yyval.vInt = yypvt[-1].vInt; } break; +# line 588 "lua.stx" +{ code_byte(ADDOP); yyval.vLong = 0; } break; case 39: -# line 549 "lua.stx" -{ code_byte(EQOP); yyval.vInt = 1; } break; +# line 589 "lua.stx" +{ code_byte(SUBOP); yyval.vLong = 0; } break; case 40: -# line 550 "lua.stx" -{ code_byte(LTOP); yyval.vInt = 1; } break; +# line 590 "lua.stx" +{ code_byte(MULTOP); yyval.vLong = 0; } break; case 41: -# line 551 "lua.stx" -{ code_byte(GTOP); yyval.vInt = 1; } break; +# line 591 "lua.stx" +{ code_byte(DIVOP); yyval.vLong = 0; } break; case 42: -# line 552 "lua.stx" -{ code_byte(EQOP); code_byte(NOTOP); yyval.vInt = 1; } break; +# line 592 "lua.stx" +{ code_byte(POWOP); yyval.vLong = 0; } break; case 43: -# line 553 "lua.stx" -{ code_byte(LEOP); yyval.vInt = 1; } break; +# line 593 "lua.stx" +{ code_byte(CONCOP); yyval.vLong = 0; } break; case 44: -# line 554 "lua.stx" -{ code_byte(GEOP); yyval.vInt = 1; } break; +# line 594 "lua.stx" +{ code_byte(MINUSOP); yyval.vLong = 0;} break; case 45: -# line 555 "lua.stx" -{ code_byte(ADDOP); yyval.vInt = 1; } break; +# line 595 "lua.stx" +{ yyval.vLong = 0; } break; case 46: -# line 556 "lua.stx" -{ code_byte(SUBOP); yyval.vInt = 1; } break; +# line 596 "lua.stx" +{ yyval.vLong = 0;} break; case 47: -# line 557 "lua.stx" -{ code_byte(MULTOP); yyval.vInt = 1; } break; +# line 597 "lua.stx" +{ code_number(yypvt[-0].vFloat); yyval.vLong = 0; } break; case 48: -# line 558 "lua.stx" -{ code_byte(DIVOP); yyval.vInt = 1; } break; -case 49: -# line 559 "lua.stx" -{ code_byte(POWOP); yyval.vInt = 1; } break; -case 50: -# line 560 "lua.stx" -{ code_byte(CONCOP); yyval.vInt = 1; } break; -case 51: -# line 561 "lua.stx" -{ code_byte(MINUSOP); yyval.vInt = 1;} break; -case 52: -# line 562 "lua.stx" -{ yyval.vInt = 1; } break; -case 53: -# line 563 "lua.stx" -{ yyval.vInt = 1;} break; -case 54: -# line 564 "lua.stx" -{ code_number(yypvt[-0].vFloat); yyval.vInt = 1; } break; -case 55: -# line 566 "lua.stx" +# line 599 "lua.stx" { code_byte(PUSHSTRING); code_word(yypvt[-0].vWord); - yyval.vInt = 1; + yyval.vLong = 0; } break; -case 56: -# line 571 "lua.stx" -{code_byte(PUSHNIL); yyval.vInt = 1; } break; -case 57: -# line 572 "lua.stx" -{ yyval.vInt = 0; } break; -case 58: -# line 573 "lua.stx" -{ code_byte(NOTOP); yyval.vInt = 1;} break; -case 59: -# line 574 "lua.stx" +case 49: +# line 604 "lua.stx" +{code_byte(PUSHNIL); yyval.vLong = 0; } break; +case 50: +# line 605 "lua.stx" +{ yyval.vLong = yypvt[-0].vLong; } break; +case 51: +# line 606 "lua.stx" +{ code_byte(NOTOP); yyval.vLong = 0;} break; +case 52: +# line 607 "lua.stx" {code_byte(POP); } break; -case 60: -# line 575 "lua.stx" +case 53: +# line 608 "lua.stx" { basepc[yypvt[-2].vLong] = ONFJMP; code_word_at(basepc+yypvt[-2].vLong+1, pc - (yypvt[-2].vLong + sizeof(Word)+1)); - yyval.vInt = 1; + yyval.vLong = 0; } break; -case 61: -# line 580 "lua.stx" +case 54: +# line 613 "lua.stx" {code_byte(POP); } break; -case 62: -# line 581 "lua.stx" +case 55: +# line 614 "lua.stx" { basepc[yypvt[-2].vLong] = ONTJMP; code_word_at(basepc+yypvt[-2].vLong+1, pc - (yypvt[-2].vLong + sizeof(Word)+1)); - yyval.vInt = 1; + yyval.vLong = 0; } break; -case 63: -# line 589 "lua.stx" +case 56: +# line 622 "lua.stx" { code_byte(CREATEARRAY); yyval.vLong = pc; code_word(0); } break; -case 64: -# line 594 "lua.stx" +case 57: +# line 627 "lua.stx" { code_word_at(basepc+yypvt[-3].vLong, yypvt[-1].vInt); } break; -case 65: -# line 600 "lua.stx" -{ code_byte(CALLFUNC); code_byte(yypvt[-1].vInt+yypvt[-0].vInt); } break; -case 66: -# line 603 "lua.stx" +case 58: +# line 633 "lua.stx" +{ + code_byte(CALLFUNC); + code_byte(yypvt[-1].vInt+yypvt[-0].vInt); + yyval.vLong = pc; + code_byte(0); /* may be modified by other rules */ + } break; +case 59: +# line 641 "lua.stx" { yyval.vInt = 0; } break; -case 67: -# line 605 "lua.stx" +case 60: +# line 643 "lua.stx" { code_byte(PUSHSELF); code_word(luaI_findconstant(yypvt[-0].pNode)); yyval.vInt = 1; } break; +case 61: +# line 651 "lua.stx" +{ yyval.vInt = adjust_functioncall(yypvt[-1].vLong, 1); } break; +case 62: +# line 652 "lua.stx" +{ yyval.vInt = 1; } break; +case 63: +# line 655 "lua.stx" +{ yyval.vLong = 0; } break; +case 64: +# line 656 "lua.stx" +{ yyval.vLong = yypvt[-0].vLong; } break; +case 65: +# line 659 "lua.stx" +{ if (yypvt[-0].vLong != 0) yyval.vLong = yypvt[-0].vLong; else yyval.vLong = -1; } break; +case 66: +# line 660 "lua.stx" +{ yyval.vLong = adjust_functioncall(yypvt[-1].vLong, 1); } break; +case 67: +# line 661 "lua.stx" +{ + if (yypvt[-0].vLong == 0) yyval.vLong = -(yypvt[-1].vLong + 1); /* -length */ + else + { + adjust_functioncall(yypvt[-0].vLong, yypvt[-1].vLong); + yyval.vLong = yypvt[-0].vLong; + } + } break; case 68: -# line 613 "lua.stx" -{ if (yypvt[-1].vInt<0) { code_byte(1); yyval.vInt = -yypvt[-1].vInt; } else yyval.vInt = yypvt[-1].vInt; } break; +# line 671 "lua.stx" +{ lua_codeadjust(0); yyval.vInt = lua_linenumber; } break; case 69: -# line 614 "lua.stx" -{ yyval.vInt = 1; } break; +# line 672 "lua.stx" +{ lua_codeadjust(0); yyval.vInt = lua_linenumber; } break; case 70: -# line 617 "lua.stx" -{ yyval.vInt = 0; } break; +# line 676 "lua.stx" +{ + add_localvar(luaI_findsymbol(yypvt[-0].pNode)); + } break; case 71: -# line 618 "lua.stx" -{ yyval.vInt = yypvt[-0].vInt; } break; +# line 680 "lua.stx" +{ + add_localvar(luaI_findsymbol(yypvt[-0].pNode)); + } break; case 72: -# line 621 "lua.stx" -{ if (yypvt[-0].vInt == 0) yyval.vInt = -1; else yyval.vInt = 1; } break; +# line 686 "lua.stx" +{ flush_list(yypvt[-0].vInt/FIELDS_PER_FLUSH, yypvt[-0].vInt%FIELDS_PER_FLUSH); } break; case 73: -# line 622 "lua.stx" -{ if (yypvt[-1].vInt < 0) code_byte(1); } break; +# line 688 "lua.stx" +{ yyval.vInt = yypvt[-2].vInt+yypvt[-0].vInt; } break; case 74: -# line 623 "lua.stx" -{ - int r = yypvt[-3].vInt < 0 ? -yypvt[-3].vInt : yypvt[-3].vInt; - yyval.vInt = (yypvt[-0].vInt == 0) ? -(r+1) : r+1; - } break; +# line 690 "lua.stx" +{ yyval.vInt = yypvt[-1].vInt; flush_record(yypvt[-1].vInt%FIELDS_PER_FLUSH); } break; case 75: -# line 629 "lua.stx" -{ lua_codeadjust(0); } break; +# line 694 "lua.stx" +{ yyval.vInt = 0; } break; case 76: -# line 630 "lua.stx" -{ lua_codeadjust(0); } break; -case 77: -# line 634 "lua.stx" -{ - localvar[nlocalvar]=luaI_findsymbol(yypvt[-0].pNode); - add_nlocalvar(1); - } break; -case 78: -# line 639 "lua.stx" -{ - localvar[nlocalvar]=luaI_findsymbol(yypvt[-0].pNode); - add_nlocalvar(1); - } break; +# line 696 "lua.stx" +{ yyval.vInt = yypvt[-0].vInt; flush_record(yypvt[-0].vInt%FIELDS_PER_FLUSH); } break; case 79: -# line 645 "lua.stx" -{ yyval.vInt = 0; } break; +# line 703 "lua.stx" +{ yyval.vInt = 0; } break; case 80: -# line 647 "lua.stx" -{ yyval.vInt = yypvt[-1].vInt; flush_list(yypvt[-1].vInt/FIELDS_PER_FLUSH, yypvt[-1].vInt%FIELDS_PER_FLUSH); } break; +# line 704 "lua.stx" +{ yyval.vInt = yypvt[-1].vInt; } break; case 81: -# line 649 "lua.stx" -{ yyval.vInt = yypvt[-1].vInt; flush_record(yypvt[-1].vInt%FIELDS_PER_FLUSH); } break; -case 82: -# line 651 "lua.stx" -{ flush_list(yypvt[-1].vInt/FIELDS_PER_FLUSH, yypvt[-1].vInt%FIELDS_PER_FLUSH); } break; -case 83: -# line 653 "lua.stx" -{ yyval.vInt = yypvt[-4].vInt+yypvt[-1].vInt; flush_record(yypvt[-1].vInt%FIELDS_PER_FLUSH); } break; -case 86: -# line 660 "lua.stx" +# line 707 "lua.stx" {yyval.vInt=1;} break; -case 87: -# line 662 "lua.stx" +case 82: +# line 709 "lua.stx" { yyval.vInt=yypvt[-2].vInt+1; if (yyval.vInt%FIELDS_PER_FLUSH == 0) flush_record(FIELDS_PER_FLUSH); } break; -case 88: -# line 669 "lua.stx" +case 83: +# line 716 "lua.stx" { push_field(luaI_findconstant(yypvt[-2].pNode)); } break; -case 89: -# line 674 "lua.stx" +case 84: +# line 721 "lua.stx" +{ yyval.vInt = 0; } break; +case 85: +# line 722 "lua.stx" +{ yyval.vInt = yypvt[-1].vInt; } break; +case 86: +# line 725 "lua.stx" {yyval.vInt=1;} break; -case 90: -# line 676 "lua.stx" +case 87: +# line 727 "lua.stx" { yyval.vInt=yypvt[-2].vInt+1; if (yyval.vInt%FIELDS_PER_FLUSH == 0) flush_list(yyval.vInt/FIELDS_PER_FLUSH - 1, FIELDS_PER_FLUSH); } break; -case 91: -# line 684 "lua.stx" +case 88: +# line 735 "lua.stx" { nvarbuffer = 0; - varbuffer[nvarbuffer] = yypvt[-0].vLong; incr_nvarbuffer(); + add_varbuffer(yypvt[-0].vLong); yyval.vInt = (yypvt[-0].vLong == 0) ? 1 : 0; } break; -case 92: -# line 690 "lua.stx" +case 89: +# line 741 "lua.stx" { - varbuffer[nvarbuffer] = yypvt[-0].vLong; incr_nvarbuffer(); + add_varbuffer(yypvt[-0].vLong); yyval.vInt = (yypvt[-0].vLong == 0) ? yypvt[-2].vInt + 1 : yypvt[-2].vInt; } break; -case 93: -# line 696 "lua.stx" +case 90: +# line 747 "lua.stx" { yyval.vLong = yypvt[-0].vLong; } break; -case 94: -# line 698 "lua.stx" +case 91: +# line 749 "lua.stx" { yyval.vLong = 0; /* indexed variable */ } break; -case 95: -# line 702 "lua.stx" +case 92: +# line 753 "lua.stx" { code_byte(PUSHSTRING); code_word(luaI_findconstant(yypvt[-0].pNode)); yyval.vLong = 0; /* indexed variable */ } break; -case 96: -# line 710 "lua.stx" +case 93: +# line 761 "lua.stx" { Word s = luaI_findsymbol(yypvt[-0].pNode); int local = lua_localname (s); @@ -1875,27 +1885,27 @@ case 96: else yyval.vLong = -(local+1); /* return negative value */ } break; -case 97: -# line 720 "lua.stx" +case 94: +# line 771 "lua.stx" { lua_pushvar(yypvt[-0].vLong); } break; -case 98: -# line 723 "lua.stx" -{localvar[nlocalvar]=luaI_findsymbol(yypvt[-0].pNode); yyval.vInt = 1;} break; -case 99: -# line 725 "lua.stx" +case 95: +# line 774 "lua.stx" +{store_localvar(luaI_findsymbol(yypvt[-0].pNode), 0); yyval.vInt = 1;} break; +case 96: +# line 776 "lua.stx" { - localvar[nlocalvar+yypvt[-2].vInt]=luaI_findsymbol(yypvt[-0].pNode); + store_localvar(luaI_findsymbol(yypvt[-0].pNode), yypvt[-2].vInt); yyval.vInt = yypvt[-2].vInt+1; } break; -case 100: -# line 731 "lua.stx" +case 97: +# line 782 "lua.stx" { yyval.vInt = 0; } break; -case 101: -# line 732 "lua.stx" -{ yyval.vInt = yypvt[-0].vInt; } break; -case 102: -# line 735 "lua.stx" -{lua_debug = yypvt[-0].vInt;} break; +case 98: +# line 783 "lua.stx" +{ yyval.vInt = yypvt[-0].vLong; } break; +case 99: +# line 786 "lua.stx" +{ lua_debug = yypvt[-0].vInt; } break; } goto yystack; /* reset registers in driver code */ } diff --git a/src/parser.h b/src/parser.h index 4c125da..ea815f1 100644 --- a/src/parser.h +++ b/src/parser.h @@ -1,4 +1,3 @@ - typedef union { int vInt; @@ -6,7 +5,7 @@ typedef union char *pChar; Word vWord; Long vLong; - Byte *pByte; + TFunc *pFunc; TreeNode *pNode; } YYSTYPE; extern YYSTYPE yylval; diff --git a/src/table.c b/src/table.c index cedbf31..1a2ac96 100644 --- a/src/table.c +++ b/src/table.c @@ -3,38 +3,34 @@ ** Module to control static tables */ -char *rcs_table="$Id: table.c,v 2.28 1995/01/18 20:15:54 celes Exp $"; +char *rcs_table="$Id: table.c,v 2.38 1995/11/03 15:30:50 roberto Exp $"; -#include +/*#include */ #include "mem.h" #include "opcode.h" #include "tree.h" #include "hash.h" -#include "inout.h" #include "table.h" +#include "inout.h" #include "lua.h" #include "fallback.h" +#include "luadebug.h" #define BUFFER_BLOCK 256 -Symbol *lua_table; +Symbol *lua_table = NULL; static Word lua_ntable = 0; static Long lua_maxsymbol = 0; -TaggedString **lua_constant; +TaggedString **lua_constant = NULL; static Word lua_nconstant = 0; static Long lua_maxconstant = 0; - -#define MAXFILE 20 -char *lua_file[MAXFILE]; -int lua_nfile; - -#define GARBAGE_BLOCK 256 -#define MIN_GARBAGE_BLOCK 10 +#define GARBAGE_BLOCK 1024 +#define MIN_GARBAGE_BLOCK (GARBAGE_BLOCK/2) static void lua_nextvar (void); static void setglobal (void); @@ -117,9 +113,8 @@ Word luaI_findsymbolbyname (char *name) /* -** Given a name, search it at constant table and return its index. If not -** found, allocate it. -** On error, return -1. +** Given a tree node, check it is has a correspondent constant index. If not, +** allocate it. */ Word luaI_findconstant (TreeNode *t) { @@ -144,26 +139,38 @@ Word luaI_findconstant (TreeNode *t) } +Word luaI_findconstantbyname (char *name) +{ + return luaI_findconstant(lua_constcreate(name)); +} + + /* ** Traverse symbol table objects */ -void lua_travsymbol (void (*fn)(Object *)) +static char *lua_travsymbol (int (*fn)(Object *)) { Word i; for (i=0; its.str; + return NULL; } /* ** Mark an object if it is a string or a unmarked array. */ -void lua_markobject (Object *o) +int lua_markobject (Object *o) { if (tag(o) == LUA_T_STRING && !tsvalue(o)->marked) tsvalue(o)->marked = 1; else if (tag(o) == LUA_T_ARRAY) lua_hashmark (avalue(o)); + else if ((o->tag == LUA_T_FUNCTION || o->tag == LUA_T_MARK) + && !o->value.tf->marked) + o->value.tf->marked = 1; + return 0; } @@ -180,8 +187,10 @@ void lua_pack (void) lua_travstack(lua_markobject); /* mark stack objects */ lua_travsymbol(lua_markobject); /* mark symbol table objects */ luaI_travlock(lua_markobject); /* mark locked objects */ + luaI_travfallbacks(lua_markobject); /* mark fallbacks */ recovered += lua_strcollector(); recovered += lua_hashcollector(); + recovered += luaI_funccollector(); nentity = 0; /* reset counter */ block=(16*block-7*recovered)/12; /* adapt block size */ if (block < MIN_GARBAGE_BLOCK) block = MIN_GARBAGE_BLOCK; @@ -189,70 +198,39 @@ void lua_pack (void) /* -** Add a file name at file table, checking overflow. This function also set -** the external variable "lua_filename" with the function filename set. -** Return 0 on success or error message on error. -*/ -char *lua_addfile (char *fn) -{ - if (lua_nfile >= MAXFILE) - return "too many files"; - if ((lua_file[lua_nfile++] = luaI_strdup (fn)) == NULL) - return "not enough memory"; - return NULL; -} - -/* -** Delete a file from file stack -*/ -int lua_delfile (void) -{ - luaI_free(lua_file[--lua_nfile]); - return 1; -} - -/* -** Return the last file name set. -*/ -char *lua_filename (void) -{ - return lua_file[lua_nfile-1]; -} - -/* ** Internal function: return next global variable */ static void lua_nextvar (void) { - char *varname; - TreeNode *next; + Word next; lua_Object o = lua_getparam(1); if (o == LUA_NOOBJECT) - lua_reportbug("too few arguments to function `nextvar'"); + lua_error("too few arguments to function `nextvar'"); if (lua_getparam(2) != LUA_NOOBJECT) - lua_reportbug("too many arguments to function `nextvar'"); + lua_error("too many arguments to function `nextvar'"); if (lua_isnil(o)) - varname = NULL; + next = 0; else if (!lua_isstring(o)) { - lua_reportbug("incorrect argument to function `nextvar'"); + lua_error("incorrect argument to function `nextvar'"); return; /* to avoid warnings */ } else - varname = lua_getstring(o); - next = lua_varnext(varname); - if (next == NULL) + next = luaI_findsymbolbyname(lua_getstring(o)) + 1; + while (next < lua_ntable && s_tag(next) == LUA_T_NIL) next++; + if (next >= lua_ntable) { lua_pushnil(); lua_pushnil(); } else { + TreeNode *t = luaI_nodebysymbol(next); Object name; tag(&name) = LUA_T_STRING; - tsvalue(&name) = &(next->ts); + tsvalue(&name) = &(t->ts); luaI_pushobject(&name); - luaI_pushobject(&s_object(next->varindex)); + luaI_pushobject(&s_object(next)); } } @@ -262,7 +240,7 @@ static void setglobal (void) lua_Object name = lua_getparam(1); lua_Object value = lua_getparam(2); if (!lua_isstring(name)) - lua_reportbug("incorrect argument to function `setglobal'"); + lua_error("incorrect argument to function `setglobal'"); lua_pushobject(value); lua_storeglobal(lua_getstring(name)); } @@ -272,6 +250,33 @@ static void getglobal (void) { lua_Object name = lua_getparam(1); if (!lua_isstring(name)) - lua_reportbug("incorrect argument to function `getglobal'"); + lua_error("incorrect argument to function `getglobal'"); lua_pushobject(lua_getglobal(lua_getstring(name))); } + + +static Object *functofind; +static int checkfunc (Object *o) +{ + if (o->tag == LUA_T_FUNCTION) + return + ((functofind->tag == LUA_T_FUNCTION || functofind->tag == LUA_T_MARK) + && (functofind->value.tf == o->value.tf)); + if (o->tag == LUA_T_CFUNCTION) + return + ((functofind->tag == LUA_T_CFUNCTION || functofind->tag == LUA_T_CMARK) + && (functofind->value.f == o->value.f)); + return 0; +} + + +char *getobjname (lua_Object o, char **name) +{ /* try to find a name for given function */ + functofind = luaI_Address(o); + if ((*name = luaI_travfallbacks(checkfunc)) != NULL) + return "fallback"; + else if ((*name = lua_travsymbol(checkfunc)) != NULL) + return "global"; + else return ""; +} + diff --git a/src/table.h b/src/table.h index c25075c..4e58140 100644 --- a/src/table.h +++ b/src/table.h @@ -1,7 +1,7 @@ /* ** Module to control static tables ** TeCGraf - PUC-Rio -** $Id: table.h,v 2.10 1994/12/20 21:20:36 roberto Exp $ +** $Id: table.h,v 2.13 1995/10/26 14:21:56 roberto Exp $ */ #ifndef table_h @@ -21,11 +21,9 @@ void lua_initconstant (void); Word luaI_findsymbolbyname (char *name); Word luaI_findsymbol (TreeNode *t); Word luaI_findconstant (TreeNode *t); -void lua_travsymbol (void (*fn)(Object *)); -void lua_markobject (Object *o); +Word luaI_findconstantbyname (char *name); +int lua_markobject (Object *o); void lua_pack (void); -char *lua_addfile (char *fn); -int lua_delfile (void); -char *lua_filename (void); + #endif diff --git a/src/tree.c b/src/tree.c index 5dd9d78..d4e7a42 100644 --- a/src/tree.c +++ b/src/tree.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_tree="$Id: tree.c,v 1.13 1995/01/12 14:19:04 roberto Exp $"; +char *rcs_tree="$Id: tree.c,v 1.14 1995/10/17 11:53:53 roberto Exp $"; #include @@ -102,40 +102,22 @@ Long lua_strcollector (void) return counter; } + /* -** Return next variable. +** Traverse the constant tree looking for a specific symbol number */ -static TreeNode *tree_next (TreeNode *node, char *str) +static TreeNode *nodebysymbol (TreeNode *root, Word symbol) { - if (node == NULL) return NULL; - else if (str == NULL) return node; - else - { - int c = lua_strcmp(str, node->ts.str); - if (c == 0) - return node->left != NULL ? node->left : node->right; - else if (c < 0) - { - TreeNode *result = tree_next(node->left, str); - return result != NULL ? result : node->right; - } - else - return tree_next(node->right, str); - } + TreeNode *t; + if (root == NULL) return NULL; + if (root->varindex == symbol) return root; + t = nodebysymbol(root->left, symbol); + if (t) return t; + return nodebysymbol(root->right, symbol); } -TreeNode *lua_varnext (char *n) +TreeNode *luaI_nodebysymbol (Word symbol) { - TreeNode *result; - char *name = n; - while (1) - { /* repeat until a valid (non nil) variable */ - result = tree_next(constant_root, name); - if (result == NULL) return NULL; - if (result->varindex != NOT_USED && - s_tag(result->varindex) != LUA_T_NIL) - return result; - name = result->ts.str; - } + return nodebysymbol(constant_root, symbol); } diff --git a/src/tree.h b/src/tree.h index 849cd5a..48ecb02 100644 --- a/src/tree.h +++ b/src/tree.h @@ -1,7 +1,7 @@ /* ** tree.h ** TecCGraf - PUC-Rio -** $Id: tree.h,v 1.9 1995/01/12 14:19:04 roberto Exp $ +** $Id: tree.h,v 1.10 1995/10/17 11:53:53 roberto Exp $ */ #ifndef tree_h @@ -32,6 +32,6 @@ typedef struct TreeNode TaggedString *lua_createstring (char *str); TreeNode *lua_constcreate (char *str); Long lua_strcollector (void); -TreeNode *lua_varnext (char *n); +TreeNode *luaI_nodebysymbol (Word symbol); #endif diff --git a/src/yacc/Makefile b/src/yacc/Makefile deleted file mode 100644 index 284d4ab..0000000 --- a/src/yacc/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -parser.c: - co -M lua.stx - yacc -d lua.stx ; mv -f y.tab.c ../parser.c ; mv -f y.tab.h ../parser.h diff --git a/test/README b/test/README new file mode 100644 index 0000000..625644d --- /dev/null +++ b/test/README @@ -0,0 +1,7 @@ +These are simple tests for Lua. Some of them contain useful code. +They are meant to be run to make sure Lua is ok and also to be read, to see +how Lua programs can look like. +In the directory examples/, there is more useful code, such as a library for +complex arithmetic (a good example of fallbacks for overloading and redefinition +of primitive functions), and a library for PostScript output. Both libraries +include simple examples. diff --git a/test/examples/complex/complex.lua b/test/examples/complex/complex.lua new file mode 100644 index 0000000..a213a74 --- /dev/null +++ b/test/examples/complex/complex.lua @@ -0,0 +1,82 @@ +-- complex.lua +-- complex arithmetic package for lua +-- Luiz Henrique de Figueiredo (lhf@csg.uwaterloo.ca) +-- 24 Oct 95 +$debug + +Complex={type="package"} + +function complex(x,y) + return { re=x, im=y, type="complex" } +end + +function Complex.conj(x,y) + return complex(x.re,-x.im) +end + +function Complex.norm2(x) + local n=Complex.mul(x,Complex.conj(x)) + return n.re +end + +function Complex.abs(x) + return sqrt(Complex.norm2(x)) +end + +function Complex.add(x,y) + return complex(x.re+y.re,x.im+y.im) +end + +function Complex.sub(x,y) + return complex(x.re-y.re,x.im-y.im) +end + +function Complex.mul(x,y) + return complex(x.re*y.re-x.im*y.im,x.re*y.im+x.im*y.re) +end + +function Complex.div(x,y) + local z=x*Complex.conj(y) + local t=Complex.norm2(y) + z.re=z.re/t + z.im=z.im/t + return z +end + +function Complex.fallback(x,y,op) + if type(x)=="number" then x=complex(x,0) end + if type(y)=="number" then y=complex(y,0) end + if type(x)=="complex" and type(y)=="complex" then + return Complex[op](x,y) + else + return Complex.oldfallback(x,y) + end +end + +function Complex.newtype(x) + local t=Complex.oldtype(x) + if t=="table" and x.type then return x.type else return t end +end + +function Complex.print(x) + if type(x)~="complex" then + Complex.oldprint(x) + else + local s + if x.im>=0 then s="+" else s="" end + Complex.oldprint(x.re..s..x.im.."I") + end +end + +function Complex.newabs(x) + if type(x)~="complex" then + return Complex.oldabs(x) + else + return Complex.abs(x) + end +end + +Complex.oldfallback=setfallback("arith",Complex.fallback) +Complex.oldtype=type type=Complex.newtype +Complex.oldprint=print print=Complex.print +Complex.oldabs=abs abs=Complex.abs diff --git a/test/examples/complex/mandel.lua b/test/examples/complex/mandel.lua new file mode 100644 index 0000000..5e3d3eb --- /dev/null +++ b/test/examples/complex/mandel.lua @@ -0,0 +1,25 @@ +dofile("complex.lua") + +xmin=-2 xmax=2 ymin=-2 ymax=2 +d=.125 + +function level(x,y) + local c=complex(x,y) + local l=0 + local z=c + repeat + z=z*z+c + l=l+1 + until abs(z)>2 or l>255 + return l-1 +end + +x=xmin +while x=cxmin and x<=cxmax and y>=cxmin and y<=cxmax) then + if (xxmax) then xmax=x end + if (yymax) then ymax=y end + empty=0 +-- end +end diff --git a/test/save.lua b/test/save.lua dissimilarity index 90% index 8c64c56..f16bdf2 100644 --- a/test/save.lua +++ b/test/save.lua @@ -1,46 +1,11 @@ - - -function savevar (n,v) - if v == nil then return end; - if type(v) == "number" then print(n.."="..v) return end - if type(v) == "string" then print(n.."='"..v.."'") return end - if type(v) == "table" then - if v.__visited__ ~= nil then - print(n .. "=" .. v.__visited__); - else - print(n.."=@()") - v.__visited__ = n; - local r,f; - r,f = next(v,nil); - while r ~= nil do - if r ~= "__visited__" then - if type(r) == 'string' then - savevar(n.."['"..r.."']",f) - else - savevar(n.."["..r.."]",f) - end - end - r,f = next(v,r) - end - end - end -end - -function save () -local n,v - n,v = nextvar(nil) - while n ~= nil do - savevar(n,v); - n,v = nextvar(n) - end -end - -a = 3 -x = {a = 4, b = "name", l={4,5,67}} - -b = {t=5} -x.next = b - - -save() - +dofile("dump.lua") + +a = 3 +x = {a = 4, b = "name", l={4,5,67}} + +b = {t=5} +x.next = b + + +save() + diff --git a/test/type.lua b/test/type.lua index 3079391..5bfc33e 100644 --- a/test/type.lua +++ b/test/type.lua @@ -30,8 +30,8 @@ typeblock = {x = {default = 0, type = "number"}, function block(t) check(t,typeblock) end -@block{ x = 7, name = "3"} -@block{ x = "7", name = "3"} -@block{ x = 7, name = 3} -@block{ x = 7} -@block{ x = 7, name = "3", bogus=3.14} +block{ x = 7, name = "3"} +block{ x = "7", name = "3"} +block{ x = 7, name = 3} +block{ x = 7} +block{ x = 7, name = "3", bogus=3.14} -- 2.11.4.GIT