summaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-02 18:30:53 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-02 18:30:53 -0200
commitfbf887ec2be8b293d6f3ffc88b42c5a9e87bf022 (patch)
tree030c6dd803fff11ae0c368e90b78a9fef2b8b731 /opcode.h
parentae77864844d6b933eb8be68694cbb8498af165dc (diff)
downloadlua-github-fbf887ec2be8b293d6f3ffc88b42c5a9e87bf022.tar.gz
new way to call functions, plus several small changes. This is
a temporary version!
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h41
1 files changed, 15 insertions, 26 deletions
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