lua/lcode.h

45 lines
1.5 KiB
C
Raw Normal View History

2000-02-22 16:31:19 +03:00
/*
2000-03-10 21:37:44 +03:00
** $Id: lcode.h,v 1.5 2000/03/09 13:57:37 roberto Exp roberto $
2000-02-22 16:31:19 +03:00
** Code generator for Lua
** See Copyright Notice in lua.h
*/
#ifndef lcode_h
#define lcode_h
#include "llex.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lparser.h"
2000-02-22 16:31:19 +03:00
#define luaK_0(ls,o,d) luaK_code(ls, CREATE_0(o), d)
#define luaK_U(ls,o,u,d) luaK_code(ls, CREATE_U(o,u), d)
#define luaK_S(ls,o,s,d) luaK_code(ls, CREATE_S(o,s), d)
#define luaK_AB(ls,o,a,b,d) luaK_code(ls, CREATE_AB(o,a,b), d)
void luaK_error (LexState *ls, const char *msg);
2000-02-22 16:31:19 +03:00
int luaK_primitivecode (LexState *ls, Instruction i);
int luaK_code (LexState *ls, Instruction i, int delta);
2000-03-04 23:18:15 +03:00
void luaK_retcode (LexState *ls, int nlocals, int nexps);
2000-02-22 16:31:19 +03:00
void luaK_fixjump (LexState *ls, int pc, int dest);
void luaK_patchlist (LexState *ls, int list, int target);
void luaK_goiftrue (LexState *ls, expdesc *v, int keepvalue);
void luaK_goiffalse (LexState *ls, expdesc *v, int keepvalue);
2000-03-04 23:18:15 +03:00
int luaK_getlabel (LexState *ls);
void luaK_deltastack (LexState *ls, int delta);
void luaK_kstr (LexState *ls, int c);
2000-03-10 21:37:44 +03:00
void luaK_number (LexState *ls, Number f);
void luaK_adjuststack (LexState *ls, int n);
2000-03-04 23:18:15 +03:00
int luaK_lastisopen (LexState *ls);
void luaK_setcallreturns (LexState *ls, int nresults);
void luaK_tostack (LexState *ls, expdesc *v, int onlyone);
void luaK_storevar (LexState *ls, const expdesc *var);
void luaK_prefix (LexState *ls, int op, expdesc *v);
2000-03-04 23:18:15 +03:00
void luaK_infix (LexState *ls, int op, expdesc *v);
void luaK_posfix (LexState *ls, int op, expdesc *v1, expdesc *v2);
2000-02-22 16:31:19 +03:00
#endif