From fbf887ec2be8b293d6f3ffc88b42c5a9e87bf022 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 2 Nov 1994 18:30:53 -0200 Subject: new way to call functions, plus several small changes. This is a temporary version! --- opcode.h | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) (limited to 'opcode.h') diff --git a/opcode.h b/opcode.h index f021dac8..4a35ca12 100644 --- a/opcode.h +++ b/opcode.h @@ -1,11 +1,13 @@ /* ** TeCGraf - PUC-Rio -** $Id: opcode.h,v 2.3 1994/08/05 19:31:09 celes Exp celes $ +** $Id: opcode.h,v 2.4 1994/10/17 19:00:40 celes Exp roberto $ */ #ifndef opcode_h #define opcode_h +#include "lua.h" + #ifndef STACKGAP #define STACKGAP 128 #endif @@ -16,6 +18,8 @@ #define FIELDS_PER_FLUSH 40 +#define MAX_TEMPS 20 + typedef unsigned char Byte; typedef unsigned short Word; @@ -54,8 +58,7 @@ typedef enum PUSHLOCAL, PUSHGLOBAL, PUSHINDEXED, - PUSHMARK, - PUSHMARKMET, + PUSHSELF, STORELOCAL0, STORELOCAL1, STORELOCAL2, STORELOCAL3, STORELOCAL4, STORELOCAL5, STORELOCAL6, STORELOCAL7, STORELOCAL8, STORELOCAL9, STORELOCAL, @@ -65,6 +68,7 @@ typedef enum STORELIST0, STORELIST, STORERECORD, + ADJUST0, ADJUST, CREATEARRAY, EQOP, @@ -86,34 +90,25 @@ typedef enum IFFUPJMP, POP, CALLFUNC, + RETCODE0, RETCODE, - HALT, SETFUNCTION, SETLINE, RESET } OpCode; -typedef enum -{ - T_MARK, - T_NIL, - T_NUMBER, - T_STRING, - T_ARRAY, - T_FUNCTION, - T_CFUNCTION, - T_USERDATA -} Type; +#define MULT_RET 255 + typedef void (*Cfunction) (void); typedef int (*Input) (void); typedef union { - Cfunction f; - real n; - char *s; - Byte *b; + Cfunction f; + real n; + char *s; + Byte *b; struct Hash *a; void *u; } Value; @@ -157,18 +152,12 @@ typedef struct /* Exported functions */ -int lua_execute (Byte *pc); -void lua_markstack (void); char *lua_strdup (char *l); void lua_setinput (Input fn); /* from "lex.c" module */ char *lua_lasttext (void); /* from "lex.c" module */ -int lua_parse (void); /* from "lua.stx" module */ -void lua_type (void); +Byte *lua_parse (void); /* from "lua.stx" module */ void lua_obj2number (void); -void lua_print (void); -void lua_internaldofile (void); -void lua_internaldostring (void); void lua_travstack (void (*fn)(Object *)); #endif -- cgit v1.2.3-55-g6feb