compiler_new.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef SLEDGE_COMPILER_H
  2. #define SLEDGE_COMPILER_H
  3. typedef jit_word_t (*funcptr)();
  4. typedef enum builtin_t {
  5. BUILTIN_ADD = 1,
  6. BUILTIN_SUB,
  7. BUILTIN_MUL,
  8. BUILTIN_DIV,
  9. BUILTIN_MOD,
  10. BUILTIN_LT,
  11. BUILTIN_GT,
  12. BUILTIN_EQ,
  13. BUILTIN_WHILE,
  14. BUILTIN_DEF,
  15. BUILTIN_IF ,
  16. BUILTIN_FN ,
  17. BUILTIN_CAR,
  18. BUILTIN_CDR,
  19. BUILTIN_CONS,
  20. BUILTIN_LIST,
  21. BUILTIN_ALLOC,
  22. BUILTIN_ALLOC_STR,
  23. BUILTIN_CONCAT,
  24. BUILTIN_SUBSTR,
  25. BUILTIN_GET,
  26. BUILTIN_GET32,
  27. BUILTIN_PUT,
  28. BUILTIN_PUT32,
  29. BUILTIN_SIZE,
  30. BUILTIN_UGET,
  31. BUILTIN_UPUT,
  32. BUILTIN_USIZE,
  33. BUILTIN_TYPE,
  34. BUILTIN_LET,
  35. BUILTIN_QUOTE,
  36. BUILTIN_MAP,
  37. BUILTIN_DO,
  38. BUILTIN_EVAL,
  39. BUILTIN_READ,
  40. BUILTIN_WRITE,
  41. BUILTIN_PRINT,
  42. BUILTIN_MOUNT,
  43. BUILTIN_MMAP,
  44. BUILTIN_OPEN,
  45. BUILTIN_CLOSE,
  46. BUILTIN_RECV,
  47. BUILTIN_SEND,
  48. BUILTIN_PIXEL,
  49. BUILTIN_FLIP,
  50. BUILTIN_RECTFILL,
  51. BUILTIN_BLIT,
  52. BUILTIN_BLIT_MONO,
  53. BUILTIN_BLIT_MONO_INV,
  54. BUILTIN_BLIT_STRING,
  55. BUILTIN_INKEY,
  56. BUILTIN_ALIEN,
  57. BUILTIN_GC,
  58. BUILTIN_SYMBOLS,
  59. BUILTIN_LOAD,
  60. BUILTIN_SAVE,
  61. BUILTIN_UDP_POLL,
  62. BUILTIN_UDP_SEND,
  63. BUILTIN_TCP_CONNECT,
  64. BUILTIN_TCP_BIND,
  65. BUILTIN_TCP_SEND,
  66. BUILTIN_SIN,
  67. BUILTIN_COS,
  68. BUILTIN_SQRT
  69. } builtin_t;
  70. Cell* insert_global_symbol(Cell* symbol, Cell* cell);
  71. env_entry* lookup_global_symbol(char* name);
  72. #endif