lcode.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. ** $Id: lcode.h,v 1.14 2000/06/16 17:51:40 roberto Exp roberto $
  3. ** Code generator for Lua
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lcode_h
  7. #define lcode_h
  8. #include "llex.h"
  9. #include "lobject.h"
  10. #include "lopcodes.h"
  11. #include "lparser.h"
  12. /*
  13. ** Marks the end of a patch list. It is an invalid value both as an absolute
  14. ** address, and as a list link (would link an element to itself).
  15. */
  16. #define NO_JUMP (-1)
  17. enum Mode {iO, iU, iS, iAB}; /* instruction format */
  18. #define VD 100 /* flag for variable delta */
  19. extern const struct OpProperties {
  20. char mode;
  21. unsigned char push;
  22. unsigned char pop;
  23. } luaK_opproperties[];
  24. void luaK_error (LexState *ls, const char *msg);
  25. int luaK_code0 (FuncState *fs, OpCode o);
  26. int luaK_code1 (FuncState *fs, OpCode o, int arg1);
  27. int luaK_code2 (FuncState *fs, OpCode o, int arg1, int arg2);
  28. int luaK_jump (FuncState *fs);
  29. void luaK_patchlist (FuncState *fs, int list, int target);
  30. void luaK_concat (FuncState *fs, int *l1, int l2);
  31. void luaK_goiftrue (FuncState *fs, expdesc *v, int keepvalue);
  32. int luaK_getlabel (FuncState *fs);
  33. void luaK_deltastack (FuncState *fs, int delta);
  34. void luaK_kstr (LexState *ls, int c);
  35. void luaK_number (FuncState *fs, Number f);
  36. void luaK_adjuststack (FuncState *fs, int n);
  37. int luaK_lastisopen (FuncState *fs);
  38. void luaK_setcallreturns (FuncState *fs, int nresults);
  39. void luaK_tostack (LexState *ls, expdesc *v, int onlyone);
  40. void luaK_storevar (LexState *ls, const expdesc *var);
  41. void luaK_prefix (LexState *ls, int op, expdesc *v);
  42. void luaK_infix (LexState *ls, int op, expdesc *v);
  43. void luaK_posfix (LexState *ls, int op, expdesc *v1, expdesc *v2);
  44. #endif